If the selector lever will not move from P using the proper shift procedure, continue to hold down the brake pedal.

Take the vehicle to an Authorized Mazda Dealer to have the system checked.
Shift-Lock System
Manual Shift ModeGenerator Disassembly/Assembly [Mzr 2.0, Mzr 2.5]
CAUTION:
Melt the solder quickly, otherwise the diodes (rectifier) and regulator will
be damaged by excessive heat.
1. Disassemble in the order indicated in the table.
2. Assemble in the reverse order of disassembly.
MZR 2.0
1
Rotor component
...
Combination Switch Removal/Installation
CAUTION:
Handling the air bag module improperly can accidentally deploy the air bag
module, which may seriously injure you. Read the air bag system service warnings
and cautions before handling the air bag module..
1. Switch the ignition to off.
2. Disconnect the negative batte ...
Transaxle Oil Replacement [G66 M R]
1. Park the vehicle on level ground.
2. Remove the aerodynamic under cover No.2..
3. Remove the drain plug and washer.
4. Drain the oil into a suitable container.
5. Install a new washer and the drain plug.
Tightening torque
39—59 N·m {4.0—6.0 kgf·m, 29—43 ft·lbf}
...