]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - board/ronetix/pm9261/pm9261.c
Merge branch 'master' of git://git.denx.de/u-boot-mips
[karo-tx-uboot.git] / board / ronetix / pm9261 / pm9261.c
index 871b94ada756431b0d106198ed07f0fef10ebfc0..ec3ac895938f8fa9ef80568520acf99d34e59712 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-Christopher 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>
@@ -89,10 +74,10 @@ static void pm9261_nand_hw_init(void)
                &pmc->pcer);
 
        /* 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);
 
        at91_set_a_periph(AT91_PIO_PORTC, 0, 0);        /* NANDOE */
        at91_set_a_periph(AT91_PIO_PORTC, 1, 0);        /* NANDWE */
@@ -237,24 +222,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();
-
+       /* Enable clocks for some PIOs */
        writel(1 << ATMEL_ID_PIOA |
                1 << ATMEL_ID_PIOC,
                &pmc->pcer);
 
+       at91_seriald_hw_init();
+
+       return 0;
+}
+
+int board_init(void)
+{
        /* arch number of PM9261-Board */
        gd->bd->bi_arch_number = MACH_TYPE_PM9261;
 
        /* adress of boot parameters */
        gd->bd->bi_boot_params = PHYS_SDRAM + 0x100;
 
-       at91_seriald_hw_init();
 #ifdef CONFIG_CMD_NAND
        pm9261_nand_hw_init();
 #endif