While having a look to Beagle's GPIO handling in U-Boot v1, I wonder if we have an off by one error there. As I'm not sure, anybody likes to re-check this?
I wonder if it has to be GPIO2 | GPIO1 above instead of GPIO3 | GPIO2 to configure GPIO_161 and GPIO_162 ? As I understand it, GPIO module 6 goes from GPIO_160 to GPIO_192. So GPIO_161 would be at offset GPIO1 and GPIO_162 would be at offset GPIO2?
What do you think?
I'm not sure about GPIO10 | GPIO9, though. This configures GPIO_169 and GPIO_170?
GPIO module 5 in the same function looks correct to me:
I agree - Seems like GPIO-block 6 is off by one for GPIO_161 and GPIO_162
(Should had been 1 and 2 instead of 2 and 3). The signals are however only
routed to the expansion connector, which might be the reason why nobody have
caught the mistake yet
Secondly you are right, that GPIO9 and GPIO10 in block 6 addresses real
world
GPIO_169 and GPIO_170.
Last I can confirm, that GPIO-block 6 starts at GPIO_160 and ends at
GPIO_191
- Both included
I agree - Seems like GPIO-block 6 is off by one for GPIO_161 and GPIO_162
(Should had been 1 and 2 instead of 2 and 3). The signals are however only routed to the expansion connector, which might be the reason why nobody have
caught the mistake yet
ok, thanks for checking
Secondly you are right, that GPIO9 and GPIO10 in block 6 addresses real
world GPIO_169 and GPIO_170.
ok, then the question is: Is this correct?
Looking at the schmatic and pin mux we have:
I2C2_SCL/GPIO_168
MUX_VAL(CP(I2C2_SCL), (IEN | PTU | EN | M4)) /*GPIO_168*/\
GPIO_168 as well only goes to the expansion connector => Nobody/not many
uses it yet
I agree it makes no sense to configure GPIO_169, when the ball is muxed to
HSUSB0_DATA3...
I therefore think you new assignment is correct/better than the previous one
- Now the pinmuxing and GPIO configuration seem consistent...
My only questions is if we should mux I2C2 to I2C or GPIO functionality in
general? What is the general rule of thumb in U-boot? Set everything to
GPIO, leave not used stuff as untouched (safe-mode) or configure it to it's
given peripheral (I2C/UART/MMC/etc...)?
In case we decide to go for GPIO (which is what's currently in the pinmuxing
table - At least for I2C2), I think we should setup GPIO_183 as well as
GPIO_168 (I2C2-sda and I2C2-scl) in order to be consistent. I would
therefore recommend to add GPIO23 to the setup lines, like: