aboutsummaryrefslogtreecommitdiffstats
path: root/board
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 /board
parenta08591845243ebe09e789787db912be6629d08a1 (diff)
downloadu-boot-midas-e3463b43fb7b82e0f96f36a36cffb713b6312a3e.tar.gz
u-boot-midas-e3463b43fb7b82e0f96f36a36cffb713b6312a3e.tar.bz2
u-boot-midas-e3463b43fb7b82e0f96f36a36cffb713b6312a3e.zip
i9300 => midas
Diffstat (limited to 'board')
-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
8 files changed, 48 insertions, 56 deletions
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 {