Sam Lewis has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/43137 )
Change subject: armv7: mmu: Use 'tlbimva' to invalidate TLB entries
......................................................................
armv7: mmu: Use 'tlbimva' to invalidate TLB entries
The tlbimvaa operation (invalidate unified TLB by MVA, all address
space identifiers) is only available on armv7 processors that support
Multiprocessing Extensions. When used on processors that do not support
the extensions it causes an "undefined instruction" exception.
This patch changes the MMU table entry filling code to use the tlbimva
(invalidate unified TLB entry by MVA and address space identifier)
operation for invalidating TLB entries, which is supported on all armv7
processors.
As address space identifiers are not used in TLB entries in coreboot
(all entries are set as global), these two operations can safely be
used interchangebly. The ASID value supplied to the operation is not
checked for global TLB entries.
More information as well as the data formats for the tlbimvaa and
tlbimba operations are detailed in the "ARM Architecture Reference
Manual ARMv7-A" edition, issue "C.c" page B4-1747.
TEST: Booted Beaglebone Black (my current in progress port)
Change-Id: Ie7dfb4adab20dc7eecb1b20aa2ee6355215a1521
Signed-off-by: Sam Lewis <sam.vr.lewis(a)gmail.com>
---
M src/arch/arm/armv7/mmu.c
M src/arch/arm/include/armv7/arch/cache.h
2 files changed, 8 insertions(+), 2 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/37/43137/1
diff --git a/src/arch/arm/armv7/mmu.c b/src/arch/arm/armv7/mmu.c
index d823c61..51b4860 100644
--- a/src/arch/arm/armv7/mmu.c
+++ b/src/arch/arm/armv7/mmu.c
@@ -118,7 +118,7 @@
/* Invalidate the TLB entries. */
for (i = start_idx; i < end_idx; i++)
- tlbimvaa(offset + (i << shift));
+ tlbimva(offset + (i << shift));
dsb();
isb();
}
@@ -152,7 +152,7 @@
*pgd_entry = (pte_t)(uintptr_t)table | ATTR_NEXTLEVEL;
dccmvac((uintptr_t)pgd_entry);
dsb();
- tlbimvaa(start_addr);
+ tlbimva(start_addr);
dsb();
isb();
diff --git a/src/arch/arm/include/armv7/arch/cache.h b/src/arch/arm/include/armv7/arch/cache.h
index 600ec46..efd1a19 100644
--- a/src/arch/arm/include/armv7/arch/cache.h
+++ b/src/arch/arm/include/armv7/arch/cache.h
@@ -79,6 +79,12 @@
asm volatile ("mcr p15, 0, %0, c8, c7, 3" : : "r" (mva) : "memory");
}
+/* invalidate unified TLB by MVA and ASID */
+static inline void tlbimva(unsigned long mva)
+{
+ asm volatile ("mcr p15, 0, %0, c8, c7, 1" : : "r" (mva) : "memory");
+}
+
/* write data access control register (DACR) */
static inline void write_dacr(uint32_t val)
{
--
To view, visit https://review.coreboot.org/c/coreboot/+/43137
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Ie7dfb4adab20dc7eecb1b20aa2ee6355215a1521
Gerrit-Change-Number: 43137
Gerrit-PatchSet: 1
Gerrit-Owner: Sam Lewis <sam.vr.lewis(a)gmail.com>
Gerrit-MessageType: newchange
Julius Werner has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/42792 )
Change subject: libpayload: cbgfx: Replace bilinear resampling with Lanczos
......................................................................
Patch Set 16:
(3 comments)
> Note that puff-cq might fail due to the size increase of depthcharge.elf. This happened to me when I tried to enable this with Groot UI, even with the lowered bmpblk screen resolution (CL:2282241).
Hmm... how tightly did you pack it? On a Trogdor this takes about 1.3KB extra for me (about half of that would be the sine stuff), which is nothing compared to the 100+KB for the whole depthcharge image or for any individual hi_res language.
In general, any libpayload/depthcharge patch could always increase your binary sizes a bit, so if your image is packed super tight there's always that risk.
https://review.coreboot.org/c/coreboot/+/42792/15//COMMIT_MSG
Commit Message:
https://review.coreboot.org/c/coreboot/+/42792/15//COMMIT_MSG@9
PS15, Line 9: This patch improves the image resampling (scaling) code in CBGFX to use
: the Lanczos algorithm that is widely considered the "best" resampling
: algorithm (e.g. also the first choice in Python's PIL library).
> Do you have a test image, the differences can easily be seen with?
Added
https://review.coreboot.org/c/coreboot/+/42792/15//COMMIT_MSG@12
PS15, Line 12: and therefore slower than bilinear
: resampling
> It’d be great if you could provide some specific data: On <device> there is <1 ms> difference. […]
Well, you can measure it by applying/reverting the patch. Added an example from my tests.
https://review.coreboot.org/c/coreboot/+/42792/15/payloads/libpayload/drive…
File payloads/libpayload/drivers/video/graphics.c:
https://review.coreboot.org/c/coreboot/+/42792/15/payloads/libpayload/drive…
PS15, Line 751: if (equals++ >= (SSZ * SSZ))
> Too many leading tabs - consider code refactoring
Just to clarify, I'm not planning to address this unless someone feels very strongly about it. I can't have less indentation levels due to the amount of nested loops this needs, I think the part over here is still about as readable as it's gonna get, and trying to factor out inner parts of the loops into separate functions (with all the different state that would have to be passed through to there) would just make this harder to follow, I think.
--
To view, visit https://review.coreboot.org/c/coreboot/+/42792
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Idde6f61865bfac2801ee4fff40ac64e4ebddff1a
Gerrit-Change-Number: 42792
Gerrit-PatchSet: 16
Gerrit-Owner: Julius Werner <jwerner(a)chromium.org>
Gerrit-Reviewer: Hung-Te Lin <hungte(a)chromium.org>
Gerrit-Reviewer: Shelley Chen <shchen(a)google.com>
Gerrit-Reviewer: Yu-Ping Wu <yupingso(a)google.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Paul Menzel <paulepanter(a)users.sourceforge.net>
Gerrit-Comment-Date: Tue, 07 Jul 2020 21:31:08 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: build bot (Jenkins) <no-reply(a)coreboot.org>
Comment-In-Reply-To: Paul Menzel <paulepanter(a)users.sourceforge.net>
Gerrit-MessageType: comment
Hello Hung-Te Lin, Shelley Chen, build bot (Jenkins), Yu-Ping Wu,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/42792
to look at the new patch set (#16).
Change subject: libpayload: cbgfx: Replace bilinear resampling with Lanczos
......................................................................
libpayload: cbgfx: Replace bilinear resampling with Lanczos
This patch improves the image resampling (scaling) code in CBGFX to use
the Lanczos algorithm that is widely considered the "best" resampling
algorithm (e.g. also the first choice in Python's PIL library). It is of
course much more elaborate and therefore slower than bilinear
resampling, but a lot of the difference can be made up with
optimizations, and the resulting code was found to still produce
acceptable speeds for existing Chrome OS UI use cases (on an Arm
Cortex-A55 device, time to scale an image to 1101x593 went from ~88ms to
~275ms, a little over 3x slowdown). Nevertheless, if this should be too
slow for anyone there's also an option to tune it down a little, but
still much better than bilinear (same operation was ~170ms with this).
Example images (scaled up by a factor of 7):
Old (bilinear): https://i.imgur.com/ytr2n4Z.png
New (Lanczos a=3): https://i.imgur.com/f0vKluM.png
Signed-off-by: Julius Werner <jwerner(a)chromium.org>
Change-Id: Idde6f61865bfac2801ee4fff40ac64e4ebddff1a
---
M payloads/libpayload/Kconfig
M payloads/libpayload/drivers/video/graphics.c
2 files changed, 303 insertions(+), 85 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/92/42792/16
--
To view, visit https://review.coreboot.org/c/coreboot/+/42792
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Idde6f61865bfac2801ee4fff40ac64e4ebddff1a
Gerrit-Change-Number: 42792
Gerrit-PatchSet: 16
Gerrit-Owner: Julius Werner <jwerner(a)chromium.org>
Gerrit-Reviewer: Hung-Te Lin <hungte(a)chromium.org>
Gerrit-Reviewer: Shelley Chen <shchen(a)google.com>
Gerrit-Reviewer: Yu-Ping Wu <yupingso(a)google.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Paul Menzel <paulepanter(a)users.sourceforge.net>
Gerrit-MessageType: newpatchset
Nick Vaccaro has removed a vote from this change. ( https://review.coreboot.org/c/coreboot/+/43044 )
Change subject: volteer: enable VBOOT_EC_EFS
......................................................................
Removed Code-Review+2 by Nick Vaccaro <nvaccaro(a)google.com>
--
To view, visit https://review.coreboot.org/c/coreboot/+/43044
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Ie71bb169242b2511b4a4102d46a6981d72d07806
Gerrit-Change-Number: 43044
Gerrit-PatchSet: 1
Gerrit-Owner: Caveh Jalali <caveh(a)chromium.org>
Gerrit-Reviewer: Daisuke Nojiri <dnojiri(a)chromium.org>
Gerrit-Reviewer: Duncan Laurie <dlaurie(a)chromium.org>
Gerrit-Reviewer: Nick Vaccaro <nvaccaro(a)google.com>
Gerrit-Reviewer: Tim Wawrzynczak <twawrzynczak(a)chromium.org>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Paul Menzel <paulepanter(a)users.sourceforge.net>
Gerrit-MessageType: deleteVote
Tim Wawrzynczak has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/43003 )
Change subject: drivers/intel/mipi_camera: Add guard variables to protect shared resource
......................................................................
Patch Set 5:
(14 comments)
https://review.coreboot.org/c/coreboot/+/43003/5//COMMIT_MSG
Commit Message:
https://review.coreboot.org/c/coreboot/+/43003/5//COMMIT_MSG@7
PS5, Line 7: drivers/intel/mipi_camera: Add guard variables to protect shared resource
:
: This change updates the mipi_camera driver to handle shared power resource
: between multiple cameras. This is achieved by adding a guard variable and
: methods manipulate the guard variable and guard the call to actual method
: while enables or disables the resource. This protects the shared lines
: from being enabled or disabled multiple times while the resources are
: being used by multiple cameras.
:
reflow for 72 characters wide
https://review.coreboot.org/c/coreboot/+/43003/5/src/drivers/intel/mipi_cam…
File src/drivers/intel/mipi_camera/camera.c:
https://review.coreboot.org/c/coreboot/+/43003/5/src/drivers/intel/mipi_cam…
PS5, Line 26: .cnt = 0
it should get initialized to 0 as it's a file-level static variable, so .cnt=0 shouldn't be required, just `static struct camera_resource_manager res_mgr;`
https://review.coreboot.org/c/coreboot/+/43003/5/src/drivers/intel/mipi_cam…
PS5, Line 477: printk(BIOS_ERR, "Unsupported power operation: %x\n", type);
: printk(BIOS_ERR, "OS camera driver will likely not work");
nit: this can be combined into one printk call:
printk(BIOS_ERR, "Unsupported power operation: %x\n"
"OS camera driver will likely not work", type);
https://review.coreboot.org/c/coreboot/+/43003/5/src/drivers/intel/mipi_cam…
PS5, Line 485: if (action == ENABLE) {
: snprintf(method_name, sizeof(method_name), ENABLE_METHOD_FORMAT,
: res_index);
: } else if (action == DISABLE) {
: snprintf(method_name, sizeof(method_name), DISABLE_METHOD_FORMAT,
: res_index);
: } else {
: snprintf(method_name, sizeof(method_name), UNKNOWN_METHOD_FORMAT,
: res_index);
: acpigen_write_debug_string("Unsupported action");
: printk(BIOS_ERR, "Unsupported resource action: %x\n", action);
: }
a switch statement may be more clear on intention here.
Also, why not just return from the function if the action type is unknown?
https://review.coreboot.org/c/coreboot/+/43003/5/src/drivers/intel/mipi_cam…
PS5, Line 502: void *res_config
Sugnan, I'm not a big fan of the void* for res_config...
Could we maybe work with a tagged anonymous union instead? e.g.,
struct resource_config {
enum action_type action;
enum ctrl_type type;
union {
struct clk_config *clk_conf;
struct gpio_config *gpio_conf;
};
};
Technically it's not as type-safe (b/c of the tagged union), but if you add a few functions for creating them and getting values out (make_resource_config, etc.), then it could work.
I think it would greatly simplify this patch. WDYT?
https://review.coreboot.org/c/coreboot/+/43003/5/src/drivers/intel/mipi_cam…
PS5, Line 502: uint8_t
enum action_type
https://review.coreboot.org/c/coreboot/+/43003/5/src/drivers/intel/mipi_cam…
PS5, Line 502: uint8_t
enum ctrl_type
https://review.coreboot.org/c/coreboot/+/43003/5/src/drivers/intel/mipi_cam…
PS5, Line 569: printk(BIOS_ERR, "Unsupported power operation: %x\n", seq->ops[i].type);
: printk(BIOS_ERR, "OS camera driver will likely not work\n");
nit: you can squash this into one printk call
https://review.coreboot.org/c/coreboot/+/43003/5/src/drivers/intel/mipi_cam…
PS5, Line 571: res_config = NULL;
: break;
: }
:
: if (res_config == NULL)
: continue;
just return from within the `default:` block, I think it's easier to see the intent.
https://review.coreboot.org/c/coreboot/+/43003/5/src/drivers/intel/mipi_cam…
PS5, Line 582: printk(BIOS_ERR, "Unable to add guarded camera resource\n");
: printk(BIOS_ERR, "OS camera driver will likely not work\n");
nit: you can squash this into one printk call
https://review.coreboot.org/c/coreboot/+/43003/5/src/drivers/intel/mipi_cam…
PS5, Line 596: acpigen_write_if();
: acpigen_emit_byte(LEQUAL_OP);
: acpigen_emit_namestring(varname);
: acpigen_write_integer(0);
acpigen_write_if_lequal_namestr_int
https://review.coreboot.org/c/coreboot/+/43003/5/src/drivers/intel/mipi_cam…
PS5, Line 602:
: acpigen_emit_byte(ADD_OP);
: acpigen_emit_namestring(varname);
: acpigen_emit_byte(0x01);
: acpigen_emit_namestring(varname);
: acpigen_pop_len(); /* _ON */
there is an INCREMENT_OP 😊
https://review.coreboot.org/c/coreboot/+/43003/5/src/drivers/intel/mipi_cam…
PS5, Line 612: acpigen_emit_byte(SUBTRACT_OP);
: acpigen_emit_namestring(varname);
: acpigen_emit_byte(0x01);
: acpigen_emit_namestring(varname);
DECREMENT_OP
https://review.coreboot.org/c/coreboot/+/43003/5/src/drivers/intel/mipi_cam…
PS5, Line 616: acpigen_write_if();
: acpigen_emit_byte(LEQUAL_OP);
: acpigen_emit_namestring(varname);
: acpigen_write_integer(0);
acpigen_write_if_lequal_namestr_int
--
To view, visit https://review.coreboot.org/c/coreboot/+/43003
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I1468459d5bbb2fb07bef4e0590c96dd4dbab0d9c
Gerrit-Change-Number: 43003
Gerrit-PatchSet: 5
Gerrit-Owner: Sugnan Prabhu S <sugnan.prabhu.s(a)intel.com>
Gerrit-Reviewer: Furquan Shaikh <furquan(a)google.com>
Gerrit-Reviewer: Matt Delco <delco(a)chromium.org>
Gerrit-Reviewer: Patrick Rudolph <siro(a)das-labor.org>
Gerrit-Reviewer: Rizwan Qureshi <rizwan.qureshi(a)intel.com>
Gerrit-Reviewer: Tim Wawrzynczak <twawrzynczak(a)chromium.org>
Gerrit-Reviewer: Varshit B Pandya <varshit.b.pandya(a)intel.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Comment-Date: Tue, 07 Jul 2020 20:58:24 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment
Tim Wawrzynczak has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/43044 )
Change subject: volteer: enable VBOOT_EC_EFS
......................................................................
Patch Set 1: Code-Review-1
this config option is deprecated, it is used for EFS v1, not v2, see b/157372086#comment12
I don't believe that a config option is required for EFS v2
--
To view, visit https://review.coreboot.org/c/coreboot/+/43044
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Ie71bb169242b2511b4a4102d46a6981d72d07806
Gerrit-Change-Number: 43044
Gerrit-PatchSet: 1
Gerrit-Owner: Caveh Jalali <caveh(a)chromium.org>
Gerrit-Reviewer: Daisuke Nojiri <dnojiri(a)chromium.org>
Gerrit-Reviewer: Duncan Laurie <dlaurie(a)chromium.org>
Gerrit-Reviewer: Nick Vaccaro <nvaccaro(a)google.com>
Gerrit-Reviewer: Tim Wawrzynczak <twawrzynczak(a)chromium.org>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Paul Menzel <paulepanter(a)users.sourceforge.net>
Gerrit-Comment-Date: Tue, 07 Jul 2020 19:42:46 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment