[PATCH v2 0/2] Fix device removal order for Apple dart iommu

2024-11-23 Thread Janne Grunau via B4 Relay
head consistently. Signed-off-by: Janne Grunau --- Changes in v2: - added Mark's Ab: for Patch 1 - add dm_remove_device_active() and replace existing dm_remove_device_flags(DM_REMOVE_ACTIVE_ALL) with it (ignoring test code) - Link to v1: https://lore.kernel.org/r/202

[PATCH v2 1/2] iommu: apple: Mark device with DM_FLAG_VITAL

2024-11-23 Thread Janne Grunau via B4 Relay
From: Janne Grunau Avoids NULL pointer dereferences in apple_dart_unmap when the iommu device is removed before its user. U-boot's device model does not track dependencies between devices. Observed on a M1 Ultra Mac Studio with v2024.10. Acked-by: Mark Kettenis Signed-off-by: Janne G

[PATCH v2 2/2] dm: Add dm_remove_devices_active() for ordered device removal

2024-11-23 Thread Janne Grunau via B4 Relay
From: Janne Grunau This replaces dm_remove_devices_flags() calls in all boot implementations to ensure non vital devices are consistently removed first. All boot implementation except arch/arm/lib/bootm.c currently just call dm_remove_devices_flags(DM_REMOVE_ACTIVE_ALL). This can result in

Re: [PATCH 0/2] Fix device removal order for Apple dart iommu

2024-11-20 Thread Janne Grunau
On Thu, Oct 31, 2024 at 11:48:00PM +0100, Janne Grunau wrote: > Starting with v2024.10 dev_iommu_dma_unmap calls during device removal > trigger a NULL pointer dereference since the the iommu device is removed > before its user. The sparsely used DM_FLAG_VITAL flag is intended f

Re: [PATCH v2 0/4] Fix IOVA allocation in Apple dart iommu after global LMB mem map changes

2024-11-10 Thread Janne Grunau
On Sun, Nov 10, 2024 at 08:52:11PM -0600, Tom Rini wrote: > On Wed, Nov 06, 2024 at 10:10:08PM +0100, Janne Grunau via B4 Relay wrote: > > > The changes in "Make LMB memory map global and persistent" [1] break > > mapping DMA memory in the USB xHCI driver when us

[PATCH v3 0/4] Fix IOVA allocation in Apple dart iommu after global LMB mem map changes

2024-11-10 Thread Janne Grunau via B4 Relay
ore.kernel.org/u-boot/20241031-iommu_apple_dart_ordering-v1-0-8a6877946...@jannau.net/ Signed-off-by: Janne Grunau --- Changes in v3: - rebased onto master - redo "lmb: cosmetic: reorder functions and global LMB variable" to account for changes in lib/lmb.c (removed Rb:) - Link to v2: https://lore.kernel.org

[PATCH v3 2/4] lmb: cosmetic: reorder functions and global LMB variable

2024-11-10 Thread Janne Grunau via B4 Relay
From: Janne Grunau Low lovel LMB functionality will be used to manage IOVA space in the Apple dart iommu driver. This reordering ensures that those function can not access the global LMB memory map variable. Signed-off-by: Janne Grunau --- lib/lmb.c | 490

[PATCH v3 3/4] lmb: Add basic io_lmb functionality

2024-11-10 Thread Janne Grunau via B4 Relay
From: Janne Grunau These functions can be used with struct lmb pointers and will be used to manage IOVA space in the apple_dart iommu driver. This restores part of the pointer base struct lmb API from before commit ed17a33fed29 ("lmb: make LMB memory map persistent and global"). io_lmb

[PATCH v3 4/4] iommu: apple: Manage IOVA separately from global LMB mem map

2024-11-10 Thread Janne Grunau via B4 Relay
From: Janne Grunau There is no overlap between the IOVA space managed by the iommu (here the 32-bit address space) and physical RAM on Apple silicon systems. The RAM starts at 0x10__ or 0x100__ so it's not possible to manage the IOVA with the global memory LMB and us

[PATCH v3 1/4] lmb: Do not use global LMB variable in _lmb_free()

2024-11-10 Thread Janne Grunau via B4 Relay
From: Janne Grunau It will be re-used with a lmb list pointer as argument for IOVA allocations in the apple_dart iommu driver. Reviewed-by: Tom Rini Signed-off-by: Janne Grunau --- lib/lmb.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/lmb.c b/lib/lmb.c index

[PATCH v2 2/4] lmb: cosmetic: reorder functions and global LMB variable

2024-11-06 Thread Janne Grunau via B4 Relay
From: Janne Grunau Low lovel LMB functionality will be used to manage IOVA space in the Apple dart iommu driver. This reordering ensures that those function can not access the global LMB memory map variable. Reviewed-by: Tom Rini Signed-off-by: Janne Grunau --- lib/lmb.c | 496

[PATCH v2 1/4] lmb: Do not use global LMB variable in _lmb_free()

2024-11-06 Thread Janne Grunau via B4 Relay
From: Janne Grunau It will be re-used with a lmb list pointer as argument for IOVA allocations in the apple_dart iommu driver. Reviewed-by: Tom Rini Signed-off-by: Janne Grunau --- lib/lmb.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/lmb.c b/lib/lmb.c index

[PATCH v2 4/4] iommu: apple: Manage IOVA separately from global LMB mem map

