From patchwork Thu Jun 9 08:01:16 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Asen Dimov X-Patchwork-Id: 99668 X-Patchwork-Delegate: info@emk-elektronik.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id E787AB6FF2 for ; Thu, 9 Jun 2011 18:14:24 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 3117828465; Thu, 9 Jun 2011 10:13:51 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id q2eXAIzcTCy8; Thu, 9 Jun 2011 10:13:50 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 09F2F2840E; Thu, 9 Jun 2011 10:13:25 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id C7CB028428 for ; Thu, 9 Jun 2011 10:13:20 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id GeYgv6Q7epb1 for ; Thu, 9 Jun 2011 10:13:19 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from localhost.localdomain (sofia30-122.pip.digsys.bg [193.68.122.30]) by theia.denx.de (Postfix) with ESMTPS id 7C28A282B4 for ; Thu, 9 Jun 2011 10:13:15 +0200 (CEST) Received: from localhost.localdomain (asenbox [127.0.0.1]) by localhost.localdomain (8.14.4/8.14.4) with ESMTP id p5981JN9029963; Thu, 9 Jun 2011 11:01:19 +0300 Received: (from dimov@localhost) by localhost.localdomain (8.14.4/8.14.4/Submit) id p5981IQ1029962; Thu, 9 Jun 2011 11:01:18 +0300 From: Asen Chavdarov Dimov To: u-boot@lists.denx.de Date: Thu, 9 Jun 2011 11:01:16 +0300 Message-Id: <1307606476-29923-2-git-send-email-dimov@ronetix.at> X-Mailer: git-send-email 1.7.4.4 In-Reply-To: <1307606476-29923-1-git-send-email-dimov@ronetix.at> References: <1307606476-29923-1-git-send-email-dimov@ronetix.at> Cc: Asen Chavdarov Dimov Subject: [U-Boot] [PATCH][AT91 rework 1/1] make pm9263 buildable for v2011.06 release X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.9 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de Signed-off-by: Asen Chavdarov Dimov --- board/ronetix/pm9263/led.c | 9 +++---- board/ronetix/pm9263/pm9263.c | 42 +++++++++++++++++++--------------------- boards.cfg | 2 +- include/configs/pm9263.h | 17 +++++++++------ 4 files changed, 35 insertions(+), 35 deletions(-) diff --git a/board/ronetix/pm9263/led.c b/board/ronetix/pm9263/led.c index 4e585a4..d6eb69f 100644 --- a/board/ronetix/pm9263/led.c +++ b/board/ronetix/pm9263/led.c @@ -24,17 +24,16 @@ */ #include -#include #include -#include -#include +#include +#include void coloured_LED_init(void) { - at91_pmc_t *pmc = (at91_pmc_t *) AT91_PMC_BASE; + struct at91_pmc *pmc = (struct at91_pmc *)ATMEL_BASE_PMC; /* Enable clock */ - writel(1 << AT91SAM9263_ID_PIOB, &pmc->pcer); + writel(1 << ATMEL_ID_PIOB, &pmc->pcer); at91_set_pio_output(CONFIG_RED_LED, 1); at91_set_pio_output(CONFIG_GREEN_LED, 1); diff --git a/board/ronetix/pm9263/pm9263.c b/board/ronetix/pm9263/pm9263.c index ec9f865..9a663c2 100644 --- a/board/ronetix/pm9263/pm9263.c +++ b/board/ronetix/pm9263/pm9263.c @@ -26,16 +26,14 @@ #include #include -#include +#include #include #include #include #include #include -#include #include -#include -#include +#include #include #include #include @@ -55,8 +53,8 @@ DECLARE_GLOBAL_DATA_PTR; static void pm9263_nand_hw_init(void) { unsigned long csa; - at91_smc_t *smc = (at91_smc_t *) AT91_SMC0_BASE; - at91_matrix_t *matrix = (at91_matrix_t *) AT91_MATRIX_BASE; + struct at91_smc *smc = (struct at91_smc *)ATMEL_BASE_SMC0; + struct at91_matrix *matrix = (struct at91_matrix *)ATMEL_BASE_MATRIX; /* Enable CS3 */ csa = readl(&matrix->csa[0]) | AT91_MATRIX_CSA_EBI_CS3A; @@ -95,7 +93,7 @@ static void pm9263_nand_hw_init(void) #ifdef CONFIG_MACB static void pm9263_macb_hw_init(void) { - at91_pmc_t *pmc = (at91_pmc_t *) AT91_PMC_BASE; + struct at91_pmc *pmc = (struct at91_pmc *)ATMEL_BASE_PMC; /* * PB27 enables the 50MHz oscillator for Ethernet PHY @@ -106,7 +104,7 @@ static void pm9263_macb_hw_init(void) at91_set_pio_value(AT91_PIO_PORTB, 27, 1); /* 1- enable, 0 - disable */ /* Enable clock */ - writel(1 << AT91SAM9263_ID_EMAC, &pmc->pcer); + writel(1 << ATMEL_ID_EMAC, &pmc->pcer); /* * Disable pull-up on: @@ -145,7 +143,7 @@ vidinfo_t panel_info = { vl_vsync_len: 1, vl_upper_margin:1, vl_lower_margin:0, - mmio: AT91SAM9263_LCDC_BASE, + mmio: ATMEL_BASE_LCDC, }; void lcd_enable(void) @@ -168,8 +166,8 @@ static int pm9263_lcd_hw_psram_init(void) { volatile uint16_t x; unsigned long csa; - at91_smc_t *smc = (at91_smc_t *) AT91_SMC1_BASE; - at91_matrix_t *matrix = (at91_matrix_t *) AT91_MATRIX_BASE; + struct at91_smc *smc = (struct at91_smc *)ATMEL_BASE_SMC1; + struct at91_matrix *matrix = (struct at91_matrix *)ATMEL_BASE_MATRIX; /* Enable CS3 3.3v, no pull-ups */ csa = readl(&matrix->csa[1]) | AT91_MATRIX_CSA_DBPUC | @@ -249,7 +247,7 @@ static int pm9263_lcd_hw_psram_init(void) static void pm9263_lcd_hw_init(void) { - at91_pmc_t *pmc = (at91_pmc_t *) AT91_PMC_BASE; + struct at91_pmc *pmc = (struct at91_pmc *)ATMEL_BASE_PMC; at91_set_a_periph(AT91_PIO_PORTC, 0, 0); /* LCDVSYNC */ at91_set_a_periph(AT91_PIO_PORTC, 1, 0); /* LCDHSYNC */ @@ -275,7 +273,7 @@ static void pm9263_lcd_hw_init(void) at91_set_a_periph(AT91_PIO_PORTC, 26, 0); /* LCDD22 */ at91_set_a_periph(AT91_PIO_PORTC, 27, 0); /* LCDD23 */ - writel(1 << AT91SAM9263_ID_LCDC, &pmc->pcer); + writel(1 << ATMEL_ID_LCDC, &pmc->pcer); /* Power Control */ at91_set_pio_output(AT91_PIO_PORTA, 22, 1); @@ -285,9 +283,9 @@ static void pm9263_lcd_hw_init(void) /* initialize te PSRAM */ int stat = pm9263_lcd_hw_psram_init(); - gd->fb_base = (stat == 0) ? PHYS_PSRAM : AT91SAM9263_SRAM0_BASE; + gd->fb_base = (stat == 0) ? PHYS_PSRAM : ATMEL_BASE_SRAM0; #else - gd->fb_base = AT91SAM9263_SRAM0_BASE; + gd->fb_base = ATMEL_BASE_SRAM0; #endif } @@ -341,14 +339,14 @@ void lcd_show_board_info(void) int board_init(void) { - at91_pmc_t *pmc = (at91_pmc_t *) AT91_PMC_BASE; + struct at91_pmc *pmc = (struct at91_pmc *)ATMEL_BASE_PMC; /* Enable Ctrlc */ console_init_f(); - writel((1 << AT91SAM9263_ID_PIOA) | - (1 << AT91SAM9263_ID_PIOCDE) | - (1 << AT91SAM9263_ID_PIOB), + writel((1 << ATMEL_ID_PIOA) | + (1 << ATMEL_ID_PIOCDE) | + (1 << ATMEL_ID_PIOB), &pmc->pcer); /* arch number of AT91SAM9263EK-Board */ @@ -357,7 +355,7 @@ int board_init(void) /* adress of boot parameters */ gd->bd->bi_boot_params = PHYS_SDRAM + 0x100; - at91_serial_hw_init(); + at91_seriald_hw_init(); #ifdef CONFIG_CMD_NAND pm9263_nand_hw_init(); #endif @@ -400,7 +398,7 @@ int board_eth_init(bd_t *bis) { int rc = 0; #ifdef CONFIG_MACB - rc = macb_eth_initialize(0, (void *)AT91_EMAC_BASE, 0x01); + rc = macb_eth_initialize(0, (void *)ATMEL_BASE_EMAC, 0x01); #endif return rc; } @@ -417,7 +415,7 @@ int checkboard (void) ss = "(PSRAM)"; break; - case AT91SAM9263_SRAM0_BASE: + case ATMEL_BASE_SRAM0: ss = "(Internal SRAM)"; break; diff --git a/boards.cfg b/boards.cfg index ac20c81..6f0d6bc 100644 --- a/boards.cfg +++ b/boards.cfg @@ -100,7 +100,7 @@ meesc_dataflash arm arm926ejs meesc esd otc570 arm arm926ejs otc570 esd at91 otc570:AT91SAM9263,SYS_USE_NANDFLASH otc570_dataflash arm arm926ejs otc570 esd at91 otc570:AT91SAM9263,SYS_USE_DATAFLASH pm9261 arm arm926ejs - ronetix at91 -pm9263 arm arm926ejs - ronetix at91 +pm9263 arm arm926ejs pm9263 ronetix at91 pm9263:AT91SAM9263 da830evm arm arm926ejs da8xxevm davinci davinci da850evm arm arm926ejs da8xxevm davinci davinci hawkboard arm arm926ejs da8xxevm davinci davinci diff --git a/include/configs/pm9263.h b/include/configs/pm9263.h index 96e12f2..1e282d2 100644 --- a/include/configs/pm9263.h +++ b/include/configs/pm9263.h @@ -28,6 +28,12 @@ #ifndef __CONFIG_H #define __CONFIG_H +/* + * SoC must be defined first, before hardware.h is included. + * In this case SoC is defined in boards.cfg. + */ +#include + /* ARM asynchronous clock */ #define CONFIG_DISPLAY_CPUINFO #define CONFIG_DISPLAY_BOARDINFO @@ -36,16 +42,15 @@ #define MASTER_PLL_MUL 65 #define MAIN_PLL_DIV 2 /* 2 or 4 */ #define CONFIG_SYS_AT91_MAIN_CLOCK 18432000 +#define CONFIG_SYS_AT91_SLOW_CLOCK 32768 /* slow clock xtal */ #define CONFIG_SYS_HZ 1000 -#define CONFIG_ARM926EJS 1 /* This is an ARM926EJS Core */ -#define CONFIG_AT91SAM9263 1 /* It's an Atmel AT91SAM9263 SoC*/ +#define CONFIG_SYS_AT91_CPU_NAME "AT91SAM9263" #define CONFIG_PM9263 1 /* on a Ronetix PM9263 Board */ #define CONFIG_ARCH_CPU_INIT #undef CONFIG_USE_IRQ /* we don't need IRQ/FIQ stuff */ #define CONFIG_SYS_TEXT_BASE 0 -#define CONFIG_AT91FAMILY /* clocks */ #define CONFIG_SYS_MOR_VAL \ @@ -170,10 +175,8 @@ */ #define CONFIG_AT91_GPIO 1 #define CONFIG_ATMEL_USART 1 -#undef CONFIG_USART0 -#undef CONFIG_USART1 -#undef CONFIG_USART2 -#define CONFIG_USART3 1 /* USART 3 is DBGU */ +#define CONFIG_USART_BASE ATMEL_BASE_DBGU +#define CONFIG_USART_ID ATMEL_ID_SYS /* LCD */ #define CONFIG_LCD 1