Skip to content

Commit

Permalink
Merge git://git.denx.de/u-boot-dm
Browse files Browse the repository at this point in the history
  • Loading branch information
trini committed Dec 14, 2017
2 parents 7ef548e + 854dfbf commit 15616a0
Show file tree
Hide file tree
Showing 61 changed files with 1,638 additions and 62 deletions.
6 changes: 6 additions & 0 deletions Makefile
Expand Up @@ -1149,6 +1149,11 @@ u-boot-sunxi-with-spl.bin: spl/sunxi-spl.bin u-boot.img u-boot.dtb FORCE
endif

ifneq ($(CONFIG_TEGRA),)
ifneq ($(CONFIG_BINMAN),)
u-boot-dtb-tegra.bin u-boot-tegra.bin u-boot-nodtb-tegra.bin: \
spl/u-boot-spl u-boot.bin FORCE
$(call if_changed,binman)
else
OBJCOPYFLAGS_u-boot-nodtb-tegra.bin = -O binary --pad-to=$(CONFIG_SYS_TEXT_BASE)
u-boot-nodtb-tegra.bin: spl/u-boot-spl u-boot-nodtb.bin FORCE
$(call if_changed,pad_cat)
Expand All @@ -1159,6 +1164,7 @@ u-boot-tegra.bin: spl/u-boot-spl u-boot.bin FORCE

u-boot-dtb-tegra.bin: u-boot-tegra.bin FORCE
$(call if_changed,copy)
endif # binman
endif

OBJCOPYFLAGS_u-boot-app.efi := $(OBJCOPYFLAGS_EFI)
Expand Down
6 changes: 4 additions & 2 deletions arch/arm/config.mk
Expand Up @@ -136,10 +136,12 @@ endif
# limit ourselves to the sections we want in the .bin.
ifdef CONFIG_ARM64
OBJCOPYFLAGS += -j .text -j .secure_text -j .secure_data -j .rodata -j .data \
-j .u_boot_list -j .rela.dyn -j .got -j .got.plt
-j .u_boot_list -j .rela.dyn -j .got -j .got.plt \
-j .binman_sym_table
else
OBJCOPYFLAGS += -j .text -j .secure_text -j .secure_data -j .rodata -j .hash \
-j .data -j .got -j .got.plt -j .u_boot_list -j .rel.dyn
-j .data -j .got -j .got.plt -j .u_boot_list -j .rel.dyn \
-j .binman_sym_table
endif

# if a dtb section exists we always have to include it
Expand Down
7 changes: 7 additions & 0 deletions arch/arm/cpu/u-boot-spl.lds
Expand Up @@ -36,6 +36,13 @@ SECTIONS
KEEP(*(SORT(.u_boot_list*)));
}

. = ALIGN(4);
.binman_sym_table : {
__binman_sym_start = .;
KEEP(*(SORT(.binman_sym*)));
__binman_sym_end = .;
}

. = ALIGN(4);

__image_copy_end = .;
Expand Down
40 changes: 40 additions & 0 deletions arch/arm/dts/tegra-u-boot.dtsi
@@ -0,0 +1,40 @@
#include <config.h>

/ {
binman {
multiple-images;
image1 {
filename = "u-boot-tegra.bin";
pad-byte = <0xff>;
u-boot-spl {
};
u-boot {
pos = <(CONFIG_SYS_TEXT_BASE -
CONFIG_SPL_TEXT_BASE)>;
};
};

/* Same as image1 - some tools still expect the -dtb suffix */
image2 {
filename = "u-boot-dtb-tegra.bin";
pad-byte = <0xff>;
u-boot-spl {
};
u-boot {
pos = <(CONFIG_SYS_TEXT_BASE -
CONFIG_SPL_TEXT_BASE)>;
};
};

image3 {
filename = "u-boot-nodtb-tegra.bin";
pad-byte = <0xff>;
u-boot-spl {
};
u-boot-nodtb {
pos = <(CONFIG_SYS_TEXT_BASE -
CONFIG_SPL_TEXT_BASE)>;
};
};
};
};
3 changes: 3 additions & 0 deletions arch/arm/dts/tegra114-u-boot.dtsi
@@ -0,0 +1,3 @@
#include <config.h>

#include "tegra-u-boot.dtsi"
2 changes: 2 additions & 0 deletions arch/arm/dts/tegra124-nyan-big-u-boot.dtsi
Expand Up @@ -5,6 +5,8 @@
* SPDX-License-Identifier: GPL-2.0+
*/

#include "tegra-u-boot.dtsi"