2024-11-06 Thread Janne Grunau via B4 Relay
From: Janne Grunau There is no overlap between the IOVA space managed by the iommu (here the 32-bit address space) and physical RAM on Apple silicon systems. The RAM starts at 0x10__ or 0x100__ so it's not possible to manage the IOVA with the global memory LMB and us

[PATCH v2 0/4] Fix IOVA allocation in Apple dart iommu after global LMB mem map changes

2024-11-06 Thread Janne Grunau via B4 Relay
ore.kernel.org/u-boot/20241031-iommu_apple_dart_ordering-v1-0-8a6877946...@jannau.net/ Signed-off-by: Janne Grunau --- Changes in v2: - added io_lmb_teardown() and use it in dart's remove callback - removed leftover from copy-n-paste in io_lmb_setup() documentation - added Tom's Rb: - Link to

[PATCH v2 3/4] lmb: Add basic io_lmb functionality

2024-11-06 Thread Janne Grunau via B4 Relay
From: Janne Grunau These functions can be used with struct lmb pointers and will be used to manage IOVA space in the apple_dart iommu driver. This restores part of the pointer base struct lmb API from before commit ed17a33fed29 ("lmb: make LMB memory map persistent and global"). io_lmb

Re: [PATCH 3/4] lmb: Add basic io_lmb functionality

2024-11-05 Thread Janne Grunau
On Wed, Nov 06, 2024 at 12:48:45AM +0530, Sughosh Ganu wrote: > On Fri, 1 Nov 2024 at 15:47, Janne Grunau wrote: > > > > These functions can be used with struct lmb pointers and will be used to > > manage IOVA space in the apple_dart iommu driver. This restores part of > &

Re: [PATCH 0/4] Fix IOVA allocation in Apple dart iommu after global LMB mem map changes

2024-11-05 Thread Janne Grunau
On Wed, Nov 06, 2024 at 12:43:01AM +0530, Sughosh Ganu wrote: > On Sun, 3 Nov 2024 at 23:06, Janne Grunau wrote: > > > > On Sun, Nov 03, 2024 at 07:53:36PM +0530, Sughosh Ganu wrote: > > > On Sat, 2 Nov 2024 at 16:00, Mark Kettenis > > > wrote: >

Re: [PATCH 0/4] Fix IOVA allocation in Apple dart iommu after global LMB mem map changes

2024-11-03 Thread Janne Grunau
On Sun, Nov 03, 2024 at 07:53:36PM +0530, Sughosh Ganu wrote: > On Sat, 2 Nov 2024 at 16:00, Mark Kettenis wrote: > > > > > From: Sughosh Ganu > > > Date: Fri, 1 Nov 2024 17:17:22 +0530 > > > > > > On Fri, 1 Nov 2024 at 15:47, Janne Grunau wrote: &g

[PATCH 4/4] iommu: apple: Manage IOVA separately from global LMB mem map

2024-11-01 Thread Janne Grunau
al") Signed-off-by: Janne Grunau --- drivers/iommu/apple_dart.c | 16 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/drivers/iommu/apple_dart.c b/drivers/iommu/apple_dart.c index 611ac7cd6deb4fccd45ccfe8cbb9b3e36e2af753..dfcc85c123441d6291d75898675fce7c1a

[PATCH 3/4] lmb: Add basic io_lmb functionality

2024-11-01 Thread Janne Grunau
free() can trivially reuse exisiting lmb functions. io_lmb_setup() is separate for unique error log messages. io_lmb_alloc() is a simplified copy of _lmb_alloc_base() since the later has unused features and internal use of the global LMB memory map. Signed-off-by: Janne Grunau --- include/

[PATCH 1/4] lmb: Do not use global LMB variable in _lmb_free()

2024-11-01 Thread Janne Grunau
It will be re-used with a lmb list pointer as argument for IOVA allocations in the apple_dart iommu driver. Signed-off-by: Janne Grunau --- lib/lmb.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/lmb.c b/lib/lmb.c index 96a055f951e657bf3acc05c9fa804698ce90c312

[PATCH 2/4] lmb: cosmetic: reorder functions and global LMB variable

2024-11-01 Thread Janne Grunau
Low lovel LMB functionality will be used to manage IOVA space in the Apple dart iommu driver. This reordering ensures that those function can not access the global LMB memory map variable. Signed-off-by: Janne Grunau --- lib/lmb.c | 496

[PATCH 0/4] Fix IOVA allocation in Apple dart iommu after global LMB mem map changes

2024-11-01 Thread Janne Grunau
ore.kernel.org/u-boot/20241031-iommu_apple_dart_ordering-v1-0-8a6877946...@jannau.net/ Signed-off-by: Janne Grunau --- Janne Grunau (4): lmb: Do not use global LMB variable in _lmb_free() lmb: cosmetic: reorder functions and global LMB variable lmb: Add basic io_lmb functionality iommu: appl

Re: [PATCH 0/2] Fix device removal order for Apple dart iommu

2024-11-01 Thread Janne Grunau
On Fri, Nov 01, 2024 at 11:52:26AM +0530, Sughosh Ganu wrote: > On Fri, 1 Nov 2024 at 04:37, Janne Grunau wrote: > > > > Starting with v2024.10 dev_iommu_dma_unmap calls during device removal > > trigger a NULL pointer dereference since the the iommu device is removed >

[PATCH 1/2] iommu: apple: Mark device with DM_FLAG_VITAL

