Commit f47316a8ba3e83e136be33a7610cbdd0a8ca7990

Authored by Asen Dimov
Committed by Albert ARIBAUD
1 parent 65b0f87a80

pm9261: compiles with the AT91 reworked scheme

Signed-off-by: Asen Chavdarov Dimov <dimov@ronetix.at>

Showing 4 changed files with 33 additions and 34 deletions Side-by-side Diff

board/ronetix/pm9261/led.c
... ... @@ -24,17 +24,16 @@
24 24 */
25 25  
26 26 #include <common.h>
27   -#include <asm/arch/at91sam9261.h>
28 27 #include <asm/arch/at91_pmc.h>
29   -#include <asm/arch/at91_pio.h>
30   -#include <asm/arch/io.h>
  28 +#include <asm/arch/gpio.h>
  29 +#include <asm/io.h>
31 30  
32 31 void coloured_LED_init(void)
33 32 {
34   - at91_pmc_t *pmc = (at91_pmc_t *) AT91_PMC_BASE;
  33 + struct at91_pmc *pmc = (struct at91_pmc *)ATMEL_BASE_PMC;
35 34  
36 35 /* Enable clock */
37   - writel(1 << AT91SAM9261_ID_PIOC, &pmc->pcer);
  36 + writel(1 << ATMEL_ID_PIOC, &pmc->pcer);
38 37  
39 38 at91_set_pio_output(CONFIG_RED_LED, 1);
40 39 at91_set_pio_output(CONFIG_GREEN_LED, 1);
board/ronetix/pm9261/pm9261.c
... ... @@ -26,17 +26,15 @@
26 26  
27 27 #include <common.h>
28 28 #include <asm/sizes.h>
29   -#include <asm/arch/at91sam9261.h>
  29 +#include <asm/io.h>
30 30 #include <asm/arch/at91sam9_smc.h>
31 31 #include <asm/arch/at91_common.h>
32 32 #include <asm/arch/at91_pmc.h>
33 33 #include <asm/arch/at91_rstc.h>
34 34 #include <asm/arch/at91_matrix.h>
35   -#include <asm/arch/at91_pio.h>
36 35 #include <asm/arch/clk.h>
37   -#include <asm/arch/at91_pio.h>
38   -#include <asm/arch/io.h>
39   -#include <asm/arch/hardware.h>
  36 +#include <asm/arch/gpio.h>
  37 +
40 38 #include <lcd.h>
41 39 #include <atmel_lcdc.h>
42 40 #include <dataflash.h>
... ... @@ -56,9 +54,9 @@
56 54 static void pm9261_nand_hw_init(void)
57 55 {
58 56 unsigned long csa;
59   - at91_smc_t *smc = (at91_smc_t *) AT91_SMC_BASE;
60   - at91_matrix_t *matrix = (at91_matrix_t *) AT91_MATRIX_BASE;
61   - at91_pmc_t *pmc = (at91_pmc_t *) AT91_PMC_BASE;
  57 + struct at91_smc *smc = (struct at91_smc *)ATMEL_BASE_SMC;
  58 + struct at91_matrix *matrix = (struct at91_matrix *)ATMEL_BASE_MATRIX;
  59 + struct at91_pmc *pmc = (struct at91_pmc *)ATMEL_BASE_PMC;
62 60  
63 61 /* Enable CS3 */
64 62 csa = readl(&matrix->csa) | AT91_MATRIX_CSA_EBI_CS3A;
... ... @@ -86,8 +84,8 @@
86 84 AT91_SMC_MODE_TDF_CYCLE(2),
87 85 &smc->cs[3].mode);
88 86  
89   - writel(1 << AT91SAM9261_ID_PIOA |
90   - 1 << AT91SAM9261_ID_PIOC,
  87 + writel(1 << ATMEL_ID_PIOA |
  88 + 1 << ATMEL_ID_PIOC,
91 89 &pmc->pcer);
92 90  
93 91 /* Configure RDY/BSY */
... ... @@ -105,8 +103,8 @@
105 103 #ifdef CONFIG_DRIVER_DM9000
106 104 static void pm9261_dm9000_hw_init(void)
107 105 {
108   - at91_smc_t *smc = (at91_smc_t *) AT91_SMC_BASE;
109   - at91_pmc_t *pmc = (at91_pmc_t *) AT91_PMC_BASE;
  106 + struct at91_smc *smc = (struct at91_smc *)ATMEL_BASE_SMC;
  107 + struct at91_pmc *pmc = (struct at91_pmc *)ATMEL_BASE_PMC;
110 108  
111 109 /* Configure SMC CS2 for DM9000 */
112 110 writel(AT91_SMC_SETUP_NWE(2) | AT91_SMC_SETUP_NCS_WR(0) |
... ... @@ -127,7 +125,7 @@
127 125 &smc->cs[2].mode);
128 126  
129 127 /* Configure Interrupt pin as input, no pull-up */
130   - writel(1 << AT91SAM9261_ID_PIOA, &pmc->pcer);
  128 + writel(1 << ATMEL_ID_PIOA, &pmc->pcer);
131 129 at91_set_pio_input(AT91_PIO_PORTA, 24, 0);
132 130 }
133 131 #endif
... ... @@ -147,7 +145,7 @@
147 145 vl_vsync_len: 1,
148 146 vl_upper_margin:1,
149 147 vl_lower_margin:0,
150   - mmio: AT91SAM9261_LCDC_BASE,
  148 + mmio: ATMEL_BASE_LCDC,
151 149 };
152 150  
153 151 void lcd_enable(void)
... ... @@ -162,7 +160,7 @@
162 160  
163 161 static void pm9261_lcd_hw_init(void)
164 162 {
165   - at91_pmc_t *pmc = (at91_pmc_t *) AT91_PMC_BASE;
  163 + struct at91_pmc *pmc = (struct at91_pmc *)ATMEL_BASE_PMC;
166 164  
167 165 at91_set_a_periph(AT91_PIO_PORTB, 1, 0); /* LCDHSYNC */
168 166 at91_set_a_periph(AT91_PIO_PORTB, 2, 0); /* LCDDOTCK */
... ... @@ -189,7 +187,7 @@
189 187  
190 188 writel(1 << 17, &pmc->scer); /* LCD controller Clock, AT91SAM9261 only */
191 189  
192   - gd->fb_base = AT91SAM9261_SRAM_BASE;
  190 + gd->fb_base = ATMEL_BASE_SRAM;
193 191 }
194 192  
195 193 #ifdef CONFIG_LCD_INFO
196 194  
... ... @@ -241,13 +239,13 @@
241 239  
242 240 int board_init(void)
243 241 {
244   - at91_pmc_t *pmc = (at91_pmc_t *) AT91_PMC_BASE;
  242 + struct at91_pmc *pmc = (struct at91_pmc *)ATMEL_BASE_PMC;
245 243  
246 244 /* Enable Ctrlc */
247 245 console_init_f();
248 246  
249   - writel(1 << AT91SAM9261_ID_PIOA |
250   - 1 << AT91SAM9261_ID_PIOC,
  247 + writel(1 << ATMEL_ID_PIOA |
  248 + 1 << ATMEL_ID_PIOC,
251 249 &pmc->pcer);
252 250  
253 251 /* arch number of PM9261-Board */
... ... @@ -256,7 +254,7 @@
256 254 /* adress of boot parameters */
257 255 gd->bd->bi_boot_params = PHYS_SDRAM + 0x100;
258 256  
259   - at91_serial_hw_init();
  257 + at91_seriald_hw_init();
260 258 #ifdef CONFIG_CMD_NAND
261 259 pm9261_nand_hw_init();
262 260 #endif
... ... @@ -122,7 +122,7 @@
122 122 meesc_dataflash arm arm926ejs meesc esd at91 meesc:AT91SAM9263,SYS_USE_DATAFLASH
123 123 otc570 arm arm926ejs otc570 esd at91 otc570:AT91SAM9263,SYS_USE_NANDFLASH
124 124 otc570_dataflash arm arm926ejs otc570 esd at91 otc570:AT91SAM9263,SYS_USE_DATAFLASH
125   -pm9261 arm arm926ejs - ronetix at91
  125 +pm9261 arm arm926ejs pm9261 ronetix at91 pm9261:AT91SAM9261
126 126 pm9263 arm arm926ejs - ronetix at91
127 127 da830evm arm arm926ejs da8xxevm davinci davinci
128 128 da850evm arm arm926ejs da8xxevm davinci davinci
include/configs/pm9261.h
... ... @@ -28,25 +28,29 @@
28 28 #ifndef __CONFIG_H
29 29 #define __CONFIG_H
30 30  
  31 +/*
  32 + * SoC must be defined first, before hardware.h is included.
  33 + * In this case SoC is defined in boards.cfg.
  34 + */
  35 +
  36 +#include <asm/hardware.h>
31 37 /* ARM asynchronous clock */
32   -#define CONFIG_SYS_AT91_CPU_NAME "AT91SAM9261"
33 38  
34 39 #define CONFIG_DISPLAY_BOARDINFO
35 40  
36 41 #define MASTER_PLL_DIV 15
37 42 #define MASTER_PLL_MUL 162
38 43 #define MAIN_PLL_DIV 2
  44 +#define CONFIG_SYS_AT91_SLOW_CLOCK 32768 /* slow clock xtal */
39 45 #define CONFIG_SYS_AT91_MAIN_CLOCK 18432000
40 46  
41 47 #define CONFIG_SYS_HZ 1000
42 48  
43   -#define CONFIG_ARM926EJS 1 /* This is an ARM926EJS Core */
44   -#define CONFIG_AT91SAM9261 1 /* It's an Atmel AT91SAM9261 SoC*/
  49 +#define CONFIG_SYS_AT91_CPU_NAME "AT91SAM9261"
45 50 #define CONFIG_PM9261 1 /* on a Ronetix PM9261 Board */
46 51 #define CONFIG_ARCH_CPU_INIT
47 52 #undef CONFIG_USE_IRQ /* we don't need IRQ/FIQ stuff */
48 53 #define CONFIG_SYS_TEXT_BASE 0
49   -#define CONFIG_AT91FAMILY
50 54  
51 55 /* clocks */
52 56 /* CKGR_MOR - enable main osc. */
... ... @@ -160,10 +164,8 @@
160 164 */
161 165 #define CONFIG_AT91_GPIO 1
162 166 #define CONFIG_ATMEL_USART 1
163   -#undef CONFIG_USART0
164   -#undef CONFIG_USART1
165   -#undef CONFIG_USART2
166   -#define CONFIG_USART3 1 /* USART 3 is DBGU */
  167 +#define CONFIG_USART_BASE ATMEL_BASE_DBGU
  168 +#define CONFIG_USART_ID ATMEL_ID_SYS
167 169  
168 170 /* LCD */
169 171 #define CONFIG_LCD 1