Hi anybody,
I read fsl_guts.h in powerpc architecture and saw Global Utility Registers like gpiocr as GPIO Control Register, gpindr as General-Purpose Input Data Register and gpoutdr as General-Purpose Output Data Register. But in GPIO registers in p1022 reference manual we have GPDIR register to set specify GPIO direction and GPDAT register for GPIO data register. We have only one register for data but fsl_guts.h defines two register for input an output data.
Does gpiocr work as GPDIR?
For GPDAT, which of the two registers I should use? gpindr or gpoutdr?
Thanks,
Regards.
Note the comment at the top of the struct that says, "Not all registers defined in this structure are available on all chips, so
you are expected to know whether a given register actually exists on your chip before you access it." gpindr and gpoutdr are for the GPIO on MPC8641D and possibly other chips.
The GPIO block on P1022 is not located in fsl_guts, but rather a separate CCSR register block (offset 0xf000). It is driven by drivers/gpio/gpio-mpc8xxx.c, where you'll find GPIO_DIR, GPIO_DAT, etc.