2024-10-31 Thread Janne Grunau
Avoids NULL pointer dereferences in apple_dart_unmap when the iommu device is removed before its user. U-boot's device model does not track dependencies between devices. Observed on a M1 Ultra Mac Studio with v2024.10. Signed-off-by: Janne Grunau --- drivers/iommu/apple_dart.c | 2 +- 1

[PATCH 2/2] efi_loader: remove non vital devices first

2024-10-31 Thread Janne Grunau
markes as vital. The arm boot code already handles devioce removal in this way. Signed-off-by: Janne Grunau --- lib/efi_loader/efi_boottime.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/efi_loader/efi_boottime.c b/lib/efi_loader/efi_boottime.c index

[PATCH 0/2] Fix device removal order for Apple dart iommu

2024-10-31 Thread Janne Grunau
the two phased device removal to the EFI loader. Signed-off-by: Janne Grunau --- Janne Grunau (2): iommu: apple: Mark device with DM_FLAG_VITAL efi_loader: remove non vital devices first drivers/iommu/apple_dart.c| 2 +- lib/efi_loader/efi_boottime.c | 1 + 2 files changed, 2

Re: [RFC PATCH 2/2] apple: dart: use driver specific instance of LMB

2024-10-30 Thread Janne Grunau
On Tue, Oct 29, 2024 at 02:22:53PM +0530, Sughosh Ganu wrote: > On Tue, 29 Oct 2024 at 14:02, Janne Grunau wrote: > > > > On Tue, Oct 29, 2024 at 12:48:46PM +0530, Sughosh Ganu wrote: > > > The LMB module is typically used for managing the platform's RAM > > >

Re: [RFC PATCH 2/2] apple: dart: use driver specific instance of LMB

2024-10-29 Thread Janne Grunau
Hej, On Tue, Oct 29, 2024 at 12:48:46PM +0530, Sughosh Ganu wrote: > The LMB module is typically used for managing the platform's RAM > memory. RAM memory gets added to the module's memory map, and > subsequently allocated through various LMB API's. > > The IOMMU driver for the apple platforms al

Re: [PATCH v4 05/27] lmb: make LMB memory map persistent and global

2024-10-28 Thread Janne Grunau
On Mon, Aug 26, 2024 at 05:29:18PM +0530, Sughosh Ganu wrote: > The current LMB API's for allocating and reserving memory use a > per-caller based memory view. Memory allocated by a caller can then be > overwritten by another caller. Make these allocations and reservations > persistent using the al

[PATCH v2 5/5] arm: apple: Do not list bootflows on boot

2024-04-18 Thread Janne Grunau via B4 Relay
From: Janne Grunau The bootflow list is only seen briefly and is probably more confusing than helpful. Signed-off-by: Janne Grunau --- configs/apple_m1_defconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/configs/apple_m1_defconfig b/configs/apple_m1_defconfig index c30aec7c55

[PATCH v2 1/5] apple_m1_defconfig: Turn on CONFIG_SYS_64BIT_LBA

2024-04-18 Thread Janne Grunau via B4 Relay
by: Mark Kettenis Reviewed-by: Neal Gompa Signed-off-by: Janne Grunau --- configs/apple_m1_defconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/configs/apple_m1_defconfig b/configs/apple_m1_defconfig index e00d72e8be..31d966f0ab 100644 --- a/configs/apple_m1_defconfig +++ b

[PATCH v2 3/5] configs: apple: Enable CMD_SELECT_FONT and FONT_16X32

2024-04-18 Thread Janne Grunau via B4 Relay
From: Janne Grunau Apple devices have high DPI displays so the larger fonts are preferable for improved readability. This does not yet change the used font based on the display's pixel density so the standard 8x16 font is still used by default. Reviewed-by: Mark Kettenis Reviewed-by:

[PATCH v2 0/5] configs: apple: Switch to standard boot + small adjustments

2024-04-18 Thread Janne Grunau via B4 Relay
addressing Signed-off-by: Janne Grunau --- Changes in v2: - added Reviewed-by: tags - switched to BOOTSTD_FULL to enable efi_bootmgr and make interactive use easier - override BOOTCOMMAND to not list the bootflows - rebased onto v2024.04 - Link to v1: https://lore.kernel.org/r/20240317

[PATCH v2 2/5] configs: apple: Use "vidconsole,serial" as stdout/stderr

2024-04-18 Thread Janne Grunau via B4 Relay
From: Janne Grunau The display size querying in efi_console relies on this order. The display should be the primary output device and should be used to display more than 80x25 chars. Reviewed-by: Mark Kettenis Reviewed-by: Neal Gompa Signed-off-by: Janne Grunau --- include/configs/apple.h

[PATCH v2 4/5] arm: apple: Switch to standard boot

2024-04-18 Thread Janne Grunau via B4 Relay
From: Janne Grunau Use standard boot instead of the distro boot scripts. Use BOOTSTD_FULL instead of BOOTSTD_DEFAULTS for easier interactive use. Signed-off-by: Janne Grunau --- arch/arm/Kconfig| 2 +- include/configs/apple.h | 20 ++-- 2 files changed, 3 insertions

Re: [PATCH 4/4] arm: apple: Switch to standard boot

2024-04-16 Thread Janne Grunau
On Mon, Apr 15, 2024 at 04:24:51PM +0200, Mark Kettenis wrote: > > From: Janne Grunau via B4 Relay > > Date: Sun, 17 Mar 2024 15:54:50 +0100 > > > > From: Janne Grunau > > > > Use standard boot instead of the distro boot scripts. > > > > Sig

