Merge tag 'ti-v2020.07-rc3' of https://gitlab.denx.de/u-boot/custodians/u-boot-ti
[oweals/u-boot.git] / board / pandora / pandora.c
index 3a62e9d6330b7b326cfd570a95e9f7f9d238116e..a93848666fea3380a5b76cb36c8c9fe463bf0aa5 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * (C) Copyright 2008
  * Grazvydas Ignotas <notasas@gmail.com>
  *
  * (C) Copyright 2004-2008
  * Texas Instruments, <www.ti.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
  */
 #include <common.h>
+#include <dm.h>
+#include <init.h>
+#include <ns16550.h>
 #include <twl4030.h>
 #include <asm/io.h>
 #include <asm/gpio.h>
@@ -38,6 +24,7 @@
 #include <asm/arch/gpio.h>
 #include <asm/arch/sys_proto.h>
 #include <asm/mach-types.h>
+#include <linux/delay.h>
 #include "pandora.h"
 
 DECLARE_GLOBAL_DATA_PTR;
@@ -50,6 +37,18 @@ DECLARE_GLOBAL_DATA_PTR;
 #define GPIO_IO_PWRDNZ                 (1 << 6)
 #define PBIASLITEVMODE1                        (1 << 8)
 
+static const struct ns16550_platdata pandora_serial = {
+       .base = OMAP34XX_UART3,
+       .reg_shift = 2,
+       .clock = V_NS16550_CLK,
+       .fcr = UART_FCR_DEFVAL,
+};
+
+U_BOOT_DEVICE(pandora_uart) = {
+       "ns16550_serial",
+       &pandora_serial
+};
+
 /*
  * Routine: board_init
  * Description: Early hardware init.
@@ -114,10 +113,11 @@ int misc_init_r(void)
 
        /* Enable battery backup capacitor (3.2V, 0.5mA charge current) */
        twl4030_i2c_write_u8(TWL4030_CHIP_PM_RECEIVER,
+               TWL4030_PM_RECEIVER_BB_CFG,
                TWL4030_BB_CFG_BBCHEN | TWL4030_BB_CFG_BBSEL_3200MV |
-               TWL4030_BB_CFG_BBISEL_500UA, TWL4030_PM_RECEIVER_BB_CFG);
+               TWL4030_BB_CFG_BBISEL_500UA);
 
-       dieid_num_r();
+       omap_die_id_display();
 
        return 0;
 }
@@ -136,10 +136,14 @@ void set_muxconf_regs(void)
        }
 }
 
-#ifdef CONFIG_GENERIC_MMC
+#ifdef CONFIG_MMC
 int board_mmc_init(bd_t *bis)
 {
-       omap_mmc_init(0, 0, 0);
-       return 0;
+       return omap_mmc_init(0, 0, 0, -1, -1);
+}
+
+void board_mmc_power_init(void)
+{
+       twl4030_power_mmc_init(0);
 }
 #endif