7 Replies Latest reply: Mar 26, 2012 1:47 AM by Aaronwu RSS

    U-Boot

    Ashish

      Hi,

      While porting U-Boot for TLL6527M (which uses UART1 Port G for console), I found that the UART port for console telemetry seems to be hardwired to use only UART1 portF and no option to use UART1 portG is apparent, as can be seen from the following code snippet from serial.h: -

       

      http://blackfin.uclinux.org/git/?p=u-boot;a=blob;f=arch/blackfin/cpu/serial.h;h=8a076ddc924d7348a1c9062df658eb88c0151a01;hb=77cd82ac8e23fd743914fe97c94b535cdfe14ca8

       

      136 #elif defined(__ADSPBF52x__)

      137 # define DO_MUX(port, mux, tx, rx) \

      138         bfin_write_PORT##port##_MUX((bfin_read_PORT##port##_MUX() & ~PORT_x_MUX_##mux##_MASK) |              PORT_x_MUX_##mux##_FUNC_3); \

      139         bfin_write_PORT##port##_FER(bfin_read_PORT##port##_FER() | P##port##tx | P##port##rx);

      140         switch (CONFIG_UART_CONSOLE) {

      141         case 0: DO_MUX(G, 2, 7, 8);   break;    /* Port G; mux 2; PG2 and PG8 */

      142         case 1: DO_MUX(F, 5, 14, 15); break;    /* Port F; mux 5; PF14 and PF15 */

      143         }

       

      Ideally P_UART1_TX & P_UART1_RX should be used here since the following file already correctly defines which UART1 to use based on the macro   "CONFIG_BF527_UART1_PORTG"

      http://blackfin.uclinux.org/git/?p=u-boot;a=blob;f=arch/blackfin/include/asm/mach-bf527/portmux.h;h=aa165581d8c08f284dcad5cc408ad123b4cefcdc;hb=77cd82ac8e23fd743914fe97c94b535cdfe14ca8

       

      Please confirm if my observation is correct or am I missing some macro.

       

      Best regards,

      Ashish

        • 1. Re: U-Boot
          Aaronwu

          Thanks, your suggestion sounds reasonable, if you have implemented in this way and verified it's able to switch between PORTG  and PORTF for uart1 by this CONFIG_BF527_UART1_PORTG, your patch is welcome.

          • 2. Re: U-Boot
            Ashish

            Hi Aaron,

            I modified the arch/blackfin/cpu/serial.h to allow using UART1 PortG depending upon the MACRO CONFIG_BF527_UART1_PORTG as below, but for some reason when I reset the system and boot over SPI FLASH, I don't see console messages, instead I see some non standard ASCII characters on minicom terminal (the kind you generally see when baud rates are mis-match).

             

            #elif defined(__ADSPBF52x__)

            # define DO_MUX(port, mux, func, tx, rx) \

                bfin_write_PORT##port##_MUX((bfin_read_PORT##port##_MUX() & ~PORT_x_MUX_##mux##_MASK) | PORT_x_MUX_##mux##_FUNC_##func); \

                bfin_write_PORT##port##_FER(bfin_read_PORT##port##_FER() | P##port##tx | P##port##rx);

                switch (CONFIG_UART_CONSOLE) {

                case 0: DO_MUX(G, 2, 3, 7, 8);   break;    /* Port G; mux 2; 3rd function; PG2 and PG8 */

                case 1:

                    #ifndef CONFIG_BF527_UART1_PORTG

                    DO_MUX(F, 5, 3, 14, 15); break;    /* Port F; mux 5; 3rd function; PF14 and PF15 */

                    #else

                    DO_MUX(G, 5, 2, 12, 13); break;    /* Port G; mux 5; 2nd function; PG12 and P13 */

                    #endif

             

            I've attached the modified serial.h and tll6527m.h config file. Any ideas on what could be wrong?

            Regards,

            Ashish

            • 3. Re: U-Boot
              Aaronwu

              Thanks for the update, ADI boards are currently using portF PINs for the UART. I'd suggest you to observe  waveform of portG in your case with a scope, let us check what the problem is, baudreate inaccurate, or signal fail due to fail of mux before moving forward.

              • 4. Re: U-Boot
                Ashish

                Hi,

                Yeah, since the portF pins are muxed with PPI and SPORT (critically needed for accessing display modules and ADCs), we use UART1 PortG for console on TLL6527M.

                 

                I have some important observations to share:

                1. U-Boot compiled with changes as described in my previous message, boots fine when launched (init.elf and u-boot elf file) using gdb over gnICE in BMODE 0. It uses console on UART1 PortG and seems to work perfectly. Then I used the sf functions to write the ldr file of this U-Boot image to SPI FLASH address 0x0

                2. Same image as compiled above does not show any console messages when booted in BMODE 3. The U-Boot ldr file was flashed in step1 above. Also I had disabled early debug messages on serial this time.

                3. Next I again loaded the U-Boot using gdb in BMODE 0 and then used the sf read command to read the u-boot.ldr image (saved to SPI FLASH in step 1) to SDRAM. Then launched it with bootldr command. It ran fine with console messages on UART1 PortG

                 

                Now, it seems that U-Boot is not booting from SPI FLASH or its booting fine but something disrupts the console telemetry.

                Ashish

                • 5. Re: U-Boot
                  Aaronwu

                  You should use different value for CONFIG_BFIN_BOOT_MODE in files like include/configs/bf527-ezkit.h for parallel and SPI flash, they are different.

                  • 6. Re: U-Boot
                    Ashish

                    Hi,

                     

                    I am defining the BOOT_MODE in the new config file thus created for TLL527M i.e. tll6527m.h attached above.

                     

                    #define CONFIG_BFIN_BOOT_MODE       BFIN_BOOT_SPI_MASTER

                     

                    Regards,

                    Ashish

                    • 7. Re: U-Boot
                      Aaronwu

                      Then perhaps you need to hook up a JTAG, set some break points to check what happened.