I'm afraid we don't have that grammar rule in spanish, we don't use auxiliar verbs as you do, we do change verbs according to the tense we want to express.
I work in Bilbao= Trabajo en Bilbao
I worked in Bilbao= Trabajaba en Bilbao
Do you work in Bilbao?= ¿Trabajas en Bilbao?
Did you work in Bilbao?= ¿Trabajanbas en Bilbao?
I used to work in Bilbao= Solía trabajar en Bilbao
I didn't work in Bilbao= No trabajaba en Bilbao.
What you refer to is the usage of do as an auxiliary verb for asking questions.
Do you smoke? Fumas?
Did is past tense of to do and used if it occurred in the past without any link to the present. There are often time markers such as a specific date or period/point of time:
yesterday, in 2004, last week
In Spanish you would use indefinido, but imperfecto for customary actions or when describing circumstances/conditions.
Did you smoke yesterday? Fumaste ayer?
Did you do your homework last night? Hiciste los deberes anoche?
Didn't you use to go to the cinema every week?
No solías ir al cine cada semana?
As you can see, there is no need to use do as an auxiliary verb in Spanish when asking questions that refer to the past.
There may also be more complete answers and threads to this. Have a go under search, advanced options and make sure to select the correct forum!