[SOLVED] Porting U-Boot 2014.04 on custom board based on SabreSD

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

[SOLVED] Porting U-Boot 2014.04 on custom board based on SabreSD

Jump to solution
98,865 Views
mixa
Contributor III

Hi,

 

We are using U-Boot 2009.08 on our custom board currently. The minimum changes that needs to be made (from SabreSD version) so that U-Boot can start is flash_header.S and to set different UART pins (SD3_DAT7 for TX and SD3_DAT6 for RX) in mx6q_sabresd.c.

 

I have done the same changes in U-Boot 2014.04 and I cannot get anything on UART. I`m suspecting that something is not right with DDR parameters. We are using LPDDR2 memory.

 

I`m attaching two files from U-Boot 2009.08 with changes, and files from U-Boot 2014.04 with same changes applied.

 

Have I forgotten something? Is something changed in new U-Boot that I have to modify?

Original Attachment has been moved to: mx6sabresd.c.zip

Original Attachment has been moved to: mx6dl_4x_mt41j128.cfg.zip

Original Attachment has been moved to: mx6q_sabresd.c.zip

Original Attachment has been moved to: flash_header.S.zip

Labels (2)
1 Solution
2,870 Views
mixa
Contributor III

Hi Igor,

Thanks for the suggestion. I have checked all registers on old U-Boot and new and all registers were the same except CCM_CCGR5. On old it had value 0x0F0000C3 (bit 25-24 were 11 - uart_clk_enable)  and on new 0xF0033F3F so bits 25-24 were 0 and that disabled UART clock. I have set it to 0x0F0000C3 and got UART working.

The thing is that old U-Boot had lowlevel_init.S which set the default gate registers for clock. In newer U-Boot that was moved to mx6dl_4x_mt41j128.cfg, but we removed everything to get exact DCD items for our board so this was not set :smileysad:

These are added back to mx6dl_4x_mt41j128.cfg:

/* set the default clock gate to save power */

DATA 4, 0x020c4068, 0x00C03F3F

DATA 4, 0x020c406c, 0x0030FC03

DATA 4, 0x020c4070, 0x0FFFC000

DATA 4, 0x020c4074, 0x3FF00000

DATA 4, 0x020c4078, 0x00FFF300

DATA 4, 0x020c407c, 0x0F0000C3

DATA 4, 0x020c4080, 0x000003FF

Thanks again,

Mihailo

View solution in original post

13 Replies
2,872 Views
igorpadykov
NXP Employee
NXP Employee

Hi Mihailo

one can check how image is flashed, on U-Boot 2014 use:

dd if=u-boot.imx of=/dev/sdX bs=512 seek=2

U-Boot Migration Example

Best regards

igor

-----------------------------------------------------------------------------------------------------------------------

Note: If this post answers your question, please click the Correct Answer button. Thank you!

-----------------------------------------------------------------------------------------------------------------------

0 Kudos
Reply
2,873 Views
mixa
Contributor III

I`m using imx_usb_loader to push U-Boot to the device. Trying a lot of builds so it would be longer to flash every time. I`m able to run old and new U-Boot on SabreSD, and old U-Boot on our custom device, but I`m not able to get anything from new U-Boot on our custom device. I have also tried bin files with padding and without for old one and both works (it seems imx_usb_loader can detect and jump to right address), so I do not think that is the problem.

0 Kudos
Reply
2,872 Views
igorpadykov
NXP Employee
NXP Employee

Hi Mihailo

imx_usb_loader utility was developed

by boundary devices, suggest to post issues

with it to boundary devices support (http://boundarydevices.com/support/ )

or meta-fsl-arm mailing list, so that someone familiar with

it could try to assist you

https://lists.yoctoproject.org/listinfo/meta-freescale

Best regards

igor

0 Kudos
Reply
2,872 Views
mixa
Contributor III

I suspect more that there is a problem in DCD configuration. As I do not get anything on UART that happens when I try with bad DCD configuration, for example I use DCD for SabreSD board with DDR3.

0 Kudos
Reply
2,872 Views
igorpadykov
NXP Employee
NXP Employee

for custom board one needs to find own dcd

(not use DCD for SabreSD board) using ddr test

i.MX6/7 DDR Stress Test Tool V2.20

~igor

0 Kudos
Reply
2,872 Views
mixa
Contributor III

I am using our own DCD, I`m just saying when I try new U-Boot it behaves same as it has wrong DCD - nothing happens on UART. I have translated all our DCD from old U-Boot style (flash-header.S) to new style (mx6dl_4x_mt41j128.cfg). I have also attached the files in first post.

0 Kudos
Reply
2,872 Views
mixa
Contributor III

I have some progress on this, it seems that DCD data are correct. I have added to turn on LED on our custom device in board_early_init_f, board_init and board_late_init and it turns on in all three functions. When I revert to original DCD data from SabreSD then it does not work.

So now I think problem is in UART setup. I have configured UART pins like this:

iomux_v3_cfg_t const uart1_pads[] = {

    MX6_PAD_SD3_DAT7__UART1_TX_DATA | MUX_PAD_CTRL(UART_PAD_CTRL),

    MX6_PAD_SD3_DAT6__UART1_RX_DATA | MUX_PAD_CTRL(UART_PAD_CTRL),

};

