Patrick Georgi has submitted this change. ( https://review.coreboot.org/c/coreboot/+/52083 )
Change subject: cbfs: Simplify cbfs_load_and_decompress() and stop exporting it
......................................................................
cbfs: Simplify cbfs_load_and_decompress() and stop exporting it
With the last external user to cbfs_load_and_decompress() gone, we can
stop exporting this function to the rest of coreboot and make it local
to cbfs.c. Also remove a couple of arguments that no longer really make
a difference and fold the stage-specific code for in-place LZ4
decompression into cbfs_prog_stage_load().
Signed-off-by: Julius Werner <jwerner(a)chromium.org>
Change-Id: I4b459650a28e020c4342a66090f55264fbd26363
Reviewed-on: https://review.coreboot.org/c/coreboot/+/52083
Tested-by: build bot (Jenkins) <no-reply(a)coreboot.org>
Reviewed-by: Aaron Durbin <adurbin(a)chromium.org>
Reviewed-by: Furquan Shaikh <furquan(a)google.com>
---
M src/include/cbfs.h
M src/lib/cbfs.c
2 files changed, 21 insertions(+), 45 deletions(-)
Approvals:
build bot (Jenkins): Verified
Aaron Durbin: Looks good to me, approved
Furquan Shaikh: Looks good to me, approved
diff --git a/src/include/cbfs.h b/src/include/cbfs.h
index 37bac30..9ed5233 100644
--- a/src/include/cbfs.h
+++ b/src/include/cbfs.h
@@ -165,13 +165,6 @@
/* Return mapping of option ROM with revision number. Returns NULL on error. */
void *cbfs_boot_map_optionrom_revision(uint16_t vendor, uint16_t device, uint8_t rev);
-/* Load |in_size| bytes from |rdev| at |offset| to the |buffer_size| bytes large |buffer|,
- decompressing it according to |compression| in the process. Returns the decompressed file
- size, or 0 on error. LZMA files will be mapped for decompression. LZ4 files will be
- decompressed in-place with the buffer size requirements outlined in compression.h. */
-size_t cbfs_load_and_decompress(const struct region_device *rdev, size_t offset,
- size_t in_size, void *buffer, size_t buffer_size, uint32_t compression);
-
/**********************************************************************************************
* INTERNAL HELPERS FOR INLINES, DO NOT USE. *
diff --git a/src/lib/cbfs.c b/src/lib/cbfs.c
index 65bb721..9135b2f 100644
--- a/src/lib/cbfs.c
+++ b/src/lib/cbfs.c
@@ -186,19 +186,20 @@
return true;
}
-size_t cbfs_load_and_decompress(const struct region_device *rdev, size_t offset, size_t in_size,
- void *buffer, size_t buffer_size, uint32_t compression)
+static size_t cbfs_load_and_decompress(const struct region_device *rdev,
+ void *buffer, size_t buffer_size, uint32_t compression)
{
+ size_t in_size = region_device_sz(rdev);
size_t out_size;
void *map;
- DEBUG("Decompressing %zu bytes to %p with algo %d\n", buffer_size, buffer, compression);
+ DEBUG("Decompressing %zu bytes to %p with algo %d\n", in_size, buffer, compression);
switch (compression) {
case CBFS_COMPRESS_NONE:
if (buffer_size < in_size)
return 0;
- if (rdev_readat(rdev, buffer, offset, in_size) != in_size)
+ if (rdev_readat(rdev, buffer, 0, in_size) != in_size)
return 0;
return in_size;
@@ -206,9 +207,9 @@
if (!cbfs_lz4_enabled())
return 0;
- /* cbfs_stage_load_and_decompress() takes care of in-place LZ4 decompression by
+ /* cbfs_prog_stage_load() takes care of in-place LZ4 decompression by
setting up the rdev to be in memory. */
- map = rdev_mmap(rdev, offset, in_size);
+ map = rdev_mmap_full(rdev);
if (map == NULL)
return 0;
@@ -223,7 +224,7 @@
case CBFS_COMPRESS_LZMA:
if (!cbfs_lzma_enabled())
return 0;
- map = rdev_mmap(rdev, offset, in_size);
+ map = rdev_mmap_full(rdev);
if (map == NULL)
return 0;
@@ -241,33 +242,6 @@
}
}
-static size_t cbfs_stage_load_and_decompress(const struct region_device *rdev, size_t offset,
- size_t in_size, void *buffer, size_t buffer_size, uint32_t compression)
-{
- struct region_device rdev_src;
-
- if (compression == CBFS_COMPRESS_LZ4) {
- if (!cbfs_lz4_enabled())
- return 0;
- /* Load the compressed image to the end of the available memory area for
- in-place decompression. It is the responsibility of the caller to ensure that
- buffer_size is large enough (see compression.h, guaranteed by cbfstool for
- stages). */
- void *compr_start = buffer + buffer_size - in_size;
- if (rdev_readat(rdev, compr_start, offset, in_size) != in_size)
- return 0;
- /* Create a region device backed by memory. */
- rdev_chain(&rdev_src, &addrspace_32bit.rdev, (uintptr_t)compr_start, in_size);
-
- return cbfs_load_and_decompress(&rdev_src, 0, in_size, buffer, buffer_size,
- compression);
- }
-
- /* All other algorithms can use the generic implementation. */
- return cbfs_load_and_decompress(rdev, offset, in_size, buffer, buffer_size,
- compression);
-}
-
static inline int tohex4(unsigned int c)
{
return (c <= 9) ? (c + '0') : (c - 10 + 'a');
@@ -361,8 +335,7 @@
return NULL;
}
- size = cbfs_load_and_decompress(&rdev, 0, region_device_sz(&rdev),
- loc, size, compression);
+ size = cbfs_load_and_decompress(&rdev, loc, size, compression);
if (!size)
return NULL;
@@ -421,8 +394,18 @@
return CB_SUCCESS;
}
- size_t fsize = cbfs_stage_load_and_decompress(&rdev, 0, region_device_sz(&rdev),
- prog_start(pstage), prog_size(pstage), compression);
+ /* LZ4 stages can be decompressed in-place to save mapping scratch space. Load the
+ compressed data to the end of the buffer and point &rdev to that memory location. */
+ if (cbfs_lz4_enabled() && compression == CBFS_COMPRESS_LZ4) {
+ size_t in_size = region_device_sz(&rdev);
+ void *compr_start = prog_start(pstage) + prog_size(pstage) - in_size;
+ if (rdev_readat(&rdev, compr_start, 0, in_size) != in_size)
+ return CB_ERR;
+ rdev_chain(&rdev, &addrspace_32bit.rdev, (uintptr_t)compr_start, in_size);
+ }
+
+ size_t fsize = cbfs_load_and_decompress(&rdev, prog_start(pstage), prog_size(pstage),
+ compression);
if (!fsize)
return CB_ERR;
--
To view, visit https://review.coreboot.org/c/coreboot/+/52083
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I4b459650a28e020c4342a66090f55264fbd26363
Gerrit-Change-Number: 52083
Gerrit-PatchSet: 3
Gerrit-Owner: Julius Werner <jwerner(a)chromium.org>
Gerrit-Reviewer: Aaron Durbin <adurbin(a)chromium.org>
Gerrit-Reviewer: Furquan Shaikh <furquan(a)google.com>
Gerrit-Reviewer: Patrick Georgi <pgeorgi(a)google.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-MessageType: merged
Frank Wu has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/52127 )
Change subject: mb/google/zork/vilboz: Update the ACPI name of ALC1015 AMP
......................................................................
mb/google/zork/vilboz: Update the ACPI name of ALC1015 AMP
Update the ACPI name from AMDP1015 to 1002105 based on b/177971830#180.
BUG=b:177971830
BRANCH=firmware-zork-13434.B
TEST=emerge-zork coreboot chromeos-bootimage, then verify with ALC1015 AMP
Signed-off-by: Frank Wu <frank_wu(a)compal.corp-partner.google.com>
Change-Id: Id8f378ad6f3328d7db949ecdb609a2f16acd3884
---
M src/mainboard/google/zork/variants/vilboz/overridetree.cb
1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/27/52127/1
diff --git a/src/mainboard/google/zork/variants/vilboz/overridetree.cb b/src/mainboard/google/zork/variants/vilboz/overridetree.cb
index 3f5bfc3..93fe607 100644
--- a/src/mainboard/google/zork/variants/vilboz/overridetree.cb
+++ b/src/mainboard/google/zork/variants/vilboz/overridetree.cb
@@ -172,7 +172,7 @@
end
end
chip drivers/amd/i2s_machine_dev
- register "hid" = ""AMDP1015""
+ register "hid" = ""10021015""
# DMIC select GPIO for ACP machine device
# This GPIO is used to select DMIC0 or DMIC1 by the
# kernel driver. It does not really have a polarity
--
To view, visit https://review.coreboot.org/c/coreboot/+/52127
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Id8f378ad6f3328d7db949ecdb609a2f16acd3884
Gerrit-Change-Number: 52127
Gerrit-PatchSet: 1
Gerrit-Owner: Frank Wu <frank_wu(a)compal.corp-partner.google.com>
Gerrit-MessageType: newchange
Attention is currently required from: Patrick Rudolph.
Angel Pons has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/52103 )
Change subject: soc/intel/cannonlake: Drop unused `SataDevSlpRstConfig`
......................................................................
Patch Set 2: Code-Review-1
(1 comment)
File src/soc/intel/cannonlake/chip.h:
https://review.coreboot.org/c/coreboot/+/52103/comment/0ef42007_f56af429
PS2, Line 121: } SataDevSlpRstConfig;
> grep pls
Oh wait, the issue is that the enum fields are actually used for `SataPortsDevSlpResetConfig`
--
To view, visit https://review.coreboot.org/c/coreboot/+/52103
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Iff3e896463575295c489032e04955bb5a7ba6355
Gerrit-Change-Number: 52103
Gerrit-PatchSet: 2
Gerrit-Owner: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Reviewer: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Reviewer: Michael Niewöhner <foss(a)mniewoehner.de>
Gerrit-Reviewer: Patrick Rudolph <siro(a)das-labor.org>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Attention: Patrick Rudolph <siro(a)das-labor.org>
Gerrit-Comment-Date: Tue, 06 Apr 2021 07:23:45 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Comment-In-Reply-To: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-MessageType: comment
Attention is currently required from: Jason Glenesk, Nico Huber, Raul Rangel, Marshall Dawson, Kyösti Mälkki, Felix Held.
Patrick Georgi has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/51887 )
Change subject: [RFC] Rename do_printk() --> printk()
......................................................................
Patch Set 2: Code-Review+1
(2 comments)
Commit Message:
https://review.coreboot.org/c/coreboot/+/51887/comment/92e32010_dfa5c6bc
PS2, Line 9: The indirection seems unnecessary. The macros throw features like
The indirection has historical roots: back in the day it was possible to compile out log levels and that was done in the printk (et al) macros, either forwarding to do_printk or removing the statement entirely. Since we now keep all strings all the time, the indirection can go away.
Patchset:
PS2:
Maybe drop the "[RFC]", but then it can go in ;-)
--
To view, visit https://review.coreboot.org/c/coreboot/+/51887
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Ie4eab935a367b5ad6b38225c4973d41d9f70ef10
Gerrit-Change-Number: 51887
Gerrit-PatchSet: 2
Gerrit-Owner: Nico Huber <nico.h(a)gmx.de>
Gerrit-Reviewer: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Reviewer: Arthur Heymans <arthur(a)aheymans.xyz>
Gerrit-Reviewer: Felix Held <felix-coreboot(a)felixheld.de>
Gerrit-Reviewer: Jakub Czapiga <jacz(a)semihalf.com>
Gerrit-Reviewer: Jason Glenesk <jason.glenesk(a)gmail.com>
Gerrit-Reviewer: Julius Werner <jwerner(a)chromium.org>
Gerrit-Reviewer: Kyösti Mälkki <kyosti.malkki(a)gmail.com>
Gerrit-Reviewer: Marshall Dawson <marshalldawson3rd(a)gmail.com>
Gerrit-Reviewer: Patrick Georgi <pgeorgi(a)google.com>
Gerrit-Reviewer: Raul Rangel <rrangel(a)chromium.org>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Paul Menzel <paulepanter(a)users.sourceforge.net>
Gerrit-Attention: Jason Glenesk <jason.glenesk(a)gmail.com>
Gerrit-Attention: Nico Huber <nico.h(a)gmx.de>
Gerrit-Attention: Raul Rangel <rrangel(a)chromium.org>
Gerrit-Attention: Marshall Dawson <marshalldawson3rd(a)gmail.com>
Gerrit-Attention: Kyösti Mälkki <kyosti.malkki(a)gmail.com>
Gerrit-Attention: Felix Held <felix-coreboot(a)felixheld.de>
Gerrit-Comment-Date: Tue, 06 Apr 2021 07:15:57 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
Patrick Georgi has submitted this change. ( https://review.coreboot.org/c/coreboot/+/51435 )
Change subject: mb/google/kukui: Add flag for MIPI_DSI_MODE_LINE_END ANX7625
......................................................................
mb/google/kukui: Add flag for MIPI_DSI_MODE_LINE_END ANX7625
Config ANX7625 line data end same time on all line.
BUG=b:173603645
BRANCH=kukui
TEST=Display is normal on Kukui
Signed-off-by: Jitao Shi <jitao.shi(a)mediatek.com>
Change-Id: Ia1dc217138a98a79ef2f31225b52ba2b1aaf8672
Reviewed-on: https://review.coreboot.org/c/coreboot/+/51435
Tested-by: build bot (Jenkins) <no-reply(a)coreboot.org>
Reviewed-by: Yu-Ping Wu <yupingso(a)google.com>
Reviewed-by: Hung-Te Lin <hungte(a)chromium.org>
---
M src/mainboard/google/kukui/mainboard.c
1 file changed, 2 insertions(+), 1 deletion(-)
Approvals:
build bot (Jenkins): Verified
Hung-Te Lin: Looks good to me, approved
Yu-Ping Wu: Looks good to me, but someone else must approve
diff --git a/src/mainboard/google/kukui/mainboard.c b/src/mainboard/google/kukui/mainboard.c
index 893d94d..4affa16 100644
--- a/src/mainboard/google/kukui/mainboard.c
+++ b/src/mainboard/google/kukui/mainboard.c
@@ -162,7 +162,8 @@
MIPI_DSI_MODE_VIDEO_SYNC_PULSE |
MIPI_DSI_MODE_LPM);
if (CONFIG(DRIVER_ANALOGIX_ANX7625))
- mipi_dsi_flags |= MIPI_DSI_MODE_EOT_PACKET;
+ mipi_dsi_flags |= MIPI_DSI_MODE_EOT_PACKET |
+ MIPI_DSI_MODE_LINE_END;
if (mtk_dsi_init(mipi_dsi_flags, MIPI_DSI_FMT_RGB888, 4, edid,
panel->s->init) < 0) {
printk(BIOS_ERR, "%s: Failed in DSI init.\n", __func__);
--
To view, visit https://review.coreboot.org/c/coreboot/+/51435
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Ia1dc217138a98a79ef2f31225b52ba2b1aaf8672
Gerrit-Change-Number: 51435
Gerrit-PatchSet: 2
Gerrit-Owner: jitao shi <jitao.shi(a)mediatek.com>
Gerrit-Reviewer: Hung-Te Lin <hungte(a)chromium.org>
Gerrit-Reviewer: Patrick Georgi <pgeorgi(a)google.com>
Gerrit-Reviewer: Yu-Ping Wu <yupingso(a)google.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-MessageType: merged