]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - board/ronetix/pm9263/pm9263.c
Merge branch 'u-boot-sh/rmobile' into 'u-boot-arm/master'
[karo-tx-uboot.git] / board / ronetix / pm9263 / pm9263.c
index 335efba8edc05ec645a68ddfa5e5054a2f4150ce..1b00f08835cce0f8929d20847fe0b85b02776722 100644 (file)
@@ -1,32 +1,17 @@
 /*
  * (C) Copyright 2007-2008
- * Stelian Pop <stelian.pop@leadtechdesign.com>
+ * Stelian Pop <stelian@popies.net>
  * Lead Tech Design <www.leadtechdesign.com>
  * Copyright (C) 2008 Ronetix Ilko Iliev (www.ronetix.at)
  * Copyright (C) 2009 Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
  *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
+ * SPDX-License-Identifier:    GPL-2.0+
  */
 
 #include <common.h>
-#include <asm/sizes.h>
+#include <linux/sizes.h>
 #include <asm/io.h>
+#include <asm/gpio.h>
 #include <asm/arch/at91sam9_smc.h>
 #include <asm/arch/at91_common.h>
 #include <asm/arch/at91_pmc.h>
@@ -83,10 +68,10 @@ static void pm9263_nand_hw_init(void)
                &smc->cs[3].mode);
 
        /* Configure RDY/BSY */
-       at91_set_pio_input(CONFIG_SYS_NAND_READY_PIN, 1);
+       gpio_direction_input(CONFIG_SYS_NAND_READY_PIN);
 
        /* Enable NandFlash */
-       at91_set_pio_output(CONFIG_SYS_NAND_ENABLE_PIN, 1);
+       gpio_direction_output(CONFIG_SYS_NAND_ENABLE_PIN, 1);
 }
 #endif
 
@@ -130,20 +115,20 @@ static void pm9263_macb_hw_init(void)
 
 #ifdef CONFIG_LCD
 vidinfo_t panel_info = {
-       vl_col:         240,
-       vl_row:         320,
-       vl_clk:         4965000,
-       vl_sync:        ATMEL_LCDC_INVLINE_INVERTED |
-                       ATMEL_LCDC_INVFRAME_INVERTED,
-       vl_bpix:        3,
-       vl_tft:         1,
-       vl_hsync_len:   5,
-       vl_left_margin: 1,
-       vl_right_margin:33,
-       vl_vsync_len:   1,
-       vl_upper_margin:1,
-       vl_lower_margin:0,
-       mmio:           ATMEL_BASE_LCDC,
+       .vl_col =               240,
+       .vl_row =               320,
+       .vl_clk =               4965000,
+       .vl_sync =              ATMEL_LCDC_INVLINE_INVERTED |
+                                       ATMEL_LCDC_INVFRAME_INVERTED,
+       .vl_bpix =              3,
+       .vl_tft =               1,
+       .vl_hsync_len =         5,
+       .vl_left_margin =       1,
+       .vl_right_margin =      33,
+       .vl_vsync_len =         1,
+       .vl_upper_margin =      1,
+       .vl_lower_margin =      0,
+       .mmio =                 ATMEL_BASE_LCDC,
 };
 
 void lcd_enable(void)
@@ -336,22 +321,28 @@ void lcd_show_board_info(void)
 
 #endif /* CONFIG_LCD */
 
-int board_init(void)
+int board_early_init_f(void)
 {
        struct at91_pmc *pmc = (struct at91_pmc *)ATMEL_BASE_PMC;
 
-       /* Enable Ctrlc */
-       console_init_f();
-
-       writel((1 << ATMEL_ID_PIOA) |
-               (1 << ATMEL_ID_PIOCDE) |
-               (1 << ATMEL_ID_PIOB),
+       /* Enable clocks for all PIOs */
+       writel((1 << ATMEL_ID_PIOA) | (1 << ATMEL_ID_PIOB) |
+               (1 << ATMEL_ID_PIOCDE),
                &pmc->pcer);
 
+       at91_seriald_hw_init();
+
+       return 0;
+}
+
+int board_init(void)
+{
+       /* arch number of AT91SAM9263EK-Board */
+       gd->bd->bi_arch_number = MACH_TYPE_PM9263;
+
        /* adress of boot parameters */
        gd->bd->bi_boot_params = PHYS_SDRAM + 0x100;
 
-       at91_seriald_hw_init();
 #ifdef CONFIG_CMD_NAND
        pm9263_nand_hw_init();
 #endif