/ {
host1x@50000000 {
u-boot,dm-pre-reloc;
Expand Down
3 changes: 3 additions & 0 deletions arch/arm/dts/tegra124-u-boot.dtsi
@@ -0,0 +1,3 @@
#include <config.h>

#include "tegra-u-boot.dtsi"
11 changes: 3 additions & 8 deletions arch/arm/dts/tegra20-u-boot.dtsi
@@ -1,8 +1,3 @@
/ {
host1x@50000000 {
u-boot,dm-pre-reloc;
dc@54200000 {
u-boot,dm-pre-reloc;
};
};
};
#include <config.h>

#include "tegra-u-boot.dtsi"
3 changes: 3 additions & 0 deletions arch/arm/dts/tegra210-u-boot.dtsi
@@ -0,0 +1,3 @@
#include <config.h>

#include "tegra-u-boot.dtsi"
3 changes: 3 additions & 0 deletions arch/arm/dts/tegra30-u-boot.dtsi
@@ -0,0 +1,3 @@
#include <config.h>

#include "tegra-u-boot.dtsi"
1 change: 1 addition & 0 deletions arch/arm/mach-tegra/Kconfig
Expand Up @@ -38,6 +38,7 @@ config TEGRA_COMMON
select OF_CONTROL
select VIDCONSOLE_AS_LCD if DM_VIDEO
select BOARD_EARLY_INIT_F
select BINMAN
imply CRC32_VERIFY

config TEGRA_NO_BPMP
Expand Down
6 changes: 6 additions & 0 deletions arch/sandbox/dts/sandbox_pmic.dtsi
Expand Up @@ -75,4 +75,10 @@
regulator-min-microvolt = <3300000>;
regulator-max-microvolt = <3300000>;
};

no_match_by_nodename {
regulator-name = "buck_SUPPLY_1.5V";
regulator-min-microvolt = <1500000>;
regulator-max-microvolt = <1500000>;
};
};
16 changes: 14 additions & 2 deletions common/spl/spl.c
Expand Up @@ -8,6 +8,7 @@
*/

#include <common.h>
#include <binman_sym.h>
#include <dm.h>
#include <spl.h>
#include <asm/u-boot.h>
Expand All @@ -32,6 +33,9 @@ DECLARE_GLOBAL_DATA_PTR;

u32 *boot_params_ptr = NULL;

/* See spl.h for information about this */
binman_sym_declare(ulong, u_boot_any, pos);

/* Define board data structure */
static bd_t bdata __attribute__ ((section(".data")));

Expand Down Expand Up @@ -120,9 +124,17 @@ __weak void spl_board_prepare_for_boot(void)

void spl_set_header_raw_uboot(struct spl_image_info *spl_image)
{
ulong u_boot_pos = binman_sym(ulong, u_boot_any, pos);

spl_image->size = CONFIG_SYS_MONITOR_LEN;
spl_image->entry_point = CONFIG_SYS_UBOOT_START;
spl_image->load_addr = CONFIG_SYS_TEXT_BASE;
if (u_boot_pos != BINMAN_SYM_MISSING) {
/* biman does not support separate entry addresses at present */
spl_image->entry_point = u_boot_pos;
spl_image->load_addr = u_boot_pos;
} else {
spl_image->entry_point = CONFIG_SYS_UBOOT_START;
spl_image->load_addr = CONFIG_SYS_TEXT_BASE;
}
spl_image->os = IH_OS_U_BOOT;
spl_image->name = "U-Boot";
}
Expand Down
19 changes: 15 additions & 4 deletions common/spl/spl_ram.c
Expand Up @@ -11,6 +11,8 @@
* SPDX-License-Identifier: GPL-2.0+
*/
#include <common.h>
#include <binman_sym.h>
#include <mapmem.h>
#include <spl.h>
#include <libfdt.h>

Expand Down Expand Up @@ -48,15 +50,24 @@ static int spl_ram_load_image(struct spl_image_info *spl_image,
load.read = spl_ram_load_read;
spl_load_simple_fit(spl_image, &load, 0, header);
} else {
ulong u_boot_pos = binman_sym(ulong, u_boot_any, pos);

debug("Legacy image\n");
/*
* Get the header. It will point to an address defined by
* handoff which will tell where the image located inside
* the flash. For now, it will temporary fixed to address
* pointed by U-Boot.
* the flash.
*/
header = (struct image_header *)
(CONFIG_SYS_TEXT_BASE - sizeof(struct image_header));
debug("u_boot_pos = %lx\n", u_boot_pos);
if (u_boot_pos == BINMAN_SYM_MISSING) {
/*
* No binman support or no information. For now, fix it
* to the address pointed to by U-Boot.
*/
u_boot_pos = CONFIG_SYS_TEXT_BASE -
sizeof(struct image_header);
}
header = (struct image_header *)map_sysmem(u_boot_pos, 0);

spl_parse_image_header(spl_image, header);
}
Expand Down
16 changes: 14 additions & 2 deletions doc/device-tree-bindings/regulator/regulator.txt
Expand Up @@ -2,7 +2,8 @@ Voltage/Current regulator

Binding:
The regulator devices don't use the "compatible" property. The binding is done
by the prefix of regulator node's name. Usually the pmic I/O driver will provide
by the prefix of regulator node's name, or, if this fails, by the prefix of the
regulator's "regulator-name" property. Usually the pmic I/O driver will provide
the array of 'struct pmic_child_info' with the prefixes and compatible drivers.
The bind is done by calling function: pmic_bind_childs().
Example drivers:
Expand All @@ -15,8 +16,19 @@ For the node name e.g.: "prefix[:alpha:]num { ... }":

