Merge git://git.denx.de/u-boot-fsl-qoriq
authorTom Rini <trini@konsulko.com>
Fri, 15 Mar 2019 15:58:17 +0000 (11:58 -0400)
committerTom Rini <trini@konsulko.com>
Fri, 15 Mar 2019 15:58:17 +0000 (11:58 -0400)
- DPAA2 fixes and DDR errata workaround for LS1021A

20 files changed:
MAINTAINERS
arch/arm/dts/exynos5422-odroidxu3.dts
board/samsung/arndale/MAINTAINERS
board/samsung/common/board.c
board/samsung/common/bootscripts/autoboot.cmd
board/samsung/common/exynos5-dt-types.c
board/samsung/common/misc.c
board/samsung/odroid/odroid.c
configs/odroid-xu3_defconfig
doc/device-tree-bindings/regulator/regulator.txt
drivers/adc/exynos-adc.c
drivers/power/regulator/regulator-uclass.c
drivers/power/regulator/s2mps11_regulator.c
include/configs/espresso7420.h
include/configs/odroid.h
include/configs/odroid_xu3.h
include/power/regulator.h
include/samsung/misc.h
lib/efi_selftest/efi_freestanding.c [new file with mode: 0644]
scripts/Makefile.lib

index 4fabb75eda375350822a91dcaf20948069aab096..16918154f19b596245756a526dfb27092f82a795 100644 (file)
@@ -12,13 +12,8 @@ Descriptions of section entries:
        S: Status, one of the following:
           Supported:   Someone is actually paid to look after this.
           Maintained:  Someone actually looks after it.
-          Odd Fixes:   It has a maintainer but they don't have time to do
-                       much other than throw the odd patch in. See below..
           Orphan:      No current maintainer [but maybe you could take the
                        role as you write your new code].
-          Obsolete:    Old code. Something tagged obsolete generally means
-                       it has been replaced by a better system and you
-                       should be using that.
        F: Files and directories with wildcard patterns.
           A trailing slash includes all files and subdirectory files.
           F:   drivers/net/    all files in and below drivers/net
index e859dd1b981ae5646bfca37f404be91d3d964b97..6df6be91814f080b38cac2a251952e6a468f9013 100644 (file)
@@ -32,6 +32,7 @@
 
        adc@12D10000 {
                u-boot,dm-pre-reloc;
+               vdd-supply = <&ldo4_reg>;
                status = "okay";
        };
 
@@ -44,6 +45,7 @@
                                        regulator-name = "vdd_ldo1";
                                        regulator-min-microvolt = <1000000>;
                                        regulator-max-microvolt = <1000000>;
+                                       regulator-ramp-delay = <12000>;
                                        regulator-always-on;
                                };
 
                                        regulator-name = "vddq_mmc0";
                                        regulator-min-microvolt = <1800000>;
                                        regulator-max-microvolt = <1800000>;
+                                       regulator-ramp-delay = <12000>;
                                };
 
                                ldo4_reg: LDO4 {
                                        regulator-name = "vdd_adc";
                                        regulator-min-microvolt = <1800000>;
                                        regulator-max-microvolt = <1800000>;
+                                       regulator-ramp-delay = <12000>;
                                };
 
                                ldo5_reg: LDO5 {
                                        regulator-name = "vdd_ldo5";
                                        regulator-min-microvolt = <1800000>;
                                        regulator-max-microvolt = <1800000>;
+                                       regulator-ramp-delay = <12000>;
                                        regulator-always-on;
                                };
 
@@ -70,6 +75,7 @@
                                        regulator-name = "vdd_ldo6";
                                        regulator-min-microvolt = <1000000>;
                                        regulator-max-microvolt = <1000000>;
+                                       regulator-ramp-delay = <12000>;
                                        regulator-always-on;
                                };
 
@@ -77,6 +83,7 @@
                                        regulator-name = "vdd_ldo7";
                                        regulator-min-microvolt = <1800000>;
                                        regulator-max-microvolt = <1800000>;
