|
11 | 11 | #include <asm/cache.h> |
12 | 12 | #include <asm/mmu.h> |
13 | 13 | #include <mach/imx/imx6.h> |
| 14 | +#include <mach/imx/iomux-mx6.h> |
| 15 | +#include <mach/imx/esdctl.h> |
14 | 16 |
|
15 | 17 | extern char __dtb_imx6s_riotboard_start[]; |
16 | 18 |
|
17 | | -ENTRY_FUNCTION(start_imx6s_riotboard, r0, r1, r2) |
| 19 | +static noinline void continue_imx6s_riotboard(void) |
18 | 20 | { |
19 | | - void *fdt; |
| 21 | + void __iomem *iomuxbase = IOMEM(MX6_IOMUXC_BASE_ADDR); |
20 | 22 |
|
21 | | - imx6_cpu_lowlevel_init(); |
| 23 | + writel(0x4, iomuxbase + 0x016c); |
| 24 | + |
| 25 | + imx6_ungate_all_peripherals(); |
| 26 | + // if uart ist not set-up, then OP-TEE will fail if debugging is enabled. |
| 27 | + imx6_uart_setup(IOMEM(MX6_UART2_BASE_ADDR)); |
22 | 28 |
|
23 | 29 | if (IS_ENABLED(CONFIG_DEBUG_LL)) { |
24 | | - /* |
25 | | - * CONFIG_DEBUG_IMX6Q_UART=y |
26 | | - * CONFIG_DEBUG_IMX_UART_PORT=2 |
27 | | - */ |
28 | | - writel(0x4, 0x020e016c); |
29 | | - imx6_ungate_all_peripherals(); |
30 | | - imx6_uart_setup_ll(); |
31 | | - putc_ll('a'); |
| 30 | + pbl_set_putc(imx_uart_putc, IOMEM(MX6_UART2_BASE_ADDR)); |
| 31 | + putc_ll('>'); |
32 | 32 | } |
33 | 33 |
|
34 | | - fdt = __dtb_imx6s_riotboard_start + get_runtime_offset(); |
35 | | - barebox_arm_entry(0x10000000, SZ_1G, fdt); |
| 34 | + imx6q_barebox_entry(__dtb_imx6s_riotboard_start); |
| 35 | +} |
| 36 | + |
| 37 | +ENTRY_FUNCTION(start_imx6s_riotboard, r0, r1, r2) |
| 38 | +{ |
| 39 | + imx6_cpu_lowlevel_init(); |
| 40 | + |
| 41 | + relocate_to_current_adr(); |
| 42 | + setup_c(); |
| 43 | + |
| 44 | + continue_imx6s_riotboard(); |
36 | 45 | } |
0 commit comments