Re: [PATCH v4 0/6] USB keyboard improvements for asahi / desktop systems

2024-04-08 Thread Janne Grunau
On Sun, Apr 07, 2024 at 03:05:59AM +0200, Marek Vasut wrote: > On 4/6/24 10:04 PM, Janne Grunau wrote: > > On Sat, Apr 06, 2024 at 08:52:17PM +0200, Marek Vasut wrote: > >> On 4/5/24 9:05 PM, Janne Grunau wrote: > >>> On Fri, Apr 05, 2024 at 04:52:32PM +0200, Marek V

Re: [PATCH v4 0/6] USB keyboard improvements for asahi / desktop systems

2024-04-06 Thread Janne Grunau
On Sat, Apr 06, 2024 at 08:52:17PM +0200, Marek Vasut wrote: > On 4/5/24 9:05 PM, Janne Grunau wrote: > > On Fri, Apr 05, 2024 at 04:52:32PM +0200, Marek Vasut wrote: > >> On 4/4/24 8:25 AM, Janne Grunau via B4 Relay wrote: > >>> Apple USB Keyboards from 2021 need

Re: [PATCH v4 0/6] USB keyboard improvements for asahi / desktop systems

2024-04-05 Thread Janne Grunau
On Fri, Apr 05, 2024 at 04:52:32PM +0200, Marek Vasut wrote: > On 4/4/24 8:25 AM, Janne Grunau via B4 Relay wrote: > > Apple USB Keyboards from 2021 need quirks to be useable. The boot HID > > keyboard protocol is unfortunately not described in the first interface > > desc

[PATCH v4 1/6] usb: xhci: refactor xhci_set_configuration

2024-04-03 Thread Janne Grunau via B4 Relay
From: Janne Grunau In the next step endpoints for multiple interfaces are set up. Move most of the per endpoint initialization to separate function to avoid another identation level. Reviewed-by: Marek Vasut Reviewed-by: Neal Gompa Signed-off-by: Janne Grunau --- drivers/usb/host/xhci.c

[PATCH v4 2/6] usb: xhci: Set up endpoints for the first 2 interfaces

2024-04-03 Thread Janne Grunau via B4 Relay
From: Janne Grunau The xhci driver currently only does the necessary initialization for endpoints found in the first interface descriptor. Apple USB keyboards (released 2021) use the second interface descriptor for the HID keyboard boot protocol. To allow USB drivers to use endpoints from other

[PATCH v4 4/6] usb: Add environment based device ignorelist

2024-04-03 Thread Janne Grunau via B4 Relay
From: Janne Grunau Add the environment variable "usb_ignorelist" to prevent USB devices listed in it from being bound to drivers. This allows to ignore devices which are undesirable or trigger bugs in u-boot's USB stack. Devices emulating keyboards are one example of undesirab

[PATCH v4 0/6] USB keyboard improvements for asahi / desktop systems

2024-04-03 Thread Janne Grunau via B4 Relay
evices like Yubikeys emulate a keyboard. since u-boot only binds a single keyboard block this kind of devices from the USB keyboard driver. Signed-off-by: Janne Grunau --- Changes in v4: - collects "Reviewed-by:" tagDITME: describe what is new in this series revision. - adds comment abo

[PATCH v4 5/6] usb: kbd: support Apple Magic Keyboards (2021)

2024-04-03 Thread Janne Grunau via B4 Relay
From: Janne Grunau Apple USB keyboards (Magic Keyboard from 2021 (product id 0x029c)) carry the HID keyboard boot protocol on the second interface descriptor. Probe via vendor and product IDs since the class/subclass/protocol match uses the first interface descriptor. Probe the two first

[PATCH v4 3/6] usb: xhci: Abort transfers with unallocated rings

2024-04-03 Thread Janne Grunau via B4 Relay
From: Janne Grunau Discovered while trying to use the second interface in the USB keyboard driver necessary on Apple USB keyboards. Reviewed-by: Marek Vasut Reviewed-by: Neal Gompa Signed-off-by: Janne Grunau --- drivers/usb/host/xhci-ring.c | 5 + 1 file changed, 5 insertions(+) diff

[PATCH v4 6/6] usb: kbd: Add probe quirk for Apple and Keychron keyboards

2024-04-03 Thread Janne Grunau via B4 Relay
From: Janne Grunau Those keyboards do not return the current device state. Polling will timeout unless there are key presses. This is not a problem during operation but the initial device state query during probing will fail. Skip this step in usb_kbd_probe_dev() to make these devices useable

Re: [PATCH v3 4/6] usb: Add environment based device ignorelist