And I have removes DAT7 and DAT 6 from usdhc3_pads setup:

iomux_v3_cfg_t const usdhc3_pads[] = {

    MX6_PAD_SD3_CLK__SD3_CLK   | MUX_PAD_CTRL(USDHC_PAD_CTRL),

    MX6_PAD_SD3_CMD__SD3_CMD   | MUX_PAD_CTRL(USDHC_PAD_CTRL),

    MX6_PAD_SD3_DAT0__SD3_DATA0 | MUX_PAD_CTRL(USDHC_PAD_CTRL),

    MX6_PAD_SD3_DAT1__SD3_DATA1 | MUX_PAD_CTRL(USDHC_PAD_CTRL),

    MX6_PAD_SD3_DAT2__SD3_DATA2 | MUX_PAD_CTRL(USDHC_PAD_CTRL),

    MX6_PAD_SD3_DAT3__SD3_DATA3 | MUX_PAD_CTRL(USDHC_PAD_CTRL),

    MX6_PAD_SD3_DAT4__SD3_DATA4 | MUX_PAD_CTRL(USDHC_PAD_CTRL),

    MX6_PAD_SD3_DAT5__SD3_DATA5 | MUX_PAD_CTRL(USDHC_PAD_CTRL),

    MX6_PAD_NANDF_D0__GPIO2_IO00    | MUX_PAD_CTRL(NO_PAD_CTRL), /* CD */

};

Also I have noticed this in the new boot:

#define UART_PAD_CTRL  (PAD_CTL_PUS_100K_UP |   \
    PAD_CTL_SPEED_MED | PAD_CTL_DSE_40ohm |   \

    PAD_CTL_SRE_FAST  | PAD_CTL_HYS)

Tried to remove some flags, but still nothing on UART.

0 Kudos
Reply
2,872 Views
igorpadykov
NXP Employee
NXP Employee

I think you can add to LED code some piece of code

sending data to uart  UARTx_UTXD, if nothing

appear on uart, then connect jtag and check UART registers.

~igor

0 Kudos
Reply
2,872 Views
petarbajic
Contributor III

We sent characters to UARTx_UTXD like serial driver is doing (serial_mxc.c), on old u-boot 2009 is working, but on new u-boot 2014 still nothing on console.

Then we printed values of uart control registers ucr1, ucr2, uc3 and ucr4 on old u-boot, we got:

__REG(UART_PHYS + UCR1): 0x00000001

__REG(UART_PHYS + UCR2): 0x00004027

__REG(UART_PHYS + UCR3): 0x00000704

__REG(UART_PHYS + UCR4): 0x00008000

And we compared these values to registers on new u-boot and they are the same! (we light the led if value is equal).

So we confirmed we are writing to UTXD and registers are set ok, but still nothing on console.

Any more ideas?

0 Kudos
Reply
2,872 Views
igorpadykov
NXP Employee
NXP Employee

one can check UART_CLK_ROOT, CCM CSCDR1[UART_CLK_PODF]

CCM_CCGR5, measure UART_CLK_ROOT using CCM_CCOSR

~igor

0 Kudos
Reply
2,871 Views
mixa
Contributor III

Hi Igor,

Thanks for the suggestion. I have checked all registers on old U-Boot and new and all registers were the same except CCM_CCGR5. On old it had value 0x0F0000C3 (bit 25-24 were 11 - uart_clk_enable)  and on new 0xF0033F3F so bits 25-24 were 0 and that disabled UART clock. I have set it to 0x0F0000C3 and got UART working.

The thing is that old U-Boot had lowlevel_init.S which set the default gate registers for clock. In newer U-Boot that was moved to mx6dl_4x_mt41j128.cfg, but we removed everything to get exact DCD items for our board so this was not set :smileysad:

These are added back to mx6dl_4x_mt41j128.cfg:

/* set the default clock gate to save power */

DATA 4, 0x020c4068, 0x00C03F3F

DATA 4, 0x020c406c, 0x0030FC03

DATA 4, 0x020c4070, 0x0FFFC000

DATA 4, 0x020c4074, 0x3FF00000

DATA 4, 0x020c4078, 0x00FFF300

DATA 4, 0x020c407c, 0x0F0000C3

DATA 4, 0x020c4080, 0x000003FF

Thanks again,

Mihailo

2,872 Views
petarbajic
Contributor III

How do we send data (character) directly to UARTx_UTXD?

Since we dont have jtag, can we read value of UARTx_UCR1 register in code?

Without JTAG and uart, we can at least light diode if content of that register is equal to some expected value.

0 Kudos
Reply
2,872 Views
mixa
Contributor III

I have also put LED code next to this line that should print on UART:

int checkboard(void)

{

    puts("Board: MX6-SabreSD\n");

    gpio_direction_output(LED2,0);

    return 0;

}

This one gets printed on original U-Boot on SabreSD board, but it won`t print on our device. I have also tried to set the led pin for UART_TXD and I didn`t see any activity on led.

Unfortunately we do not have JTAG on this device.

0 Kudos
Reply