Commit 0e899076 authored by Simon Glass's avatar Simon Glass
Browse files

cros things

parent d2a34d48
// SPDX-License-Identifier: GPL-2.0+
/*
* Read/write flash map for a 16MB SPI flash
*
* Copyright 2018 Google LLC
*/
&chromeos {
/*
* Note: rw-a and rw-b are used by auto-update. They must be
* the same size, and must include the vblock, boot and
* firmware-id parts within them. There is no check on this
* at present so you need to manually verify that it is
* correct.
*
* The rw-b section must not overlap/include the rw-vpd
* section.
*/
/* ---- Section: Rewritable slot A ---- */
read-write-a {
u-boot,dm-pre-reloc;
type = "section";
offset = <0xffa00000>;
label-prefix = "rw-a-";
block-offset = /bits/ 64 <0x00004400>;
vblock {
align = <0x1000>;
align-size = <0x1000>;
u-boot,dm-pre-reloc;
/*
* Alignment: 4k (for updating) and must be in
* start of each RW_SECTION
*/
size = <0x2000>;
content = <&rw_a_spl &rw_a_dtb>;
keyblock = "firmware.keyblock";
signprivate = "firmware_data_key.vbprivk";
version = <1>;
kernelkey = "kernel_subkey.vbpubk";
preamble-flags = <0>;
};
rw_a_spl: spl {
u-boot,dm-pre-reloc;
type = "u-boot-spl-nodtb";
};
rw_a_dtb: spl-dtb {
u-boot,dm-pre-reloc;
type = "u-boot-spl-dtb";
};
boot {
u-boot,dm-pre-reloc;
type = "u-boot-nodtb";
compress = "lz4";
hash {
u-boot,dm-pre-reloc;
algo = "sha256";
};
};
cros-ec-rw {
u-boot,dm-pre-reloc;
size = <0xf000>;
hash {
u-boot,dm-pre-reloc;
algo = "sha256";
};
};
firmware-id {
/* Alignment: no requirement */
size = <0x100>;
type = "text";
text-label = "frid";
};
};
/* ---- Section: Rewritable slot B ---- */
read-write-b {
u-boot,dm-pre-reloc;
type = "section";
offset = <0xffb00000>;
label-prefix = "rw-b-";
block-offset = /bits/ 64 <0x00084400>;
vblock {
align = <0x1000>;
align-size = <0x1000>;
u-boot,dm-pre-reloc;
/*
* Alignment: 4k (for updating) and must be in
* start of each RW_SECTION
*/
size = <0x2000>;
content = <&rw_b_spl &rw_b_dtb>;
keyblock = "firmware.keyblock";
signprivate = "firmware_data_key.vbprivk";
version = <1>;
kernelkey = "kernel_subkey.vbpubk";
preamble-flags = <0>;
};
rw_b_spl: spl {
u-boot,dm-pre-reloc;
type = "u-boot-spl-nodtb";
};
rw_b_dtb: spl-dtb {
u-boot,dm-pre-reloc;
type = "u-boot-spl-dtb";
};
boot {
u-boot,dm-pre-reloc;
type = "u-boot-nodtb";
compress = "lz4";
hash {
u-boot,dm-pre-reloc;
algo = "sha256";
};
};
cros-ec-rw {
u-boot,dm-pre-reloc;
size = <0xf000>;
hash {
u-boot,dm-pre-reloc;
algo = "sha256";
};
};
firmware-id {
/* Alignment: no requirement */
size = <0x100>;
type = "text";
text-label = "frid";
};
};
/* ---- Section: Rewritable VPD 32 KB ---- */
read-write-vpd {
type = "section";
rw-vpd {
/* Alignment: 4k (for updating) */
size = <0x00008000>;
type = "fill";
fill-value = [ff];
};
};
/* ---- Section: Rewritable shared 16 KB---- */
shared-section {
type = "section";
/* Anything in this range may be updated in recovery */
size = <0x4000>;
shared-data {
label = "shared-data";
/*
* Alignment: 4k (for random read/write).
* RW firmware can put calibration data here
*/
size = <0x00004000>;
type = "fill";
fill-value = [00];
};
};
/* ---- Section: Rewritable private 16 KB---- */
rw-private {
type = "section";
size = <0x00014000>;
rw-environment {
label = "rw-environment";
/*
* Alignment: 4k, and must occupy bottom of
* U-Boot firmware -- check CONFIG_ENV_OFFSET
*/
size = <0x00004000>;
/*
* We could put the dev environment here, but
* U-Boot has a default built in. Devs can
* 'saveenv' to set this up.
*/
type = "fill";
fill-value = [00];
};
recovery-mrc-cache {
size = <0x10000>;
type = "fill";
fill-value = [ff];
};
};
};
......@@ -11,5 +11,6 @@ obj-$(CONFIG_CHROMEOS) += jump.o
endif
obj-$(CONFIG_CHROMEOS) += memwipe.o
obj-$(CONFIG_CHROMEOS) += resource.o
obj-$(CONFIG_CHROMEOS) += vboot_acpi.o
obj-$(CONFIG_CHROMEOS) += vboot_internal.o
obj-$(CONFIG_CHROMEOS) += vboot-ec-uclass.o
......@@ -285,20 +285,20 @@ int cros_ofnode_memory(const char *name, struct fdt_memory *config)
static void dump_fmap_entry(const char *path, struct fmap_entry *entry)
{
log_debug("%-20s %08x:%08x\n", path, entry->offset, entry->length);
printf("%-20s %08x:%08x\n", path, entry->offset, entry->length);
}
static void dump_fmap_firmware_entry(const char *name,
struct fmap_firmware_entry *entry)
{
log_debug("%s\n", name);
printf("%s\n", name);
dump_fmap_entry("all", &entry->all);
dump_fmap_entry("spl", &entry->spl);
dump_fmap_entry("boot", &entry->boot);
dump_fmap_entry("vblock", &entry->vblock);
dump_fmap_entry("firmware_id", &entry->firmware_id);
log_debug("%-20s %08llx\n", "block_offset",
(long long)entry->block_offset);
printf("%-20s %08llx\n", "block_offset",
(long long)entry->block_offset);
}
void cros_ofnode_dump_fmap(struct cros_fmap *config)
......
// SPDX-License-Identifier: GPL-2.0+
/*
* Vboot ACPI support for x86 platforms
*
* Copyright 2019 Google LLC
*/
#include <common.h>
#include <cros/vboot.h>
int vboot_update_acpi(struct vboot_info *vboot)
{
return 0;
}
......@@ -107,8 +107,8 @@ static int common_params_init(struct vboot_info *vboot, bool clear_shared_data)
if (clear_shared_data)
memset(cparams->shared_data_blob, '\0',
cparams->shared_data_size);
log_info("Found shared_data_blob at %x, size %d\n",
map_to_sysmem(cparams->shared_data_blob),
log_info("Found shared_data_blob at %lx, size %d\n",
(ulong)map_to_sysmem(cparams->shared_data_blob),
cparams->shared_data_size);
return 0;
......
......@@ -32,7 +32,7 @@ int vboot_ver1_vbinit(struct vboot_info *vboot)
return ret;
}
log_warning("Reboot reqested (%x)\n", ret);
log_warning("Reboot requested (%x)\n", ret);
return VBERROR_REBOOT_REQUIRED;
}
......
......@@ -18,7 +18,7 @@ int vboot_ver3_try_fw(struct vboot_info *vboot)
ret = vb2api_fw_phase3(vboot_get_ctx(vboot));
bootstage_mark(BOOTSTAGE_VBOOT_END_VERIFY_SLOT);
if (ret) {
log_info("Reboot reqested (%x)\n", ret);
log_info("Reboot requested (%x)\n", ret);
return VBERROR_REBOOT_REQUIRED;
}
......
......@@ -3,12 +3,11 @@
* Implementation of APIs provided by firmware and exported to vboot_reference.
* They includes debug output, memory allocation, timer and delay, etc.
*
* TODO(sjg@chromium.org): Convert to use DM for sound
*
* Copyright 2018 Google LLC
*/
#include <common.h>
#include <dm.h>
#include <sound.h>
#include <sysreset.h>
#include <cros/cros_common.h>
......@@ -58,8 +57,13 @@ void VbExSleepMs(u32 msec)
VbError_t VbExBeep(u32 msec, u32 frequency)
{
#if defined CONFIG_SOUND
if (sound_init(gd->fdt_blob)) {
struct udevice *dev;
int ret;
ret = uclass_first_device_err(UCLASS_SOUND, &dev);
if (!ret)
ret = sound_setup(dev);
if (ret) {
log_debug("Failed to initialise sound.\n");
return VBERROR_NO_SOUND;
}
......@@ -69,7 +73,7 @@ VbError_t VbExBeep(u32 msec, u32 frequency)
return VBERROR_NO_BACKGROUND_SOUND;
if (frequency) {
if (sound_play(msec, frequency)) {
if (sound_beep(dev, msec, frequency)) {
log_debug("Failed to play beep.\n");
return VBERROR_NO_SOUND;
}
......@@ -78,11 +82,6 @@ VbError_t VbExBeep(u32 msec, u32 frequency)
}
return VBERROR_SUCCESS;
#else
VbExSleepMs(msec);
printf("Beep!\n");
return VBERROR_NO_SOUND;
#endif
}
u64 VbExGetTimer(void)
......
......@@ -19,8 +19,8 @@ int vboot_alloc(struct vboot_info **vbootp)
{
gd->vboot = malloc(sizeof(struct vboot_info));
if (!gd->vboot) {
log_err("Cannot allocate vboot %lx\n",
sizeof(struct vboot_info));
log_err("Cannot allocate vboot %x\n",
(uint)sizeof(struct vboot_info));
return -ENOMEM;
}
memset(gd->vboot, '\0', sizeof(struct vboot_info));
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment