aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Shields <simon@lineageos.org>2018-06-22 01:17:48 +1000
committerDenis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>2020-03-28 01:15:04 +0100
commite3463b43fb7b82e0f96f36a36cffb713b6312a3e (patch)
tree8b37905660503fe98a79bbc4045e3aaf32bf14f9
parenta08591845243ebe09e789787db912be6629d08a1 (diff)
downloadu-boot-midas-e3463b43fb7b82e0f96f36a36cffb713b6312a3e.tar.gz
u-boot-midas-e3463b43fb7b82e0f96f36a36cffb713b6312a3e.tar.bz2
u-boot-midas-e3463b43fb7b82e0f96f36a36cffb713b6312a3e.zip
i9300 => midas
-rw-r--r--arch/arm/mach-exynos/Kconfig6
-rw-r--r--board/samsung/i9300/Kconfig14
-rw-r--r--board/samsung/i9300/MAINTAINERS6
-rw-r--r--board/samsung/midas/Kconfig14
-rw-r--r--board/samsung/midas/MAINTAINERS6
-rw-r--r--board/samsung/midas/Makefile (renamed from board/samsung/i9300/Makefile)2
-rw-r--r--board/samsung/midas/led.c (renamed from board/samsung/i9300/led.c)8
-rw-r--r--board/samsung/midas/midas.c (renamed from board/samsung/i9300/i9300.c)52
-rw-r--r--board/samsung/midas/midas.h (renamed from board/samsung/i9300/i9300.h)2
-rw-r--r--configs/midas_defconfig (renamed from configs/i9300_defconfig)10
-rwxr-xr-xcreate_4412_emmc_image.sh2
-rwxr-xr-xcreate_4412_sd_image.sh2
-rw-r--r--include/configs/midas.h (renamed from include/configs/i9300.h)4
13 files changed, 60 insertions, 68 deletions
diff --git a/arch/arm/mach-exynos/Kconfig b/arch/arm/mach-exynos/Kconfig
index 2c0d0c079f..a7f6e838ea 100644
--- a/arch/arm/mach-exynos/Kconfig
+++ b/arch/arm/mach-exynos/Kconfig
@@ -72,8 +72,8 @@ config TARGET_ODROID
bool "Exynos4412 Odroid board"
select EXYNOS4412
-config TARGET_I9300
- bool "Exynos4412 i9300 board"
+config TARGET_MIDAS
+ bool "Exynos4412 midas boards"
select SUPPORT_SPL
select EXYNOS4412
select BOARD_LATE_INIT
@@ -175,7 +175,7 @@ source "board/samsung/arndale/Kconfig"
source "board/samsung/smdk5250/Kconfig"
source "board/samsung/smdk5420/Kconfig"
source "board/samsung/espresso7420/Kconfig"
-source "board/samsung/i9300/Kconfig"
+source "board/samsung/midas/Kconfig"
config SPL_LDSCRIPT
default "board/samsung/common/exynos-uboot-spl.lds" if ARCH_EXYNOS5 || ARCH_EXYNOS4
diff --git a/board/samsung/i9300/Kconfig b/board/samsung/i9300/Kconfig
deleted file mode 100644
index 5527a1bbf6..0000000000
--- a/board/samsung/i9300/Kconfig
+++ /dev/null
@@ -1,14 +0,0 @@
-if TARGET_I9300
-
-config SYS_BOARD
- default "i9300"
- help
- Galaxy S III (3G) mobile phone support
-
-config SYS_VENDOR
- default "samsung"
-
-config SYS_CONFIG_NAME
- default "i9300"
-
-endif
diff --git a/board/samsung/i9300/MAINTAINERS b/board/samsung/i9300/MAINTAINERS
deleted file mode 100644
index 625511b99a..0000000000
--- a/board/samsung/i9300/MAINTAINERS
+++ /dev/null
@@ -1,6 +0,0 @@
-Samsung i9300 Board
-M: Simon Shields <simon@lineageos.org>
-S: Maintained
-F: board/samsung/i9300/
-F: include/configs/i9300.h
-F: configs/i9300_defconfig
diff --git a/board/samsung/midas/Kconfig b/board/samsung/midas/Kconfig
new file mode 100644
index 0000000000..f40bb7afda
--- /dev/null
+++ b/board/samsung/midas/Kconfig
@@ -0,0 +1,14 @@
+if TARGET_MIDAS
+
+config SYS_BOARD
+ default "midas"
+ help
+ Samsung Mobile's "midas" smartphone family based on Exynos 4412 support
+
+config SYS_VENDOR
+ default "samsung"
+
+config SYS_CONFIG_NAME
+ default "midas"
+
+endif
diff --git a/board/samsung/midas/MAINTAINERS b/board/samsung/midas/MAINTAINERS
new file mode 100644
index 0000000000..109886249c
--- /dev/null
+++ b/board/samsung/midas/MAINTAINERS
@@ -0,0 +1,6 @@
+Samsung midas boards
+M: Simon Shields <simon@lineageos.org>
+S: Maintained
+F: board/samsung/midas/
+F: include/configs/midas.h
+F: configs/midas_defconfig
diff --git a/board/samsung/i9300/Makefile b/board/samsung/midas/Makefile
index 13bdc3dbac..0642dd3363 100644
--- a/board/samsung/i9300/Makefile
+++ b/board/samsung/midas/Makefile
@@ -4,4 +4,4 @@
# SPDX-License-Identifier: GPL-2.0+
#
-obj-y += i9300.o led.o
+obj-y += midas.o led.o
diff --git a/board/samsung/i9300/led.c b/board/samsung/midas/led.c
index a725784101..3bad781add 100644
--- a/board/samsung/i9300/led.c
+++ b/board/samsung/midas/led.c
@@ -1,7 +1,7 @@
#include <common.h>
#include <dm/uclass.h>
#include <led.h>
-#include "i9300.h"
+#include "midas.h"
DECLARE_GLOBAL_DATA_PTR;
@@ -11,7 +11,7 @@ static const char *leds[] = {
[BLUE] = "blue",
};
-static int i9300_set_led(const char *name, enum led_state_t state)
+static int midas_set_led(const char *name, enum led_state_t state)
{
struct udevice *dev;
int ret;
@@ -25,12 +25,12 @@ static int i9300_set_led(const char *name, enum led_state_t state)
return led_set_state(dev, state);
}
-int i9300_led_action(int mask, enum led_state_t state)
+int midas_led_action(int mask, enum led_state_t state)
{
int ret;
for (int i = 0; i < ARRAY_SIZE(leds); i++) {
if (mask & (1 << i)) {
- ret = i9300_set_led(leds[i], state);
+ ret = midas_set_led(leds[i], state);
if (ret) {
return ret;
}
diff --git a/board/samsung/i9300/i9300.c b/board/samsung/midas/midas.c
index df5c400962..c732fd7461 100644
--- a/board/samsung/i9300/i9300.c
+++ b/board/samsung/midas/midas.c
@@ -1,5 +1,5 @@
/*
- * i9300 board file
+ * midas board file
* Copyright (C) 2018 Simon Shields <simon@lineageos.org>
*
* SPDX-License-Identifier: GPL-2.0+
@@ -23,7 +23,7 @@
#include <usb.h>
#include <usb/dwc2_udc.h>
-#include "i9300.h"
+#include "midas.h"
DECLARE_GLOBAL_DATA_PTR;
@@ -115,7 +115,7 @@ static void board_gpio_init(void)
gpio_set_pull(EXYNOS4X12_GPIO_X01, S5P_GPIO_PULL_NONE);
}
-static int i9300_check_battery(void)
+static int midas_check_battery(void)
{
struct udevice *bat, *extcon, *charger;
int ret, state, current, old_soc, soc;
@@ -162,12 +162,12 @@ static int i9300_check_battery(void)
printf("Need charging: current charge level %d%, will charge at %d uA\n", battery_get_soc(bat), current);
for (int i = 0; i < 50; i++) {
- i9300_led_action(LED_RED | LED_GREEN | LED_BLUE, LEDST_TOGGLE);
+ midas_led_action(LED_RED | LED_GREEN | LED_BLUE, LEDST_TOGGLE);
mdelay(500);
if (charger_get_status(charger) != CHARGE_STATE_DISCHARGING)
break;
}
- i9300_led_action(LED_RED | LED_GREEN | LED_BLUE, LEDST_OFF);
+ midas_led_action(LED_RED | LED_GREEN | LED_BLUE, LEDST_OFF);
if (charger_get_status(charger) == CHARGE_STATE_DISCHARGING ||
charger_get_status(charger) == CHARGE_STATE_UNKNOWN) {
printf("error: not charging. shutting down.");
@@ -178,13 +178,13 @@ static int i9300_check_battery(void)
while (battery_get_status(bat) == BAT_STATE_NEED_CHARGING) {
soc = battery_get_soc(bat);
printf("%s: SoC started at %d, now %d\n", __func__, old_soc, soc);
- i9300_led_action(LED_RED, LEDST_TOGGLE);
+ midas_led_action(LED_RED, LEDST_TOGGLE);
mdelay(500);
}
return BATTERY_LPM;
}
-static int i9300_phy_control(int on)
+static int midas_phy_control(int on)
{
int ret;
int type;
@@ -277,7 +277,7 @@ static int i9300_phy_control(int on)
}
struct dwc2_plat_otg_data exynos4_otg_data = {
- .phy_control = i9300_phy_control,
+ .phy_control = midas_phy_control,
.regs_phy = EXYNOS4X12_USBPHY_BASE,
.regs_otg = EXYNOS4X12_USBOTG_BASE,
.usb_phy_ctrl = EXYNOS4X12_USBPHY_CONTROL,
@@ -300,7 +300,7 @@ int board_usb_init(int index, enum usb_init_type init)
int board_usb_cleanup(int index, enum usb_init_type init)
{
- return i9300_phy_control(0);
+ return midas_phy_control(0);
}
#ifdef CONFIG_OF_BOARD_SETUP
@@ -330,7 +330,7 @@ int ft_board_setup(void *blob, bd_t *bd)
}
#endif
-static enum boot_mode i9300_check_keycombo(void)
+static enum boot_mode midas_check_keycombo(void)
{
int ret = 0;
@@ -356,7 +356,7 @@ static enum boot_mode i9300_check_keycombo(void)
return MODE_NONE;
}
-static enum boot_mode i9300_get_boot_mode(void)
+static enum boot_mode midas_get_boot_mode(void)
{
struct exynos4412_power *pwr = (struct exynos4412_power *)samsung_get_base_power();
@@ -378,32 +378,24 @@ static enum boot_mode i9300_get_boot_mode(void)
return inform;
}
-static void i9300_power_off(void)
+static void midas_power_off(void)
{
struct exynos4412_power *pwr = (struct exynos4412_power *)samsung_get_base_power();
writel(readl(&pwr->ps_hold_control) & 0xfffffeff, &pwr->ps_hold_control);
while (1) {
- i9300_led_action(LED_RED | LED_GREEN, LEDST_TOGGLE);
+ midas_led_action(LED_RED | LED_GREEN, LEDST_TOGGLE);
mdelay(400);
}
}
-#if defined(CONFIG_MULTI_DTB_FIT)
-int board_fit_config_name_match(const char *name)
-{
- if (!strcmp(name, "samsung,midas"))
- return 0;
- return -1;
-}
-#endif
int exynos_init(void)
{
board_gpio_init();
- printf("Key combo: %#x\n", i9300_check_keycombo());
+ printf("Key combo: %#x\n", midas_check_keycombo());
return 0;
}
@@ -412,14 +404,14 @@ int exynos_late_init(void)
board_load_info();
env_set("bootmode", "normal");
- enum boot_mode mode = i9300_get_boot_mode();
+ enum boot_mode mode = midas_get_boot_mode();
if (mode == MODE_NONE)
- mode = i9300_check_keycombo();
+ mode = midas_check_keycombo();
- enum battery_boot_mode bat_state = i9300_check_battery();
+ enum battery_boot_mode bat_state = midas_check_battery();
if (bat_state == BATTERY_ABORT) {
/* release PS_HOLD - turn off board */
- i9300_power_off();
+ midas_power_off();
} else if (bat_state == BATTERY_LPM && mode == MODE_NONE) {
env_set("bootmode", "lpm");
}
@@ -427,23 +419,23 @@ int exynos_late_init(void)
switch (mode) {
case MODE_FASTBOOT:
printf("Activating fastboot mode\n");
- i9300_led_action(LED_BLUE, LEDST_ON);
+ midas_led_action(LED_BLUE, LEDST_ON);
env_set("bootcmd", "run fastboot");
break;
case MODE_RECOVERY:
printf("Booting to recovery\n");
- i9300_led_action(LED_RED, LEDST_ON);
+ midas_led_action(LED_RED, LEDST_ON);
env_set("bootcmd", "run recoveryboot");
env_set("bootmode", "recovery");
break;
case MODE_CONSOLE:
printf("Dropping into u-boot console\n");
- i9300_led_action(LED_GREEN, LEDST_ON);
+ midas_led_action(LED_GREEN, LEDST_ON);
env_set("bootcmd", NULL);
break;
default:
printf("Booting normally...\n");
- i9300_led_action(LED_GREEN | LED_RED, LEDST_ON);
+ midas_led_action(LED_GREEN | LED_RED, LEDST_ON);
env_set("bootcmd", "run autoboot");
}
diff --git a/board/samsung/i9300/i9300.h b/board/samsung/midas/midas.h
index dca26ddbb7..e2f5342e7e 100644
--- a/board/samsung/i9300/i9300.h
+++ b/board/samsung/midas/midas.h
@@ -7,7 +7,7 @@
#define LED_GREEN (1 << GREEN)
#define LED_BLUE (1 << BLUE)
-int i9300_led_action(int mask, enum led_state_t state);
+int midas_led_action(int mask, enum led_state_t state);
#define INFORM_MAGIC 0x12345670
enum boot_mode {
diff --git a/configs/i9300_defconfig b/configs/midas_defconfig
index a8348d044b..f30d410c92 100644
--- a/configs/i9300_defconfig
+++ b/configs/midas_defconfig
@@ -20,8 +20,8 @@ CONFIG_SYS_ARCH="arm"
CONFIG_SYS_CPU="armv7"
CONFIG_SYS_SOC="exynos"
CONFIG_SYS_VENDOR="samsung"
-CONFIG_SYS_BOARD="i9300"
-CONFIG_SYS_CONFIG_NAME="i9300"
+CONFIG_SYS_BOARD="midas"
+CONFIG_SYS_CONFIG_NAME="midas"
#
# ARM architecture
@@ -149,7 +149,7 @@ CONFIG_EXYNOS4412=y
# CONFIG_TARGET_ORIGEN is not set
# CONFIG_TARGET_TRATS2 is not set
# CONFIG_TARGET_ODROID is not set
-CONFIG_TARGET_I9300=y
+CONFIG_TARGET_MIDAS=y
CONFIG_SPL_GPIO_SUPPORT=y
CONFIG_SPL_LIBCOMMON_SUPPORT=y
CONFIG_SPL_LIBGENERIC_SUPPORT=y
@@ -173,14 +173,14 @@ CONFIG_IDENT_STRING=""
#
# CONFIG_DEBUG_LL is not set
CONFIG_DEFAULT_DEVICE_TREE="exynos4412-midas"
-CONFIG_SMBIOS_PRODUCT_NAME="i9300"
+CONFIG_SMBIOS_PRODUCT_NAME="midas"
# CONFIG_DEBUG_UART is not set
# CONFIG_AHCI is not set
#
# General setup
#
-CONFIG_LOCALVERSION="-i9300"
+CONFIG_LOCALVERSION="-midas"
CONFIG_LOCALVERSION_AUTO=y
CONFIG_CC_OPTIMIZE_FOR_SIZE=y
CONFIG_DISTRO_DEFAULTS=y
diff --git a/create_4412_emmc_image.sh b/create_4412_emmc_image.sh
index 79d0eaff84..51bb89971c 100755
--- a/create_4412_emmc_image.sh
+++ b/create_4412_emmc_image.sh
@@ -35,7 +35,7 @@ echo "Exynos4412 FWBL1 fusing"
dd if=./p4412_s_fwbl1.bin of=$1 bs=$block_size seek=$fwbl1_pos
####################################
echo "Exynos4412 BL2 fusing"
-dd if=spl/i9300-spl.bin of=$1 bs=$block_size seek=$bl2_pos
+dd if=spl/midas-spl.bin of=$1 bs=$block_size seek=$bl2_pos
####################################
echo "Exynos4412 bootloader fusing"
dd if=./u-boot.bin of=$1 bs=$block_size seek=$uboot_pos
diff --git a/create_4412_sd_image.sh b/create_4412_sd_image.sh
index 4ce242a050..226d612a1e 100755
--- a/create_4412_sd_image.sh
+++ b/create_4412_sd_image.sh
@@ -34,7 +34,7 @@ echo "Exynos4412 FWBL1 fusing"
dd if=./p4412_s_fwbl1.bin of=$1 bs=$block_size seek=$fwbl1_pos
####################################
echo "Exynos4412 BL2 fusing"
-dd if=spl/i9300-spl.bin of=$1 bs=$block_size seek=$bl2_pos
+dd if=spl/midas-spl.bin of=$1 bs=$block_size seek=$bl2_pos
####################################
echo "Exynos4412 bootloader fusing"
dd if=./u-boot.bin of=$1 bs=$block_size seek=$uboot_pos
diff --git a/include/configs/i9300.h b/include/configs/midas.h
index 831c6b1b4e..dc2b75a0cb 100644
--- a/include/configs/i9300.h
+++ b/include/configs/midas.h
@@ -1,5 +1,5 @@
-#ifndef __I9300_CONFIG_H__
-#define __I9300_CONFIG_H__
+#ifndef __MIDAS_CONFIG_H__
+#define __MIDAS_CONFIG_H__
#define CONFIG_EXYNOS4