|
14 | 14 | #include <gtimer.h> |
15 | 15 | #include <mm_aspace.h> |
16 | 16 | #include <mm_page.h> |
| 17 | + |
| 18 | +#include <rtconfig.h> |
17 | 19 | #include <rtdevice.h> |
18 | 20 |
|
19 | 21 | #include <mmu.h> |
20 | 22 |
|
21 | | -#define BOARD_DRAM_SIZE (256 * 1024 * 1024) |
| 23 | +#include <limits.h> |
| 24 | + |
22 | 25 |
|
23 | 26 | struct mem_desc platform_mem_desc[] = { |
24 | | - {0x00200000, 0x00200000 + BOARD_DRAM_SIZE - 1, 0x80000000, NORMAL_MEM}, // 256MB DRAM |
25 | | - {0xD0000000, 0xFFFFFFFF, 0x38000000, DEVICE_MEM}, |
| 27 | + {0x80100000, 0x8FFFFFFF, 0x80000000, NORMAL_MEM}, |
| 28 | + {0xD4000000, 0xDFFFFFFF, 0x44380000, DEVICE_MEM}, |
26 | 29 | }; |
27 | 30 |
|
28 | 31 | const rt_uint32_t platform_mem_desc_size = sizeof(platform_mem_desc)/sizeof(platform_mem_desc[0]); |
@@ -81,38 +84,46 @@ void rt_hw_board_init(void) |
81 | 84 | { |
82 | 85 | // enable_neon_fpu(); |
83 | 86 | // disable_strict_align_check(); |
| 87 | + rt_hw_earlycon_ioremap(); |
| 88 | + |
| 89 | + rt_hw_earlycon_puts("rt_hw_board_init!\n"); |
| 90 | + rt_hw_mmu_map_init(&rt_kernel_space, (void*)0x080000000000, 0x10000000, MMUTable, 0); |
| 91 | + rt_hw_earlycon_puts("[rt_hw_board_init] rt_hw_mmu_map_init done!\n"); |
84 | 92 |
|
85 | | - imx_uart1_puts("rt_hw_board_init!\n"); |
86 | | - // rt_hw_mmu_map_init(&rt_kernel_space, (void*)0x080000000000, 0x10000000, MMUTable, 0); |
| 93 | + rt_hw_earlycon_print_hex("[rt_hw_board_init] rt_kernel_space.start: ", (rt_base_t) rt_kernel_space.start); |
| 94 | + rt_hw_earlycon_print_hex("[rt_hw_board_init] rt_kernel_space.size: ", (rt_base_t) rt_kernel_space.size); |
87 | 95 |
|
88 | | - // imx_uart1_puts("rt_page_init!\n"); |
89 | | - // imx_uart1_print_hex("PAGE_START: ", (rt_base_t) PAGE_START); |
90 | | - // imx_uart1_print_hex("PAGE_END: ", (rt_base_t) PAGE_END); |
91 | | - // rt_page_init(init_page_region); |
| 96 | + rt_hw_earlycon_print_hex("[rt_hw_board_init] PAGE_START: ", (rt_base_t) PAGE_START); |
| 97 | + rt_hw_earlycon_print_hex("[rt_hw_board_init] PAGE_END: ", (rt_base_t) PAGE_END); |
| 98 | + rt_page_init(init_page_region); |
92 | 99 |
|
93 | | - // imx_uart1_puts("rt_hw_mmu_setup!\n"); |
94 | | - // rt_hw_mmu_setup(&rt_kernel_space, platform_mem_desc, platform_mem_desc_size); |
| 100 | + rt_hw_earlycon_puts("[rt_hw_board_init] rt_hw_mmu_setup!\n"); |
| 101 | + rt_hw_mmu_setup(&rt_kernel_space, platform_mem_desc, platform_mem_desc_size); |
95 | 102 |
|
96 | 103 | #ifdef RT_USING_HEAP |
97 | 104 | /* initialize system heap */ |
| 105 | + rt_hw_earlycon_puts("[rt_hw_board_init] rt_system_heap_init!\n"); |
98 | 106 | rt_system_heap_init((void *)HEAP_BEGIN, (void *)HEAP_END); |
99 | 107 | #endif |
100 | 108 |
|
101 | 109 | /* initialize hardware interrupt */ |
| 110 | + rt_hw_earlycon_puts("[rt_hw_board_init] rt_hw_interrupt_init!\n"); |
102 | 111 | rt_hw_interrupt_init(); |
103 | 112 |
|
| 113 | + /* initialize uart */ |
| 114 | + rt_hw_earlycon_puts("[rt_hw_board_init] rt_hw_uart_init!\n"); |
104 | 115 | rt_hw_uart_init(); |
105 | | - rt_hw_console_output("rt_hw_uart_init done!\n"); |
| 116 | + rt_hw_console_output("[rt_hw_board_init] rt_hw_uart_init done!\n"); |
106 | 117 |
|
107 | 118 | /* initialize timer for os tick */ |
108 | 119 | rt_hw_gtimer_init(); |
109 | 120 |
|
110 | 121 | rt_components_board_init(); |
111 | 122 | rt_console_set_device(RT_CONSOLE_DEVICE_NAME); |
112 | 123 |
|
113 | | - rt_hw_console_output("rt_hw_board_init done!\n"); |
114 | | - rt_kprintf("rt_kprintf works!\n"); |
115 | | - rt_hw_console_output("rt_hw_board_init done!!\n"); |
| 124 | + rt_hw_console_output("[rt_hw_board_init] rt_hw_board_init done!\n"); |
| 125 | + rt_kprintf("[rt_hw_board_init] rt_kprintf works!\n"); |
| 126 | + rt_hw_console_output("[rt_hw_board_init] rt_hw_board_init done!!\n"); |
116 | 127 | } |
117 | 128 |
|
118 | 129 | /*@}*/ |
0 commit comments