View unanswered posts | View active topics It is currently 18 Dec 2017, 22:15

Reply to topic  [ 4 posts ] 
 Carambola2 bootstrap pins and gpio 
Author Message

Joined: 17 May 2013, 17:50
Posts: 19
We we are using carambola2 on a board without ethernet. Here's the u-boot log
U-Boot 1.1.4 (Feb  8 2013 - 11:41:32)

AP121-2MB (ar9330) U-boot
ar7240_ddr_initial_config(145): python ddr init
#### TAP VALUE 1 = f, 2 = 10
64 MB
Top of RAM usable for U-Boot at: 84000000
Reserving 212k for U-Boot at: 83fc8000
Reserving 192k for malloc() at: 83f98000                                       
Reserving 44 Bytes for Board Info at: 83f97fd4                                 
Reserving 36 Bytes for Global Data at: 83f97fb0                                 
Reserving 128k for boot params() at: 83f77fb0                                   
Stack Pointer at: 83f77f98                                                     
Now running in RAM - U-Boot at: 83fc8000                                       
Flash Manuf Id 0xef, DeviceId0 0x40, DeviceId1 0x18                             
flash size 16777216, sector count = 256                                         
Flash: 16 MB                                                                   
In:    serial                                                                   
Out:   serial                                                                   
Err:   serial                                                                   
Net:   ag7240_enet_initialize...                                               
Fetching MAC Address from 0x83fec1a8                                           
Fetching MAC Address from 0x83fec1a8                                           
: cfg1 0x5 cfg2 0x7114                                                         
eth0: 00:00:00:00:00:00

It does not get past. I saw somewhere on the forum to pull-up GPIO17/BootstrapH pin, and It boots after that.
We also have newer carambola2 boards with a different u-boot, this does not happen on those.

What is the exact behavior of bootstrap pins in u-boot?
We need to use those pins as gpio. LED0/1/2 are not being exported as gpio in /sys/class/gpio,
but I can't see them being used anywhere.
Also, how are uart-rts and uart-cts pins freed in kernel for use as gpio?

10 Dec 2013, 07:21

Joined: 21 Aug 2013, 21:21
Posts: 101
tavish wrote:

Hi! I ordered some of it about 2 month ago, and they works as is, there is no need for external pullup/pulldown, all pins are left floating. Problem can be occurred if Your design pulls a pin to opposite state instead of default bootstrap setting. I did not find the bootstrap function of GPIO14, 15 and 17 in http://www.eeboard.com/wp-content/uploads/downloads/2013/08/AR9331.pdf (page 83) so I assume that they belongs to uboot config instead of AR9331 bootup - stop of uboot confirms this. So, You should check the voltage of all bootstrap pins first, if they are in H/L state as in documentation of carambola2

10 Dec 2013, 09:20

Joined: 21 Aug 2013, 21:21
Posts: 101
LED0 (GPIO0), LED2 (GPIO13) and LED3 (GPIO14) is being locked by kernel module "leds_gpio" - You can export them after removing this module by rmmod, or removing it permanently from /etc/modules.d

LED1 (GPIO1), LED4 (GPIO15), LED5 (GPIO16) and LED6 (GPIO17) are free to use, can be exported by default


After some experimenting, I found the cause of strange behavior of UART_RTS (GPIO11) and UART_CTS (GPIO12)! UART_FLOW_CONTROL_MODE bits (5:4) of UART Configuration and Status (UART_CS) 0x18020004 register says flow control is disabled by default, but the bit 9 JUMPSTART_DISABLE and 8 WPS_DISABLE of Extended GPIO Function Control (GPIO_FUNCTION_2) 0x18040030 register should be set to enable GPIO functionality on GPIO11 and 12 too!

You can alter it by program called "io" from 8devices repository. First, You should read its current value - it sets other things too, so You can get in a mess by setting only the bit 9:8!

root@OpenWrt:/# io -r -4 0x18040030
18040030:  00070000
root@OpenWrt:/# io -w -4 0x18040030 0x70300
root@OpenWrt:/# io -r -4 0x18040030
18040030:  00070300

Its a volatile bit, so it should be set on evey bootup > You can put this line to /etc/rc.local

10 Dec 2013, 11:57

Joined: 18 Nov 2013, 18:44
Posts: 54
Also for those that just want to few some GPIO pins and not to worry much I have found these Worry free GPIO pins(tm) :)
If you have need to use just few GPIO pins in your DIY project then use GPIO pins 18, 19, 20, 21, 22 and 23 without any worries, these pins are not used during booting. Other GPIO pins are not suitable for use if you don't know exactly what you are doing because they are used during boot process (bootstrap).

17 Jun 2014, 20:01
Display posts from previous:  Sort by  
Reply to topic   [ 4 posts ] 

Who is online

Users browsing this forum: No registered users

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Protected by Anti-Spam ACP Powered by phpBB® Forum Software © phpBB Group
Designed by ST Software.