+                                       regulator-ramp-delay = <12000>;
                                        regulator-always-on;
                                };
 
@@ -84,6 +91,7 @@
                                        regulator-name = "vdd_ldo8";
                                        regulator-min-microvolt = <1800000>;
                                        regulator-max-microvolt = <1800000>;
+                                       regulator-ramp-delay = <12000>;
                                        regulator-always-on;
                                };
 
@@ -91,6 +99,7 @@
                                        regulator-name = "vdd_ldo9";
                                        regulator-min-microvolt = <3000000>;
                                        regulator-max-microvolt = <3000000>;
+                                       regulator-ramp-delay = <12000>;
                                        regulator-always-on;
                                };
 
                                        regulator-name = "vdd_ldo10";
                                        regulator-min-microvolt = <1800000>;
                                        regulator-max-microvolt = <1800000>;
+                                       regulator-ramp-delay = <12000>;
                                        regulator-always-on;
                                };
 
                                        regulator-name = "vdd_ldo11";
                                        regulator-min-microvolt = <1000000>;
                                        regulator-max-microvolt = <1000000>;
+                                       regulator-ramp-delay = <12000>;
                                        regulator-always-on;
                                };
 
                                        regulator-name = "vdd_ldo12";
                                        regulator-min-microvolt = <1800000>;
                                        regulator-max-microvolt = <1800000>;
+                                       regulator-ramp-delay = <12000>;
                                        regulator-always-on;
                                };
 
                                        regulator-name = "vddq_mmc2";
                                        regulator-min-microvolt = <2800000>;
                                        regulator-max-microvolt = <2800000>;
+                                       regulator-ramp-delay = <12000>;
                                };
 
                                ldo15_reg: LDO15 {
                                        regulator-name = "vdd_ldo15";
                                        regulator-min-microvolt = <3300000>;
                                        regulator-max-microvolt = <3300000>;
+                                       regulator-ramp-delay = <12000>;
                                        regulator-always-on;
                                };
 
                                        regulator-name = "vdd_ldo16";
                                        regulator-min-microvolt = <2200000>;
                                        regulator-max-microvolt = <2200000>;
+                                       regulator-ramp-delay = <12000>;
                                        regulator-always-on;
                                };
 
                                        regulator-name = "vdd_ldo17";
                                        regulator-min-microvolt = <3300000>;
                                        regulator-max-microvolt = <3300000>;
+                                       regulator-ramp-delay = <12000>;
                                        regulator-always-on;
                                };
 
                                        regulator-name = "vdd_emmc_1V8";
                                        regulator-min-microvolt = <1800000>;
                                        regulator-max-microvolt = <1800000>;
+                                       regulator-ramp-delay = <12000>;
                                };
 
                                ldo19_reg: LDO19 {
                                        regulator-name = "vdd_sd";
                                        regulator-min-microvolt = <2800000>;
                                        regulator-max-microvolt = <2800000>;
+                                       regulator-ramp-delay = <12000>;
                                };
 
                                ldo24_reg: LDO24 {
                                        regulator-name = "tsp_io";
                                        regulator-min-microvolt = <2800000>;
                                        regulator-max-microvolt = <2800000>;
+                                       regulator-ramp-delay = <12000>;
                                        regulator-always-on;
                                };
 
                                        regulator-name = "vdd_ldo26";
                                        regulator-min-microvolt = <3000000>;
                                        regulator-max-microvolt = <3000000>;
+                                       regulator-ramp-delay = <12000>;
                                        regulator-always-on;
                                };
 
        };
 
        serial@12C20000 {
-               status="okay";
+               status = "okay";
        };
 
        mmc@12200000 {
index 7dc17854d1b314029da6ddfbb3784b34daedd60b..aa64c7a1874bd9cd6b53d4816aae83f220c1b69b 100644 (file)
@@ -1,5 +1,5 @@
 ARNDALE BOARD
-M:     Chander Kashyap <k.chander@samsung.com>
+M:     Krzysztof Kozlowski <krzk@kernel.org>
 S:     Maintained
 F:     board/samsung/arndale/
 F:     include/configs/arndale.h
index 96228a86a117e2c402d8b92ea46212c1b9fedff1..9adbd1e2cf951a73ec2c8b894c94e1d79ba43c87 100644 (file)
@@ -249,11 +249,22 @@ int board_eth_init(bd_t *bis)
        return 0;
 }
 