2024-03-26 Thread Janne Grunau
On Fri, Mar 22, 2024 at 12:56:37PM +0100, Marek Vasut wrote: > On 3/22/24 8:47 AM, Janne Grunau via B4 Relay wrote: > > [...] > > > @@ -1099,6 +1142,20 @@ int usb_select_config(struct usb_device *dev) > > le16_to_cpus(&dev->descriptor.idProd

Re: [PATCH v3 2/6] usb: xhci: Set up endpoints for the first 2 interfaces

2024-03-26 Thread Janne Grunau
On Fri, Mar 22, 2024 at 09:17:08AM +0100, Heinrich Schuchardt wrote: > On 3/22/24 08:47, Janne Grunau via B4 Relay wrote: > > From: Janne Grunau > > > > The xhci driver currently only does the necessary initialization for > > endpoints found in the first interface desc

[PATCH v3 0/6] USB keyboard improvements for asahi / desktop systems

2024-03-22 Thread Janne Grunau via B4 Relay
evices like Yubikeys emulate a keyboard. since u-boot only binds a single keyboard block this kind of devices from the USB keyboard driver. Signed-off-by: Janne Grunau --- Changes in v3: - collected "Reviewed-by:" tags - rename usb_blocklist to usb_ignorelist - use BIT macro fo

[PATCH v3 1/6] usb: xhci: refactor xhci_set_configuration

2024-03-22 Thread Janne Grunau via B4 Relay
From: Janne Grunau In the next step endpoints for multiple interfaces are set up. Move most of the per endpoint initialization to separate function to avoid another identation level. Reviewed-by: Marek Vasut Reviewed-by: Neal Gompa Signed-off-by: Janne Grunau --- drivers/usb/host/xhci.c

[PATCH v3 5/6] usb: kbd: support Apple Magic Keyboards (2021)

2024-03-22 Thread Janne Grunau via B4 Relay
From: Janne Grunau Apple USB keyboards (Magic Keyboard from 2021 (product id 0x029c)) carry the HID keyboard boot protocol on the second interface descriptor. Probe via vendor and product IDs since the class/subclass/protocol match uses the first interface descriptor. Probe the two first

[PATCH v3 4/6] usb: Add environment based device ignorelist

2024-03-22 Thread Janne Grunau via B4 Relay
From: Janne Grunau Add the environment variable "usb_ignorelist" to prevent USB devices listed in it from being bound to drivers. This allows to ignore devices which are undesirable or trigger bugs in u-boot's USB stack. Devices emulating keyboards are one example of undesirab

[PATCH v3 2/6] usb: xhci: Set up endpoints for the first 2 interfaces

2024-03-22 Thread Janne Grunau via B4 Relay
From: Janne Grunau The xhci driver currently only does the necessary initialization for endpoints found in the first interface descriptor. Apple USB keyboards (released 2021) use the second interface descriptor for the HID keyboard boot protocol. To allow USB drivers to use endpoints from other

[PATCH v3 6/6] usb: kbd: Add probe quirk for Apple and Keychron keyboards

2024-03-22 Thread Janne Grunau via B4 Relay
From: Janne Grunau Those keyboards do not return the current device state. Polling will timeout unless there are key presses. This is not a problem during operation but the initial device state query during probing will fail. Skip this step in usb_kbd_probe_dev() to make these devices useable

[PATCH v3 3/6] usb: xhci: Abort transfers with unallocated rings

2024-03-22 Thread Janne Grunau via B4 Relay
From: Janne Grunau Discovered while trying to use the second interface in the USB keyboard driver necessary on Apple USB keyboards. Reviewed-by: Marek Vasut Reviewed-by: Neal Gompa Signed-off-by: Janne Grunau --- drivers/usb/host/xhci-ring.c | 5 + 1 file changed, 5 insertions(+) diff

Re: [PATCH v3 4/7] efi_selftest: Add international characters test

2024-03-19 Thread Janne Grunau
On Sun, Mar 17, 2024 at 10:24:13AM +0100, Heinrich Schuchardt wrote: > On 3/16/24 22:50, Janne Grunau via B4 Relay wrote: > > From: Andre Przywara > > > > UEFI relies entirely on unicode output, which actual fonts displayed on > > the screen might not be ready for. &g

Re: [PATCH v2 4/6] usb: Add environment based device blocklist

2024-03-19 Thread Janne Grunau
On Mon, Mar 18, 2024 at 03:17:33PM +0100, Marek Vasut wrote: > On 3/18/24 8:33 AM, Janne Grunau wrote: > > >>>>> +static int usb_blocklist_parse_error(const char *blocklist, size_t pos) > >>>>> +{ > >>>>> + pri

Re: [PATCH v2 4/6] usb: Add environment based device blocklist

2024-03-18 Thread Janne Grunau
Hej, On Sun, Mar 17, 2024, at 22:39, E Shattow wrote: > Should be usb_denylist, since "block devices" is ambiguous meaning if > it is a list of data chunks (blocks) or if it blocks (deny). There is > no question what a denylist is. I briefly thought of that concluded that the spelling "blocklist"

Re: [PATCH v2 4/6] usb: Add environment based device blocklist

2024-03-18 Thread Janne Grunau
On Mon, Mar 18, 2024, at 06:06, Marek Vasut wrote: > On 3/17/24 7:15 PM, Janne Grunau wrote: >> Hej, > > Hi, > >> On Sun, Mar 17, 2024, at 17:18, Marek Vasut wrote: >>> On 3/17/24 12:07 PM, Janne Grunau via B4 Relay wrote: >>>> From: Janne G

Re: [PATCH v2 4/6] usb: Add environment based device blocklist

2024-03-17 Thread Janne Grunau
Hej, On Sun, Mar 17, 2024, at 17:18, Marek Vasut wrote: > On 3/17/24 12:07 PM, Janne Grunau via B4 Relay wrote: >> From: Janne Grunau >> >> Add the environment variable "usb_blocklist" to prevent USB devices >> listed in it from being used. This allows to ig

[PATCH 1/4] apple_m1_defconfig: Turn on CONFIG_SYS_64BIT_LBA

2024-03-17 Thread Janne Grunau via B4 Relay
d-off-by: Janne Grunau --- configs/apple_m1_defconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/configs/apple_m1_defconfig b/configs/apple_m1_defconfig index e00d72e8be..31d966f0ab 100644 --- a/configs/apple_m1_defconfig +++ b/configs/apple_m1_defconfig @@ -10,6 +10,7 @@ CONFIG_SYS_PB

[PATCH 3/4] configs: apple: Enable CMD_SELECT_FONT and FONT_16X32

2024-03-17 Thread Janne Grunau via B4 Relay
From: Janne Grunau Apple devices have high DPI displays so the larger fonts are preferable for improved readability. This does not yet change the used font based on the display's pixel density so the standard 8x16 font is still used by default. Signed-off-by: Janne Grunau --- co

[PATCH 2/4] configs: apple: Use "vidconsole,serial" as stdout/stderr

2024-03-17 Thread Janne Grunau via B4 Relay
From: Janne Grunau The display size querying in efi_console relies on this order. The display should be the primary output device and should be used to display more than 80x25 chars. Signed-off-by: Janne Grunau --- include/configs/apple.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions

[PATCH 4/4] arm: apple: Switch to standard boot

2024-03-17 Thread Janne Grunau via B4 Relay
From: Janne Grunau Use standard boot instead of the distro boot scripts. Signed-off-by: Janne Grunau --- arch/arm/Kconfig| 2 +- include/configs/apple.h | 20 ++-- 2 files changed, 3 insertions(+), 19 deletions(-) diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig

[PATCH 0/4] configs: apple: Switch to standard boot + small adjustments

2024-03-17 Thread Janne Grunau via B4 Relay
addressing for USB storage devices larger than 2TB Signed-off-by: Janne Grunau --- Hector Martin (1): apple_m1_defconfig: Turn on CONFIG_SYS_64BIT_LBA Janne Grunau (3): configs: apple: Use "vidconsole,serial" as stdout/stderr configs: apple: Enable CMD_SELEC

Re: [PATCH v2 4/6] usb: Add environment based device blocklist

2024-03-17 Thread Janne Grunau
Hej, On Sun, Mar 17, 2024, at 12:07, Janne Grunau via B4 Relay wrote: > From: Janne Grunau > > Add the environment variable "usb_blocklist" to prevent USB devices > listed in it from being used. This allows to ignore devices which > trigger bugs in u-boot's USB stac

[PATCH v2 0/6] USB keyboard improvements for asahi / desktop systems

2024-03-17 Thread Janne Grunau via B4 Relay
evices like Yubikeys emulate a keyboard. since u-boot only binds a single keyboard block this kind of devices from the USB keyboard driver. Signed-off-by: Janne Grunau --- Changes in v2: - rewritten commit message for "[PATCH 2/6] usb: xhci: Set up endpoints for the first 2 interfaces" - Rep

[PATCH v2 5/6] usb: kbd: support Apple Magic Keyboards (2021)

2024-03-17 Thread Janne Grunau via B4 Relay
From: Janne Grunau Apple USB keyboards (Magic Keyboard from 2021 (product id 0x029c)) carry the HID keyboard boot protocol on the second interface descriptor. Probe via vendor and product IDs since the class/subclass/protocol match uses the first interface descriptor. Probe the two first

[PATCH v2 1/6] usb: xhci: refactor xhci_set_configuration

2024-03-17 Thread Janne Grunau via B4 Relay
From: Janne Grunau In the next step endpoints for multiple interfaces are set up. Move most of the per endpoint initialization to separate function to avoid another identation level. Reviewed-by: Marek Vasut Signed-off-by: Janne Grunau --- drivers/usb/host/xhci.c | 119

[PATCH v2 6/6] usb: kbd: Add probe quirk for Apple and Keychron keyboards

2024-03-17 Thread Janne Grunau via B4 Relay
From: Janne Grunau Those keyboards do not return the current device state. Polling will timeout unless there are key presses. This is not a problem during operation but the inital device state query during probing will fail. Skip this step in usb_kbd_probe_dev() to make these devices useable

[PATCH v2 2/6] usb: xhci: Set up endpoints for the first 2 interfaces

2024-03-17 Thread Janne Grunau via B4 Relay
From: Janne Grunau The xhci driver currently only does the necessary initialization for endpoints found in the first interface descriptor. Apple USB keyboards (released 2021) use the second interface descriptor for the HID keyboard boot protocol. To allow USB drivers to use endpoints from other

[PATCH v2 4/6] usb: Add environment based device blocklist

2024-03-17 Thread Janne Grunau via B4 Relay
From: Janne Grunau Add the environment variable "usb_blocklist" to prevent USB devices listed in it from being used. This allows to ignore devices which trigger bugs in u-boot's USB stack or are undesirable for other reasons. Devices emulating keyboards are one example. U-boot cur

[PATCH v2 3/6] usb: xhci: Abort transfers with unallocated rings

2024-03-17 Thread Janne Grunau via B4 Relay
From: Janne Grunau Discovered while trying to use the second interface in the USB keyboard driver necessary on Apple USB keyboards. Signed-off-by: Janne Grunau --- drivers/usb/host/xhci-ring.c | 5 + 1 file changed, 5 insertions(+) diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb

[PATCH v3 7/7] efi_selftest: Update StrToFat() unit test after CP473 map extension

2024-03-16 Thread Janne Grunau via B4 Relay
From: Janne Grunau Test that Unicode code points which map to CP437 code points 1-31 are converted to '_'. This ensures no FAT file names do not contain chars which are control characters in other code pages (CP 1250 for example). Signed-off-by: Janne Grunau --- lib/ef

[PATCH v3 2/7] video: console: Parse UTF-8 character sequences

2024-03-16 Thread Janne Grunau via B4 Relay
From: Janne Grunau efi_console / UEFI applications (grub2, sd-boot, ...) pass UTF-8 character sequences to vidconsole which results in wrong glyphs for code points outside of ASCII. The truetype console expects Unicode code points and bitmap font based consoles expect code page 437 code points

[PATCH v3 1/7] lib: charset: Fix and extend utf8_to_utf32_stream() documentation

2024-03-16 Thread Janne Grunau via B4 Relay
From: Janne Grunau Suggested-by: Heinrich Schuchardt Reviewed-by: Heinrich Schuchardt Signed-off-by: Janne Grunau --- include/charset.h | 14 -- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/include/charset.h b/include/charset.h index 44034c71d3..f1050c903d

[PATCH v3 6/7] efi_selftest: Add geometric shapes character selftest

2024-03-16 Thread Janne Grunau via B4 Relay
From: Janne Grunau Draw symbols from Unicode's "Geometric shapes" page which translate to code page 437 code points 1-31. These are used by UEFI applications to draw user interfaces using EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL. The output has to be checked manually on the screen

[PATCH v3 5/7] efi_selftest: Add box drawing character selftest

2024-03-16 Thread Janne Grunau via B4 Relay
for correctness. Signed-off-by: Andre Przywara Suggested-by: Heinrich Schuchardt Signed-off-by: Janne Grunau --- lib/efi_selftest/efi_selftest_textoutput.c | 20 1 file changed, 20 insertions(+) diff --git a/lib/efi_selftest/efi_selftest_textoutput.c b/lib/efi_selftest

[PATCH v3 4/7] efi_selftest: Add international characters test

2024-03-16 Thread Janne Grunau via B4 Relay
screen for correctness. Signed-off-by: Andre Przywara Suggested-by: Heinrich Schuchardt Signed-off-by: Janne Grunau --- lib/efi_selftest/efi_selftest_textoutput.c | 21 + 1 file changed, 21 insertions(+) diff --git a/lib/efi_selftest/efi_selftest_textoutput.c b/lib

[PATCH v3 0/7] video: Add UTF-8 support for UEFI applications

2024-03-16 Thread Janne Grunau via B4 Relay
n tests as proposed by Heinrich Link: https://lore.kernel.org/u-boot/20220110005638.21599-1-andre.przyw...@arm.com/ Signed-off-by: Janne Grunau --- Changes in v3: - added Reviewed-by tag - removed unnecessary u8 casts - limited utf-8 conversion buffer to 5 bytes as documented - add

[PATCH v3 3/7] lib/charset: Map Unicode code points to CP437 code points 1-31

2024-03-16 Thread Janne Grunau via B4 Relay
From: Janne Grunau Code page 437 uses code points 1-31 for glyphs instead of control characters. Map the appropriate Unicode code points to this code points. Fixes rendering of grub2's menu as EFI application using the EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL on a console with bitmap fonts. Signe

Re: [PATCH 2/6] usb: xhci: Set up endpoints for the first 2 interfaces

2024-02-26 Thread Janne Grunau
Hej, On Sun, Feb 25, 2024, at 22:47, Marek Vasut wrote: > On 2/25/24 4:28 PM, Janne Grunau wrote: >> >> >> On Wed, Feb 21, 2024, at 13:39, Marek Vasut wrote: >>> On 2/21/24 08:25, Janne Grunau via B4 Relay wrote: >>>> From: Janne Grunau >>>>

Re: [PATCH 4/6] usb: kbd: Ignore Yubikeys

2024-02-26 Thread Janne Grunau
Hej, On Mon, Feb 26, 2024, at 21:47, Mark Kettenis wrote: >> Date: Sun, 25 Feb 2024 22:57:23 +0100 >> From: Marek Vasut >> >> On 2/25/24 5:07 PM, Janne Grunau wrote: >> > Hej, >> > >> > On Wed, Feb 21, 2024, at 13:41, Marek Vasut wrote: >

Re: [PATCH 4/6] usb: kbd: Ignore Yubikeys

2024-02-25 Thread Janne Grunau
Hej, On Wed, Feb 21, 2024, at 13:41, Marek Vasut wrote: > On 2/21/24 08:25, Janne Grunau via B4 Relay wrote: >> From: Hector Martin >> >> We currently only support one USB keyboard device, but some devices >> emulate keyboards for other purposes. Most commonly, p

Re: [PATCH 3/6] usb: xhci: Abort transfers with unallocated rings

2024-02-25 Thread Janne Grunau
Hej, On Wed, Feb 21, 2024, at 13:40, Marek Vasut wrote: > On 2/21/24 08:25, Janne Grunau via B4 Relay wrote: >> From: Janne Grunau >> >> Discovered while trying to use the second interface in the USB keyboard >> driver necessary on Apple USB keyboards. >>

Re: [PATCH 2/6] usb: xhci: Set up endpoints for the first 2 interfaces

2024-02-25 Thread Janne Grunau
On Wed, Feb 21, 2024, at 13:39, Marek Vasut wrote: > On 2/21/24 08:25, Janne Grunau via B4 Relay wrote: >> From: Janne Grunau >> >> Apple USB keyboards carry the HID keyboard boot protocol on the second >> interface. Using the second interface in the USB keyboard dr

Re: [PATCH v2 5/6] efi_selftest: Add box drawing character selftest

2024-02-20 Thread Janne Grunau
Hej, On Mon, Feb 12, 2024, at 17:07, Heinrich Schuchardt wrote: > On 10.02.24 13:46, Janne Grunau via B4 Relay wrote: >> From: Andre Przywara >> >> UEFI applications rely on Unicode output capability, and might use that >> for drawing pseudo-graphical interface

[PATCH 2/6] usb: xhci: Set up endpoints for the first 2 interfaces

2024-02-20 Thread Janne Grunau via B4 Relay
From: Janne Grunau Apple USB keyboards carry the HID keyboard boot protocol on the second interface. Using the second interface in the USB keyboard driver does not work since the xhci has not allocated a transfer ring. --- drivers/usb/host/xhci.c | 31 +++ include

[PATCH 6/6] usb: kbd: Add probe quirk for Apple and Keychron keyboards

2024-02-20 Thread Janne Grunau via B4 Relay
From: Janne Grunau Those keyboards do not return the current device state. Polling will timeout unless there are key presses. This is not a problem during operation but the inital device state query during probing will fail. Skip this step in usb_kbd_probe_dev() to make these devices useable

[PATCH 3/6] usb: xhci: Abort transfers with unallocated rings

2024-02-20 Thread Janne Grunau via B4 Relay
From: Janne Grunau Discovered while trying to use the second interface in the USB keyboard driver necessary on Apple USB keyboards. Signed-off-by: Janne Grunau --- drivers/usb/host/xhci-ring.c | 5 + 1 file changed, 5 insertions(+) diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb

[PATCH 4/6] usb: kbd: Ignore Yubikeys

2024-02-20 Thread Janne Grunau via B4 Relay
From: Hector Martin We currently only support one USB keyboard device, but some devices emulate keyboards for other purposes. Most commonly, people run into this with Yubikeys, so let's ignore those. Even if we end up supporting multiple keyboards in the future, it's safer to ignore known non-ke

[PATCH 1/6] usb: xhci: refactor xhci_set_configuration

2024-02-20 Thread Janne Grunau via B4 Relay
From: Janne Grunau In the next step endpoints for multiple interfaces are set up. Move most of the per endpoint initialization to separate function to avoid another identation level. Signed-off-by: Janne Grunau --- drivers/usb/host/xhci.c | 119

[PATCH 5/6] usb: kbd: support Apple Magic Keyboards (2021)

2024-02-20 Thread Janne Grunau via B4 Relay
From: Janne Grunau Apple USB keyboards (Magic Keyboard from 2021 (product id 0x029c)) carry the HID keyboard boot protocol on the second interface descriptor. Probe via vendor and product IDs since the class/subclass/protocol match uses the first interface descriptor. Probe the two first

[PATCH 0/6] USB keyboard improvements for asahi / desktop systems

2024-02-20 Thread Janne Grunau via B4 Relay
evices like Yubikeys emulate a keyboard. since u-boot only binds a single keyboard block this kind of devices from the USB keyboard driver. Signed-off-by: Janne Grunau --- Hector Martin (1): usb: kbd: Ignore Yubikeys Janne Grunau (5): usb: xhci: refactor xhci_set_configuration

[PATCH v2 6/6] efi_selftest: Add symbol character selftest

2024-02-10 Thread Janne Grunau via B4 Relay
From: Janne Grunau Draw symbols from code page 437 code points 0x01 - 01f used by UEFI applications to draw user interfaces using EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL. Add a simple test to displaying the Konami code using symbols used by grub2. The output has to be checked manually on the screen for

[PATCH v2 5/6] efi_selftest: Add box drawing character selftest

2024-02-10 Thread Janne Grunau via B4 Relay
for correctness. To facilitate this, add a three second delay after the output at this point. Signed-off-by: Andre Przywara Suggested-by: Heinrich Schuchardt Signed-off-by: Janne Grunau --- lib/efi_selftest/efi_selftest_textoutput.c | 20 1 file changed, 20 insertions

[PATCH v2 1/6] lib: charset: Fix and extend utf8_to_utf32_stream() documentation

2024-02-10 Thread Janne Grunau via B4 Relay
From: Janne Grunau Suggested-by: Heinrich Schuchardt Signed-off-by: Janne Grunau --- include/charset.h | 14 -- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/include/charset.h b/include/charset.h index 44034c71d3..f1050c903d 100644 --- a/include/charset.h +++ b

[PATCH v2 4/6] efi_selftest: Add international characters test

2024-02-10 Thread Janne Grunau via B4 Relay
screen for correctness. Signed-off-by: Andre Przywara Suggested-by: Heinrich Schuchardt Signed-off-by: Janne Grunau --- lib/efi_selftest/efi_selftest_textoutput.c | 8 1 file changed, 8 insertions(+) diff --git a/lib/efi_selftest/efi_selftest_textoutput.c b/lib/efi_selftest

[PATCH v2 2/6] video: console: Parse UTF-8 character sequences

2024-02-10 Thread Janne Grunau via B4 Relay
From: Janne Grunau efi_console / UEFI applications (grub2, sd-boot, ...) pass UTF-8 character sequences to vidconsole which results in wrong glyphs for code points outside of ASCII. The truetype console expects Unicode code points and bitmap font based consoles expect code page 437 code points

  1   2   >