Example the prefix "ldo" will pass for: "ldo1", "ldo@1", "ldoreg@1, ...

Binding by means of the node's name is preferred. However if the node names
would produce ambiguous prefixes (like "regulator@1" and "regualtor@11") and you
can't or do not want to change them then binding against the "regulator-name"
property is possible. The syntax for the prefix of the "regulator-name" property
is the same as the one for the regulator's node name.
Use case: a regulator named "regulator@1" to be bound to a driver named
"LDO_DRV" and a regulator named "regualator@11" to be bound to an other driver
named "BOOST_DRV". Using prefix "regualtor@1" for driver matching would load
the same driver for both regulators, hence the prefix is ambiguous.

Optional properties:
- regulator-name: a string, required by the regulator uclass
- regulator-name: a string, required by the regulator uclass, used for driver
binding if binding by node's name prefix fails
- regulator-min-microvolt: a minimum allowed Voltage value
- regulator-max-microvolt: a maximum allowed Voltage value
- regulator-min-microamp: a minimum allowed Current value
Expand Down
7 changes: 4 additions & 3 deletions drivers/block/blk-uclass.c
Expand Up @@ -10,6 +10,7 @@
#include <dm.h>
#include <dm/device-internal.h>
#include <dm/lists.h>
#include <dm/uclass-internal.h>

static const char *if_typename_str[IF_TYPE_COUNT] = {
[IF_TYPE_IDE] = "ide",
Expand Down Expand Up @@ -331,7 +332,7 @@ int blk_first_device(int if_type, struct udevice **devp)
struct blk_desc *desc;
int ret;

ret = uclass_first_device(UCLASS_BLK, devp);
ret = uclass_find_first_device(UCLASS_BLK, devp);
if (ret)
return ret;
if (!*devp)
Expand All @@ -340,7 +341,7 @@ int blk_first_device(int if_type, struct udevice **devp)
desc = dev_get_uclass_platdata(*devp);
if (desc->if_type == if_type)
return 0;
ret = uclass_next_device(devp);
ret = uclass_find_next_device(devp);
if (ret)
return ret;
} while (*devp);
Expand All @@ -356,7 +357,7 @@ int blk_next_device(struct udevice **devp)
desc = dev_get_uclass_platdata(*devp);
if_type = desc->if_type;
do {
ret = uclass_next_device(devp);
ret = uclass_find_next_device(devp);
if (ret)
return ret;
if (!*devp)
Expand Down
8 changes: 8 additions & 0 deletions drivers/power/pmic/Kconfig
Expand Up @@ -201,3 +201,11 @@ config POWER_MC34VR500
The MC34VR500 is used in conjunction with the FSL T1 and LS1 series
SoC. It provides 4 buck DC-DC convertors and 5 LDOs, and it is accessed
via an I2C interface.

config DM_PMIC_TPS65910
bool "Enable driver for Texas Instruments TPS65910 PMIC"
depends on DM_PMIC
---help---
The TPS65910 is a PMIC containing 3 buck DC-DC converters, one boost
DC-DC converter, 8 LDOs and a RTC. This driver binds the SMPS and LDO
pmic children.
1 change: 1 addition & 0 deletions drivers/power/pmic/Makefile
Expand Up @@ -19,6 +19,7 @@ obj-$(CONFIG_PMIC_RK8XX) += rk8xx.o
obj-$(CONFIG_PMIC_RN5T567) += rn5t567.o
obj-$(CONFIG_PMIC_TPS65090) += tps65090.o
obj-$(CONFIG_PMIC_S5M8767) += s5m8767.o
obj-$(CONFIG_DM_PMIC_TPS65910) += pmic_tps65910_dm.o
obj-$(CONFIG_$(SPL_)PMIC_PALMAS) += palmas.o
obj-$(CONFIG_$(SPL_)PMIC_LP873X) += lp873x.o
obj-$(CONFIG_$(SPL_)PMIC_LP87565) += lp87565.o
Expand Down
11 changes: 9 additions & 2 deletions drivers/power/pmic/pmic-uclass.c
Expand Up @@ -26,6 +26,7 @@ int pmic_bind_children(struct udevice *pmic, ofnode parent,
struct driver *drv;
struct udevice *child;
const char *node_name;
const char *reg_name;
int bind_count = 0;
ofnode node;
int prefix_len;
Expand All @@ -44,8 +45,14 @@ int pmic_bind_children(struct udevice *pmic, ofnode parent,
debug(" - compatible prefix: '%s'\n", info->prefix);

prefix_len = strlen(info->prefix);
if (strncmp(info->prefix, node_name, prefix_len))
continue;
if (strncmp(info->prefix, node_name, prefix_len)) {
reg_name = ofnode_read_string(node,
"regulator-name");
if (!reg_name)
continue;
if (strncmp(info->prefix, reg_name, prefix_len))
continue;
}

drv = lists_driver_lookup_name(info->driver);
if (!drv) {
Expand Down

0 comments on commit 15616a0

Please sign in to comment.