-#ifdef CONFIG_DISPLAY_BOARDINFO
+#if defined(CONFIG_DISPLAY_BOARDINFO) || defined(CONFIG_DISPLAY_BOARDINFO_LATE)
 int checkboard(void)
 {
        if (IS_ENABLED(CONFIG_BOARD_TYPES)) {
-               const char *board_info = get_board_type();
+               const char *board_info;
+
+               if (IS_ENABLED(CONFIG_DISPLAY_BOARDINFO_LATE)) {
+                       /*
+                        * Printing type requires having revision, although
+                        * this will succeed only if done late.
+                        * Otherwise revision will be set in misc_init_r().
+                        */
+                       set_board_revision();
+               }
+
+               board_info = get_board_type();
 
                if (board_info)
                        printf("Type:  %s\n", board_info);
@@ -287,6 +298,16 @@ int board_late_init(void)
 #ifdef CONFIG_MISC_INIT_R
 int misc_init_r(void)
 {
+       if (IS_ENABLED(CONFIG_BOARD_TYPES) &&
+           !IS_ENABLED(CONFIG_DISPLAY_BOARDINFO_LATE)) {
+               /*
+                * If revision was not set by late display boardinfo,
+                * set it here. At this point regulators should be already
+                * available.
+                */
+               set_board_revision();
+       }
+
 #ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
        set_board_info();
 #endif
index 11c724c4e0950a6cab8d713bbf2de2c8bd6f2e45..d66bcccf5d1cfc8015fc4cb4985154eb748d4534 100644 (file)
@@ -3,7 +3,7 @@
 # ./tools/mkimage -c none -A arm -T script -d autoboot.cmd boot.scr
 #
 # It requires a list of environment variables to be defined before load:
-# platform dependent: boardname, fdtfile, console
+# platform dependent: board_name, fdtfile, console
 # system dependent: mmcbootdev, mmcbootpart, mmcrootdev, mmcrootpart, rootfstype
 #
 setenv fdtaddr     "40800000"
@@ -35,17 +35,17 @@ else
        setenv initrd_addr -;
 fi;"
 
-#### Routine: boot_fit - check that env $boardname is set and boot proper config of ITB image
+#### Routine: boot_fit - check that env $board_name is set and boot proper config of ITB image
 setenv setboot_fit "
-if test -e '${boardname}'; then
+if test -e '${board_name}'; then
        setenv fdt_addr ;
        setenv initrd_addr ;
        setenv kerneladdr  0x42000000;
        setenv kernelname  Image.itb;
-       setenv itbcfg      "\"#${boardname}\"";
+       setenv itbcfg      "\"#${board_name}\"";
        setenv imgbootcmd  bootm;
 else
-       echo Warning! Variable: \$boardname is undefined!;
+       echo Warning! Variable: \$board_name is undefined!;
 fi"
 
 #### Routine: setboot_uimg - prepare env to boot uImage
index 7a86e91877688d76d91ccbba25d4c331bca3fbe9..516c32923e44df5f78d5cb165234569364ae7397 100644 (file)
@@ -57,12 +57,48 @@ static unsigned int odroid_get_rev(void)
        return 0;
 }
 
+/*
+ * Read ADC at least twice and check the resuls.  If regulator providing voltage
+ * on to measured point was just turned on, first reads might require time
+ * to stabilize.
+ */
+static int odroid_get_adc_val(unsigned int *adcval)
+{
+       unsigned int adcval_prev = 0;
+       int ret, retries = 20;
+
+       ret = adc_channel_single_shot("adc", CONFIG_ODROID_REV_AIN,
+                                     &adcval_prev);
+       if (ret)
+               return ret;
+
+       while (retries--) {
+               mdelay(5);
+
+               ret = adc_channel_single_shot("adc", CONFIG_ODROID_REV_AIN,
+                                             adcval);
+               if (ret)
+                       return ret;
+
+               /*
+                * If difference between ADC reads is less than 3%,
+                * accept the result
+                */
+               if ((100 * abs(*adcval - adcval_prev) / adcval_prev) < 3)
+                       return ret;
+
+               adcval_prev = *adcval;
+       }
+
+       return ret;
+}
+
 static int odroid_get_board_type(void)
 {
        unsigned int adcval;
        int ret, i;
 
-       ret = adc_channel_single_shot("adc", CONFIG_ODROID_REV_AIN, &adcval);
+       ret = odroid_get_adc_val(&adcval);
        if (ret)
                goto rev_default;
 
@@ -192,8 +228,11 @@ const char *get_board_type(void)
 
 /**
  * set_board_type() - set board type in gd->board_type.
- * As default type set EXYNOS5_BOARD_GENERIC, if detect Odroid,
- * then set its proper type.
+ * As default type set EXYNOS5_BOARD_GENERIC. If Odroid is detected,
+ * set its proper type based on device tree.
+ *
+ * This might be called early when some more specific ways to detect revision
+ * are not yet available.
  */
 void set_board_type(void)
 {
@@ -211,8 +250,15 @@ void set_board_type(void)
                gd->board_type = of_match->data;
                break;
        }
+}
 
-       /* If Odroid, then check its revision */
+/**
+ * set_board_revision() - set detailed board type in gd->board_type.
+ * Should be called when resources (e.g. regulators) are available
+ * so ADC can be used to detect the specific revision of a board.
+ */
+void set_board_revision(void)
+{
        if (board_is_odroidxu3())
                gd->board_type = odroid_get_board_type();
 }
index 05243fc8965989e8ad55fb8700865288ff959278..53cd1b29070363792d7d97af8ea238ee27621cdb 100644 (file)
@@ -101,7 +101,7 @@ void set_board_info(void)
                bdtype = "";
 
        sprintf(info, "%s%s", bdname, bdtype);
-       env_set("boardname", info);
+       env_set("board_name", info);
 #endif
        snprintf(info, ARRAY_SIZE(info),  "%s%x-%s%s.dtb",
                 CONFIG_SYS_SOC, s5p_cpu_id, bdname, bdtype);
index 552333fe869d8162e396f2b9d528254c98b229f5..3e594fd85011c986fcc334102b666adc692062ac 100644 (file)
@@ -54,6 +54,14 @@ void set_board_type(void)
                gd->board_type = ODROID_TYPE_U3;
 }
 
+void set_board_revision(void)
+{
+       /*
+        * Revision already set by set_board_type() because it can be
+        * executed early.
+        */
+}
+
 const char *get_board_type(void)
 {
        const char *board_type[] = {"u3", "x2"};
@@ -462,18 +470,33 @@ struct dwc2_plat_otg_data s5pc210_otg_data = {
 
 #if defined(CONFIG_USB_GADGET) || defined(CONFIG_CMD_USB)
 
+static void set_usb3503_ref_clk(void)
+{
+#ifdef CONFIG_BOARD_TYPES
+       /*
+        * gpx3-0 chooses primary (low) or secondary (high) reference clock
+        * frequencies table.  The choice of clock is done through hard-wired
+        * REF_SEL pins.
+        * The Odroid Us have reference clock at 24 MHz (00 entry from secondary
+        * table) and Odroid Xs have it at 26 MHz (01 entry from primary table).
+        */
+       if (gd->board_type == ODROID_TYPE_U3)
+               gpio_direction_output(EXYNOS4X12_GPIO_X30, 0);
+       else
+               gpio_direction_output(EXYNOS4X12_GPIO_X30, 1);
+#else
+       /* Choose Odroid Xs frequency without board types */
+       gpio_direction_output(EXYNOS4X12_GPIO_X30, 1);
+#endif /* CONFIG_BOARD_TYPES */
+}
+
 int board_usb_init(int index, enum usb_init_type init)
 {
 #ifdef CONFIG_CMD_USB
        struct udevice *dev;
        int ret;
 
-       /* Set Ref freq 0 => 24MHz, 1 => 26MHz*/
-       /* Odroid Us have it at 24MHz, Odroid Xs at 26MHz */
-       if (gd->board_type == ODROID_TYPE_U3)
-               gpio_direction_output(EXYNOS4X12_GPIO_X30, 0);
-       else
-               gpio_direction_output(EXYNOS4X12_GPIO_X30, 1);
+       set_usb3503_ref_clk();
 
        /* Disconnect, Reset, Connect */
        gpio_direction_output(EXYNOS4X12_GPIO_X34, 0);
index e35f8d6dde7870705e20eab122c2479be48aabdc..887522a59b95e9bdb9e2d5c1c7530e4cdd12090b 100644 (file)
@@ -10,6 +10,8 @@ CONFIG_FIT=y
 CONFIG_FIT_BEST_MATCH=y
 CONFIG_SILENT_CONSOLE=y
 CONFIG_CONSOLE_MUX=y
+# CONFIG_DISPLAY_BOARDINFO is not set
+CONFIG_DISPLAY_BOARDINFO_LATE=y
 CONFIG_MISC_INIT_R=y
 CONFIG_BOARD_TYPES=y
 CONFIG_SYS_PROMPT="ODROID-XU3 # "
@@ -33,6 +35,7 @@ CONFIG_ADC=y
 CONFIG_ADC_EXYNOS=y
 CONFIG_DFU_MMC=y
 CONFIG_MMC_DW=y
+CONFIG_SYS_I2C_S3C24X0=y
 CONFIG_SMC911X=y
 CONFIG_SMC911X_BASE=0x5000000
 CONFIG_DM_PMIC=y
index 65b69c427899e582568538a942c2eb71a61b60bd..4ba642b7c77ffe5989561ebdd6896d0eb4174e0b 100644 (file)
@@ -35,6 +35,7 @@ Optional properties:
 - regulator-max-microamp: a maximum allowed Current value
 - regulator-always-on: regulator should never be disabled
 - regulator-boot-on: enabled by bootloader/firmware
+- regulator-ramp-delay: ramp delay for regulator (in uV/us)
 
 Note
 The "regulator-name" constraint is used for setting the device's uclass
@@ -60,4 +61,5 @@ ldo0 {
        regulator-max-microamp = <100000>;
        regulator-always-on;
        regulator-boot-on;
+       regulator-ramp-delay = <12000>;
 };
index d33e3d632afca06c68e109c259877c73b6a80e8b..12c49fc8cefbaa3f5e5bdf236e69ec220a3dd3cb 100644 (file)
@@ -62,7 +62,7 @@ int exynos_adc_stop(struct udevice *dev)
 
        /* Stop conversion */
        cfg = readl(&regs->con1);
-       cfg |= ~ADC_V2_CON1_STC_EN;
+       cfg &= ~ADC_V2_CON1_STC_EN;
 
        writel(cfg, &regs->con1);
 
index 6f355b969a6d1353727a47bcbbf1c7a3ef33cf64..9118b8eb39e34ff4266d2d1f8fc9a9f562565885 100644 (file)
@@ -35,10 +35,22 @@ int regulator_get_value(struct udevice *dev)
        return ops->get_value(dev);
 }
 
+static void regulator_set_value_ramp_delay(struct udevice *dev, int old_uV,
+                                          int new_uV, unsigned int ramp_delay)
+{
+       int delay = DIV_ROUND_UP(abs(new_uV - old_uV), ramp_delay);
+
+       debug("regulator %s: delay %u us (%d uV -> %d uV)\n", dev->name, delay,
+             old_uV, new_uV);
+
+       udelay(delay);
+}
+
 int regulator_set_value(struct udevice *dev, int uV)
 {
        const struct dm_regulator_ops *ops = dev_get_driver_ops(dev);
        struct dm_regulator_uclass_platdata *uc_pdata;
+       int ret, old_uV = uV, is_enabled = 0;
 
        uc_pdata = dev_get_uclass_platdata(dev);
        if (uc_pdata->min_uV != -ENODATA && uV < uc_pdata->min_uV)
@@ -49,7 +61,20 @@ int regulator_set_value(struct udevice *dev, int uV)
        if (!ops || !ops->set_value)
                return -ENOSYS;
 
-       return ops->set_value(dev, uV);
+       if (uc_pdata->ramp_delay) {
+               is_enabled = regulator_get_enable(dev);
+               old_uV = regulator_get_value(dev);
+       }
+
+       ret = ops->set_value(dev, uV);
+
+       if (!ret) {
+               if (uc_pdata->ramp_delay && old_uV > 0 && is_enabled)
+                       regulator_set_value_ramp_delay(dev, old_uV, uV,
+                                                      uc_pdata->ramp_delay);
+       }
+
+       return ret;
 }
 
 /*
@@ -107,6 +132,7 @@ int regulator_set_enable(struct udevice *dev, bool enable)
 {
        const struct dm_regulator_ops *ops = dev_get_driver_ops(dev);
        struct dm_regulator_uclass_platdata *uc_pdata;
+       int ret, old_enable = 0;
 
        if (!ops || !ops->set_enable)
                return -ENOSYS;
@@ -115,7 +141,22 @@ int regulator_set_enable(struct udevice *dev, bool enable)
        if (!enable && uc_pdata->always_on)
                return -EACCES;
 
-       return ops->set_enable(dev, enable);
+       if (uc_pdata->ramp_delay)
+               old_enable = regulator_get_enable(dev);
+
+       ret = ops->set_enable(dev, enable);
+       if (!ret) {
+               if (uc_pdata->ramp_delay && !old_enable && enable) {
+                       int uV = regulator_get_value(dev);
+
+                       if (uV > 0) {
+                               regulator_set_value_ramp_delay(dev, 0, uV,
+                                                              uc_pdata->ramp_delay);
+                       }
+               }
+       }
+
+       return ret;
 }
 
 int regulator_set_enable_if_allowed(struct udevice *dev, bool enable)
@@ -335,6 +376,8 @@ static int regulator_pre_probe(struct udevice *dev)
                                                -ENODATA);
        uc_pdata->always_on = dev_read_bool(dev, "regulator-always-on");
        uc_pdata->boot_on = dev_read_bool(dev, "regulator-boot-on");
+       uc_pdata->ramp_delay = dev_read_u32_default(dev, "regulator-ramp-delay",
+                                                   0);
 
        /* Those values are optional (-ENODATA if unset) */
        if ((uc_pdata->min_uV != -ENODATA) &&
index ced504eb14762a077b764a7c469a878e98ab0b3c..67d1f9689de38ea50bf3166d0e9fbf0abe39da04 100644 (file)
@@ -346,6 +346,8 @@ static int s2mps11_ldo_hex2volt(int ldo, int hex)
        case 11:
        case 22:
        case 23:
+       case 27:
+       case 35:
                uV = hex * S2MPS11_LDO_STEP + S2MPS11_LDO_UV_MIN;
                break;
        default:
@@ -366,6 +368,8 @@ static int s2mps11_ldo_volt2hex(int ldo, int uV)
        case 11:
        case 22:
        case 23:
+       case 27:
+       case 35:
                hex = (uV - S2MPS11_LDO_UV_MIN) / S2MPS11_LDO_STEP;
                break;
        default:
@@ -547,7 +551,16 @@ static int ldo_get_enable(struct udevice *dev)
 
 static int ldo_set_enable(struct udevice *dev, bool enable)
 {
-       return s2mps11_ldo_enable(dev, PMIC_OP_SET, &enable);
+       int ret;
+
+       ret = s2mps11_ldo_enable(dev, PMIC_OP_SET, &enable);
+       if (ret)
+               return ret;
+
+       /* Wait the "enable delay" for voltage to start to rise */
+       udelay(15);
+
+       return 0;
 }
 
 static int ldo_get_mode(struct udevice *dev)
index 4e3b26c25cd7ab9760fbca47cf38c35e7da4e824..5aeb009f0300cbdbbed8c5f9f59d9207bc7e8e4c 100644 (file)
@@ -21,8 +21,6 @@
 /* select serial console configuration */
 #define CONFIG_DEFAULT_CONSOLE "console=ttySAC1,115200n8\0"
 
-#define CONFIG_DEFAULT_CONSOLE "console=ttySAC1,115200n8\0"
-
 /* DRAM Memory Banks */
 #define SDRAM_BANK_SIZE                (256UL << 20UL) /* 256 MB */
 
index b8809c8dcc7cc032e3b92c464bfe358b8fc2494d..9f2d43e3fa3804b9984f702fd9152c522388ed43 100644 (file)
                "setenv kernelname Image.itb;" \
                "run loadkernel;" \
                "run kernel_args;" \
-               "bootm ${kernel_addr_r}#${boardname}\0" \
+               "bootm ${kernel_addr_r}#${board_name}\0" \
        "boot_uimg=" \
                "setenv kernelname uImage;" \
                "run check_dtb;" \
index f178549a7223c10bf99a5f00b8723d4fce72b67f..af6004eaf511c8b1f92b7a62241ea1e9d0eb8899 100644 (file)
@@ -7,7 +7,7 @@
 #ifndef __CONFIG_ODROID_XU3_H
 #define __CONFIG_ODROID_XU3_H
 
-#include "exynos5420-common.h"
+#include <configs/exynos5420-common.h>
 #include <configs/exynos5-common.h>
 
 #define CONFIG_BOARD_COMMON
@@ -18,7 +18,7 @@
 
 #define TZPC_BASE_OFFSET               0x10000
 
-#define SDRAM_BANK_SIZE                (256UL << 20UL) /* 256 MB */
+#define SDRAM_BANK_SIZE                        (256UL << 20UL) /* 256 MB */
 /* Reserve the last 22 MiB for the secure firmware */
 #define CONFIG_SYS_MEM_TOP_HIDE                (22UL << 20UL)
 #define CONFIG_TZSW_RESERVED_DRAM_SIZE CONFIG_SYS_MEM_TOP_HIDE
@@ -28,7 +28,7 @@
 #define CONFIG_ENV_SIZE                        (SZ_1K * 16)
 #define CONFIG_ENV_OFFSET              (SZ_1K * 3136) /* ~3 MiB offset */
 
-#define CONFIG_SYS_INIT_SP_ADDR        (CONFIG_SYS_LOAD_ADDR - 0x1000000)
+#define CONFIG_SYS_INIT_SP_ADDR                (CONFIG_SYS_LOAD_ADDR - 0x1000000)
 
 #define CONFIG_DEFAULT_CONSOLE         "console=ttySAC2,115200n8\0"
 
@@ -38,7 +38,7 @@
 /* DFU */
 #define CONFIG_SYS_DFU_DATA_BUF_SIZE   SZ_32M
 #define DFU_DEFAULT_POLL_TIMEOUT       300
-#define DFU_MANIFEST_POLL_TIMEOUT       25000
+#define DFU_MANIFEST_POLL_TIMEOUT      25000
 
 /* THOR */
 #define CONFIG_G_DNL_THOR_VENDOR_NUM   CONFIG_USB_GADGET_VENDOR_NUM
 #define CONFIG_SET_DFU_ALT_INFO
 #define CONFIG_SET_DFU_ALT_BUF_LEN     (SZ_1K)
 
-/* Set soc_rev, soc_id, board_rev, boardname, fdtfile */
-#define CONFIG_ODROID_REV_AIN                  9
+/* Set soc_rev, soc_id, board_rev, board_name, fdtfile */
+#define CONFIG_ODROID_REV_AIN          9
 #define CONFIG_REVISION_TAG
 
+/*
+ * Need to override existing one (smdk5420) with odroid so set_board_info will
+ * use proper prefix when creating full board_name (SYS_BOARD + type)
+ */
 #undef CONFIG_SYS_BOARD
-#define CONFIG_SYS_BOARD       "odroid"
+#define CONFIG_SYS_BOARD               "odroid"
 
 /* Define new extra env settings, including DFU settings */
 #undef CONFIG_EXTRA_ENV_SETTINGS
        "rootfstype=ext4\0" \
        "console=" CONFIG_DEFAULT_CONSOLE \
        "fdtfile=exynos5422-odroidxu3.dtb\0" \
-       "boardname=odroidxu3\0" \
+       "board_name=odroidxu3\0" \
        "mmcbootdev=0\0" \
        "mmcrootdev=0\0" \
        "mmcbootpart=1\0" \
index 314160a894b7281248c97f7ac1d10ff8c16c96fd..6c6e2cd4f99635611c0bc19f8969ebfa268f762c 100644 (file)
@@ -150,6 +150,7 @@ enum regulator_flag {
  * @always_on* - bool type, true or false
  * @boot_on*   - bool type, true or false
  * TODO(sjg@chromium.org): Consider putting the above two into @flags
+ * @ramp_delay - Time to settle down after voltage change (unit: uV/us)
  * @flags:     - flags value (see REGULATOR_FLAG_...)
  * @name**     - fdt regulator name - should be taken from the device tree
  * ctrl_reg:   - Control register offset used to enable/disable regulator
@@ -169,6 +170,7 @@ struct dm_regulator_uclass_platdata {
        int max_uV;
        int min_uA;
        int max_uA;
+       unsigned int ramp_delay;
        bool always_on;
        bool boot_on;
        const char *name;
index 017560c256626c41061fd13bfaa5c4aac6bb44da..4ff28a1df0e82d437db198a2576c2c7ba1df533c 100644 (file)
@@ -33,6 +33,7 @@ char *get_dfu_alt_system(char *interface, char *devstr);
 char *get_dfu_alt_boot(char *interface, char *devstr);
 #endif
 void set_board_type(void);
+void set_board_revision(void);
 const char *get_board_type(void);
 
 #endif /* __SAMSUNG_MISC_COMMON_H__ */
diff --git a/lib/efi_selftest/efi_freestanding.c b/lib/efi_selftest/efi_freestanding.c
new file mode 100644 (file)
index 0000000..4b6c27e
--- /dev/null
@@ -0,0 +1,11 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Library for freestanding binary
+ *
+ * Copyright 2019, Heinrich Schuchardt <xypron.glpk@gmx.de>
+ *
+ * GCC requires that freestanding programs provide memcpy(), memmove(),
+ * memset(), and memcmp().
+ */
+
+#include "../efi_loader/efi_freestanding.c"
index ec5c41ec561627f94878879f38e9344d79e263a9..70de9bb13a665c68de0c66193d04b0548cf0cfa2 100644 (file)
@@ -390,7 +390,7 @@ $(obj)/efi_reloc.o: $(srctree)/arch/$(ARCH)/lib/$(EFI_RELOC:.o=.c) $(recordmcoun
        $(call cmd,force_checksrc)
        $(call if_changed_rule,cc_o_c)
 
-$(obj)/%_efi.so: $(obj)/%.o $(obj)/efi_crt0.o $(obj)/efi_reloc.o $(obj)/../efi_loader/efi_freestanding.o
+$(obj)/%_efi.so: $(obj)/%.o $(obj)/efi_crt0.o $(obj)/efi_reloc.o $(obj)/efi_freestanding.o
        $(call cmd,efi_ld)
 
 # ACPI