mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2025-08-31 03:21:27 +02:00
Merge patch series "Bug-fixes for a few boards"
Simon Glass <sjg@chromium.org> says: This series includes fixes to get some rockchip and nvidia boards working again. It also drops the broken Beaglebone Black config and provides a devicetree fix for coral (x86).
This commit is contained in:
commit
9efc554db8
@ -87,6 +87,10 @@ Generate a firmware revert empty capsule
|
|||||||
.BI "-o\fR,\fB --capoemflag "
|
.BI "-o\fR,\fB --capoemflag "
|
||||||
Capsule OEM flag, value between 0x0000 to 0xffff
|
Capsule OEM flag, value between 0x0000 to 0xffff
|
||||||
|
|
||||||
|
.TP
|
||||||
|
.BR -V ", " --version
|
||||||
|
Print version information and exit.
|
||||||
|
|
||||||
.TP
|
.TP
|
||||||
.BR -h ", " --help
|
.BR -h ", " --help
|
||||||
Print a help message
|
Print a help message
|
||||||
|
@ -13,6 +13,7 @@
|
|||||||
#include <log.h>
|
#include <log.h>
|
||||||
#include <ram.h>
|
#include <ram.h>
|
||||||
#include <regmap.h>
|
#include <regmap.h>
|
||||||
|
#include <spl.h>
|
||||||
#include <syscon.h>
|
#include <syscon.h>
|
||||||
#include <asm/arch-rockchip/clock.h>
|
#include <asm/arch-rockchip/clock.h>
|
||||||
#include <asm/arch-rockchip/cru.h>
|
#include <asm/arch-rockchip/cru.h>
|
||||||
@ -63,8 +64,6 @@ struct chan_info {
|
|||||||
};
|
};
|
||||||
|
|
||||||
struct dram_info {
|
struct dram_info {
|
||||||
#if defined(CONFIG_TPL_BUILD) || \
|
|
||||||
(!defined(CONFIG_TPL) && defined(CONFIG_SPL_BUILD))
|
|
||||||
u32 pwrup_srefresh_exit[2];
|
u32 pwrup_srefresh_exit[2];
|
||||||
struct chan_info chan[2];
|
struct chan_info chan[2];
|
||||||
struct clk ddr_clk;
|
struct clk ddr_clk;
|
||||||
@ -75,7 +74,6 @@ struct dram_info {
|
|||||||
struct rk3399_pmusgrf_regs *pmusgrf;
|
struct rk3399_pmusgrf_regs *pmusgrf;
|
||||||
struct rk3399_ddr_cic_regs *cic;
|
struct rk3399_ddr_cic_regs *cic;
|
||||||
const struct sdram_rk3399_ops *ops;
|
const struct sdram_rk3399_ops *ops;
|
||||||
#endif
|
|
||||||
struct ram_info info;
|
struct ram_info info;
|
||||||
struct rk3399_pmugrf_regs *pmugrf;
|
struct rk3399_pmugrf_regs *pmugrf;
|
||||||
};
|
};
|
||||||
@ -92,9 +90,6 @@ struct sdram_rk3399_ops {
|
|||||||
struct rk3399_sdram_params *params);
|
struct rk3399_sdram_params *params);
|
||||||
};
|
};
|
||||||
|
|
||||||
#if defined(CONFIG_TPL_BUILD) || \
|
|
||||||
(!defined(CONFIG_TPL) && defined(CONFIG_SPL_BUILD))
|
|
||||||
|
|
||||||
struct rockchip_dmc_plat {
|
struct rockchip_dmc_plat {
|
||||||
#if CONFIG_IS_ENABLED(OF_PLATDATA)
|
#if CONFIG_IS_ENABLED(OF_PLATDATA)
|
||||||
struct dtd_rockchip_rk3399_dmc dtplat;
|
struct dtd_rockchip_rk3399_dmc dtplat;
|
||||||
@ -191,6 +186,19 @@ struct io_setting {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* phase_sdram_init() - Check if this is the phase where SDRAM init happens
|
||||||
|
*
|
||||||
|
* Returns: true to do SDRAM init in this phase, false to not
|
||||||
|
*/
|
||||||
|
static bool phase_sdram_init(void)
|
||||||
|
{
|
||||||
|
return spl_phase() == PHASE_TPL ||
|
||||||
|
(!IS_ENABLED(CONFIG_TPL) &&
|
||||||
|
!IS_ENABLED(CONFIG_ROCKCHIP_EXTERNAL_TPL) &&
|
||||||
|
!spl_in_proper());
|
||||||
|
}
|
||||||
|
|
||||||
static struct io_setting *
|
static struct io_setting *
|
||||||
lpddr4_get_io_settings(const struct rk3399_sdram_params *params, u32 mr5)
|
lpddr4_get_io_settings(const struct rk3399_sdram_params *params, u32 mr5)
|
||||||
{
|
{
|
||||||
@ -3021,12 +3029,13 @@ static int sdram_init(struct dram_info *dram,
|
|||||||
|
|
||||||
static int rk3399_dmc_of_to_plat(struct udevice *dev)
|
static int rk3399_dmc_of_to_plat(struct udevice *dev)
|
||||||
{
|
{
|
||||||
struct rockchip_dmc_plat *plat = dev_get_plat(dev);
|
struct rockchip_dmc_plat *plat;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
if (!CONFIG_IS_ENABLED(OF_REAL))
|
if (!CONFIG_IS_ENABLED(OF_REAL) || !phase_sdram_init())
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
plat = dev_get_plat(dev);
|
||||||
ret = dev_read_u32_array(dev, "rockchip,sdram-params",
|
ret = dev_read_u32_array(dev, "rockchip,sdram-params",
|
||||||
(u32 *)&plat->sdram_params,
|
(u32 *)&plat->sdram_params,
|
||||||
sizeof(plat->sdram_params) / sizeof(u32));
|
sizeof(plat->sdram_params) / sizeof(u32));
|
||||||
@ -3093,7 +3102,6 @@ static int rk3399_dmc_init(struct udevice *dev)
|
|||||||
priv->cic = syscon_get_first_range(ROCKCHIP_SYSCON_CIC);
|
priv->cic = syscon_get_first_range(ROCKCHIP_SYSCON_CIC);
|
||||||
priv->grf = syscon_get_first_range(ROCKCHIP_SYSCON_GRF);
|
priv->grf = syscon_get_first_range(ROCKCHIP_SYSCON_GRF);
|
||||||
priv->pmu = syscon_get_first_range(ROCKCHIP_SYSCON_PMU);
|
priv->pmu = syscon_get_first_range(ROCKCHIP_SYSCON_PMU);
|
||||||
priv->pmugrf = syscon_get_first_range(ROCKCHIP_SYSCON_PMUGRF);
|
|
||||||
priv->pmusgrf = syscon_get_first_range(ROCKCHIP_SYSCON_PMUSGRF);
|
priv->pmusgrf = syscon_get_first_range(ROCKCHIP_SYSCON_PMUSGRF);
|
||||||
priv->pmucru = rockchip_get_pmucru();
|
priv->pmucru = rockchip_get_pmucru();
|
||||||
priv->cru = rockchip_get_cru();
|
priv->cru = rockchip_get_cru();
|
||||||
@ -3138,23 +3146,26 @@ static int rk3399_dmc_init(struct udevice *dev)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
static int rk3399_dmc_probe(struct udevice *dev)
|
static int rk3399_dmc_probe(struct udevice *dev)
|
||||||
{
|
{
|
||||||
#if defined(CONFIG_TPL_BUILD) || \
|
|
||||||
(!defined(CONFIG_TPL) && defined(CONFIG_SPL_BUILD))
|
|
||||||
if (rk3399_dmc_init(dev))
|
|
||||||
return 0;
|
|
||||||
#else
|
|
||||||
struct dram_info *priv = dev_get_priv(dev);
|
struct dram_info *priv = dev_get_priv(dev);
|
||||||
|
|
||||||
priv->pmugrf = syscon_get_first_range(ROCKCHIP_SYSCON_PMUGRF);
|
priv->pmugrf = syscon_get_first_range(ROCKCHIP_SYSCON_PMUGRF);
|
||||||
debug("%s: pmugrf = %p\n", __func__, priv->pmugrf);
|
debug("%s: pmugrf = %p\n", __func__, priv->pmugrf);
|
||||||
|
if (phase_sdram_init() && rk3399_dmc_init(dev))
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* There is no point in checking the SDRAM size in TPL as it is not
|
||||||
|
* used, so avoid the code size increment.
|
||||||
|
*/
|
||||||
|
if (!IS_ENABLED(CONFIG_TPL_BUILD)) {
|
||||||
priv->info.base = CFG_SYS_SDRAM_BASE;
|
priv->info.base = CFG_SYS_SDRAM_BASE;
|
||||||
priv->info.size =
|
priv->info.size = rockchip_sdram_size(
|
||||||
rockchip_sdram_size((phys_addr_t)&priv->pmugrf->os_reg2);
|
(phys_addr_t)&priv->pmugrf->os_reg2);
|
||||||
#endif
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3181,10 +3192,7 @@ U_BOOT_DRIVER(dmc_rk3399) = {
|
|||||||
.id = UCLASS_RAM,
|
.id = UCLASS_RAM,
|
||||||
.of_match = rk3399_dmc_ids,
|
.of_match = rk3399_dmc_ids,
|
||||||
.ops = &rk3399_dmc_ops,
|
.ops = &rk3399_dmc_ops,
|
||||||
#if defined(CONFIG_TPL_BUILD) || \
|
|
||||||
(!defined(CONFIG_TPL) && defined(CONFIG_SPL_BUILD))
|
|
||||||
.of_to_plat = rk3399_dmc_of_to_plat,
|
.of_to_plat = rk3399_dmc_of_to_plat,
|
||||||
#endif
|
|
||||||
.probe = rk3399_dmc_probe,
|
.probe = rk3399_dmc_probe,
|
||||||
.priv_auto = sizeof(struct dram_info),
|
.priv_auto = sizeof(struct dram_info),
|
||||||
#if defined(CONFIG_TPL_BUILD) || \
|
#if defined(CONFIG_TPL_BUILD) || \
|
||||||
|
12
lib/fdtdec.c
12
lib/fdtdec.c
@ -1668,8 +1668,16 @@ int fdtdec_setup(void)
|
|||||||
{
|
{
|
||||||
int ret = -ENOENT;
|
int ret = -ENOENT;
|
||||||
|
|
||||||
/* If allowing a bloblist, check that first */
|
/*
|
||||||
if (CONFIG_IS_ENABLED(BLOBLIST)) {
|
* If allowing a bloblist, check that first. There was discussion about
|
||||||
|
* adding an OF_BLOBLIST Kconfig, but this was rejected.
|
||||||
|
*
|
||||||
|
* The necessary test is whether the previous phase passed a bloblist,
|
||||||
|
* not whether this phase creates one.
|
||||||
|
*/
|
||||||
|
if (CONFIG_IS_ENABLED(BLOBLIST) &&
|
||||||
|
(spl_prev_phase() != PHASE_TPL ||
|
||||||
|
!IS_ENABLED(CONFIG_TPL_BLOBLIST))) {
|
||||||
ret = bloblist_maybe_init();
|
ret = bloblist_maybe_init();
|
||||||
if (!ret) {
|
if (!ret) {
|
||||||
gd->fdt_blob = bloblist_find(BLOBLISTT_CONTROL_FDT, 0);
|
gd->fdt_blob = bloblist_find(BLOBLISTT_CONTROL_FDT, 0);
|
||||||
|
@ -33,7 +33,8 @@ class Bintoolmkeficapsule(bintool.Bintool):
|
|||||||
commandline, or through a config file.
|
commandline, or through a config file.
|
||||||
"""
|
"""
|
||||||
def __init__(self, name):
|
def __init__(self, name):
|
||||||
super().__init__(name, 'mkeficapsule tool for generating capsules')
|
super().__init__(name, 'mkeficapsule tool for generating capsules',
|
||||||
|
r'mkeficapsule version (.*)')
|
||||||
|
|
||||||
def generate_capsule(self, image_index, image_guid, hardware_instance,
|
def generate_capsule(self, image_index, image_guid, hardware_instance,
|
||||||
payload, output_fname, priv_key, pub_key,
|
payload, output_fname, priv_key, pub_key,
|
||||||
|
@ -148,8 +148,11 @@ class Entry_efi_capsule(Entry_section):
|
|||||||
self.fw_version,
|
self.fw_version,
|
||||||
self.oem_flags)
|
self.oem_flags)
|
||||||
if ret is not None:
|
if ret is not None:
|
||||||
os.remove(payload)
|
|
||||||
return tools.read_file(capsule_fname)
|
return tools.read_file(capsule_fname)
|
||||||
|
else:
|
||||||
|
# Bintool is missing; just use the input data as the output
|
||||||
|
self.record_missing_bintool(self.mkeficapsule)
|
||||||
|
return data
|
||||||
|
|
||||||
def AddBintools(self, btools):
|
def AddBintools(self, btools):
|
||||||
self.mkeficapsule = self.AddBintool(btools, 'mkeficapsule')
|
self.mkeficapsule = self.AddBintool(btools, 'mkeficapsule')
|
||||||
|
@ -21,6 +21,8 @@
|
|||||||
#include <gnutls/pkcs7.h>
|
#include <gnutls/pkcs7.h>
|
||||||
#include <gnutls/abstract.h>
|
#include <gnutls/abstract.h>
|
||||||
|
|
||||||
|
#include <version.h>
|
||||||
|
|
||||||
#include "eficapsule.h"
|
#include "eficapsule.h"
|
||||||
|
|
||||||
static const char *tool_name = "mkeficapsule";
|
static const char *tool_name = "mkeficapsule";
|
||||||
@ -28,7 +30,7 @@ static const char *tool_name = "mkeficapsule";
|
|||||||
efi_guid_t efi_guid_fm_capsule = EFI_FIRMWARE_MANAGEMENT_CAPSULE_ID_GUID;
|
efi_guid_t efi_guid_fm_capsule = EFI_FIRMWARE_MANAGEMENT_CAPSULE_ID_GUID;
|
||||||
efi_guid_t efi_guid_cert_type_pkcs7 = EFI_CERT_TYPE_PKCS7_GUID;
|
efi_guid_t efi_guid_cert_type_pkcs7 = EFI_CERT_TYPE_PKCS7_GUID;
|
||||||
|
|
||||||
static const char *opts_short = "g:i:I:v:p:c:m:o:dhARD";
|
static const char *opts_short = "g:i:I:v:p:c:m:o:dhARDV";
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
CAPSULE_NORMAL_BLOB = 0,
|
CAPSULE_NORMAL_BLOB = 0,
|
||||||
@ -70,6 +72,7 @@ static void print_usage(void)
|
|||||||
"\t-R, --fw-revert firmware revert capsule, takes no GUID, no image blob\n"
|
"\t-R, --fw-revert firmware revert capsule, takes no GUID, no image blob\n"
|
||||||
"\t-o, --capoemflag Capsule OEM Flag, an integer between 0x0000 and 0xffff\n"
|
"\t-o, --capoemflag Capsule OEM Flag, an integer between 0x0000 and 0xffff\n"
|
||||||
"\t-D, --dump-capsule dump the contents of the capsule headers\n"
|
"\t-D, --dump-capsule dump the contents of the capsule headers\n"
|
||||||
|
"\t-V, --version show version number\n"
|
||||||
"\t-h, --help print a help message\n",
|
"\t-h, --help print a help message\n",
|
||||||
tool_name);
|
tool_name);
|
||||||
}
|
}
|
||||||
@ -969,9 +972,12 @@ int main(int argc, char **argv)
|
|||||||
case 'D':
|
case 'D':
|
||||||
capsule_dump = true;
|
capsule_dump = true;
|
||||||
break;
|
break;
|
||||||
|
case 'V':
|
||||||
|
printf("mkeficapsule version %s\n", PLAIN_VERSION);
|
||||||
|
exit(EXIT_SUCCESS);
|
||||||
default:
|
default:
|
||||||
print_usage();
|
print_usage();
|
||||||
exit(EXIT_SUCCESS);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user