The idle re-learn, as you put it, is the same for all Mazdas.
Disconnect both terminals from the battery.
Depress the brake pedals(this completes a circuit to the brake lights).
Reconnect the terminals. Start.
Every time the ECU loses power (when you radio stations reset :) ), it treats itself...