usb: gadget: f_acm: do not gate TX on DTR
Subsystems (5)
A message that is not in the archive (sent off-list or not yet received): [email protected]
PATCH 1/9 usb: gadget: f_acm: do not gate TX on DTR
The macOS AppleUSBCDC driver never sends the CDC SET_CONTROL_LINE_STATE request for this gadget, which made the U-Boot console input-only: __acm_tx() bailed out before queueing any data.
Drop the DTR check so the console also works on hosts that never assert DTR.
--- drivers/usb/gadget/f_acm.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
drivers/usb/gadget/f_acm.c +6 -3
@@ -493,9 +493,12 @@ static void __acm_tx(struct f_acm *f_acm) do { dm_usb_gadget_handle_interrupts(f_acm->udc); - if (!(f_acm->handshake_bits & ACM_CTRL_DTR)) - break; - + /* + * Local crux bring-up patch: do not gate TX on the host + * having sent CDC SET_CONTROL_LINE_STATE (DTR). The macOS + * AppleUSBCDC driver never delivers that request for this + * gadget, which made the console input-only. + */ if (!f_acm->tx_on) continue;
Signature · 1 line
2.50.1 (Apple Git-155)
Quoted 6 lines · Qing Li
The macOS AppleUSBCDC driver never sends the CDC
SET_CONTROL_LINE_STATErequest for this gadget, which made the U-Boot console input-only:__acm_tx()bailed out before queueing any data.Drop the DTR check so the console also works on hosts that never assert DTR.
Is there a matching Linux kernel side fix ?
What impact does this have on Linux CDC ACM driver ?
PATCH 2/9 usb: gadget: f_acm: zero-initialize stdio_dev
In reply to a message not in the archivedrv_usbacm_init() fills a local struct stdio_dev and registers it without clearing the fields it does not set. With CONFIG_CONSOLE_FLUSH_SUPPORT=y, console_flush() checks sdev->flush for non-NULL and then calls it; on Xiaomi crux the uninitialized field held a leftover pointer, so the first 'go <addr>' command jumped into the splash image and crashed in console_flush().
Zero-initialize the structure so unused callbacks stay NULL.
--- drivers/usb/gadget/f_acm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/gadget/f_acm.c +1 -1
@@ -675,7 +675,7 @@ static int acm_stdio_stop(struct stdio_dev *dev)int drv_usbacm_init (void ) { -struct stdio_dev stdio; +struct stdio_dev stdio = {0 };strcpy (stdio.name,"usbacm" ); stdio.flags =DEV_FLAGS_INPUT |DEV_FLAGS_OUTPUT ;
Signature · 1 line
2.50.1 (Apple Git-155)
Re: [PATCH 2/9] usb: gadget: f_acm: zero-initialize stdio_dev
Quoted 2 lines · Qing Li
drv_usbacm_init()fills a local structstdio_devand registers it without clearing the fields it does not set.
Which fields are those ?
Quoted 26 lines
With
CONFIG_CONSOLE_FLUSH_SUPPORT=y,console_flush()checkssdev->flushfor non-NULL and then calls it; on Xiaomi crux the uninitialized field held a leftover pointer, so the first 'go <addr>' command jumped into the splash image and crashed inconsole_flush().Zero-initialize the structure so unused callbacks stay NULL.
Signed-off-by Qing Li <[email protected]>--- drivers/usb/gadget/f_acm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/usb/gadget/f_acm.c +1
-1@@ -675,7 +675,7 @@ static int acm_stdio_stop(struct stdio_dev *dev)int drv_usbacm_init (void ) { -struct stdio_dev stdio; +struct stdio_dev stdio = {0 };strcpy (stdio.name,"usbacm" ); stdio.flags =DEV_FLAGS_INPUT |DEV_FLAGS_OUTPUT ;
[...]
PATCH 3/9 ufs: bound request size, enforce timeout and latch failures
In reply to a message not in the archiveA single large request (up to 32 MiB, 128 PRDT entries) can stall on some controllers, and a stuck request hung U-Boot forever because the UTP completion timeout was only checked once the link had left SLOWAUTO mode.
- reduce the maximum request size to 4 MiB (16 PRDT entries)
- always enforce the UTP completion timeout
- latch io_failed after a timeout or controller error so further requests fail immediately instead of reusing broken descriptors
--- drivers/ufs/ufs-uclass.c | 30 ++++++++++++++++++++---------- drivers/ufs/ufs.h | 2 ++ 2 files changed, 22 insertions(+), 10 deletions(-)
drivers/ufs/ufs-uclass.c +20 -10
@@ -60,7 +60,7 @@#define MAX_PRDT_ENTRY 262144/* maximum bytes per request */ -#define UFS_MAX_BYTES (128 * 256 * 1024) +#define UFS_MAX_BYTES (4 * 1024 * 1024)static inline bool ufshcd_is_hba_active (struct ufs_hba *hba);static inline void ufshcd_hba_stop (struct ufs_hba *hba);
@@ -915,6 +915,9 @@ static int ufshcd_send_command(struct ufs_hba *hba, unsigned int task_tag)u32 intr_status;u32 enabled_intr_status; +if (hba->io_failed) +return -EIO ; +ufshcd_writel (hba,1 << task_tag,REG_UTP_TRANSFER_REQ_DOOR_BELL );/* Make sure doorbell reg is updated before reading interrupt status */
@@ -926,16 +929,15 @@ static int ufshcd_send_command(struct ufs_hba *hba, unsigned int task_tag) enabled_intr_status = intr_status & hba->intr_mask;ufshcd_writel (hba, intr_status,REG_INTERRUPT_STATUS ); -if (hba->max_pwr_info.info.pwr_rx !=SLOWAUTO_MODE && - hba->max_pwr_info.info.pwr_tx !=SLOWAUTO_MODE ) { -if (get_timer (start) >QUERY_REQ_TIMEOUT ) { -dev_err (hba->dev, -"Timedout waiting for UTP response\n" ); -return -ETIMEDOUT ; - } +if (get_timer (start) >QUERY_REQ_TIMEOUT ) { + hba->io_failed = true; +dev_err (hba->dev, +"Timedout waiting for UTP response\n" ); +return -ETIMEDOUT ; }if (enabled_intr_status &UFSHCD_ERROR_MASK ) { + hba->io_failed = true;dev_err (hba->dev,"Error in status:%08x\n" , enabled_intr_status);
@@ -1030,6 +1032,9 @@ static int ufshcd_exec_dev_cmd(struct ufs_hba *hba, enum dev_cmd_type cmd_type,int err;int resp; +if (hba->io_failed) +return -EIO ; + err =ufshcd_comp_devman_upiu (hba, cmd_type);if (err)return err;
@@ -1661,16 +1666,21 @@ static int ufs_scsi_exec(struct udevice *scsi_dev, struct scsi_cmd *pccb) {struct ufs_hba *hba =dev_get_uclass_priv (scsi_dev->parent);u32 upiu_flags; -int ocs, result =0 ; +int err, ocs, result =0 ;u8 scsi_status; +if (hba->io_failed) +return -EIO ; +ufshcd_prepare_req_desc_hdr (hba, &upiu_flags, pccb->dma_dir);ufshcd_prepare_utp_scsi_cmd_upiu (hba, pccb, upiu_flags);prepare_prdt_table (hba, pccb);ufshcd_cache_flush (pccb->pdata, pccb->datalen); -ufshcd_send_command (hba,TASK_TAG ); + err =ufshcd_send_command (hba,TASK_TAG ); +if (err) +return err;ufshcd_cache_invalidate (pccb->pdata, pccb->datalen);
drivers/ufs/ufs.h +2 -0
@@ -719,6 +719,8 @@ struct ufs_hba {struct ufs_pwr_mode_info max_pwr_info;struct ufs_dev_cmd dev_cmd; +/* Do not reuse UTP descriptors after a request failed to quiesce. */ +bool io_failed; };static inline int ufshcd_ops_init (struct ufs_hba *hba)
Signature · 1 line
2.50.1 (Apple Git-155)
Re: [PATCH 3/9] ufs: bound request size, enforce timeout and latch failures
Hi.
Quoted 9 lines · Qing Li
A single large request (up to 32 MiB, 128 PRDT entries) can stall on some controllers, and a stuck request hung U-Boot forever because the UTP completion timeout was only checked once the link had left SLOWAUTO mode.
- reduce the maximum request size to 4 MiB (16 PRDT entries)
- always enforce the UTP completion timeout
- latchio_failedafter a timeout or controller error so further requests fail immediately instead of reusing broken descriptors
Could you split this change into multiple commits so it's easier which changes are for with fix ?
Thanks,
Neil
Quoted 100 lines
Signed-off-by Qing Li <[email protected]>--- drivers/ufs/ufs-uclass.c | 30 ++++++++++++++++++++---------- drivers/ufs/ufs.h | 2 ++ 2 files changed, 22 insertions(+), 10 deletions(-)drivers/ufs/ufs-uclass.c +20
-10@@ -60,7 +60,7 @@#define MAX_PRDT_ENTRY 262144/* maximum bytes per request */ -#define UFS_MAX_BYTES (128 * 256 * 1024) +#define UFS_MAX_BYTES (4 * 1024 * 1024)static inline bool ufshcd_is_hba_active (struct ufs_hba *hba);static inline void ufshcd_hba_stop (struct ufs_hba *hba);@@ -915,6 +915,9 @@ static int ufshcd_send_command(struct ufs_hba *hba, unsigned int task_tag)u32 intr_status;u32 enabled_intr_status; +if (hba->io_failed) +return -EIO ; +ufshcd_writel (hba,1 << task_tag,REG_UTP_TRANSFER_REQ_DOOR_BELL );/* Make sure doorbell reg is updated before reading interrupt status */ @@ -926,16 +929,15 @@ static int ufshcd_send_command(struct ufs_hba *hba, unsigned int task_tag) enabled_intr_status = intr_status & hba->intr_mask;ufshcd_writel (hba, intr_status,REG_INTERRUPT_STATUS ); -if (hba->max_pwr_info.info.pwr_rx !=SLOWAUTO_MODE && - hba->max_pwr_info.info.pwr_tx !=SLOWAUTO_MODE ) { -if (get_timer (start) >QUERY_REQ_TIMEOUT ) { -dev_err (hba->dev, -"Timedout waiting for UTP response\n" ); -return -ETIMEDOUT ; - } +if (get_timer (start) >QUERY_REQ_TIMEOUT ) { + hba->io_failed = true; +dev_err (hba->dev, +"Timedout waiting for UTP response\n" ); +return -ETIMEDOUT ; }if (enabled_intr_status &UFSHCD_ERROR_MASK ) { + hba->io_failed = true;dev_err (hba->dev,"Error in status:%08x\n" , enabled_intr_status);@@ -1030,6 +1032,9 @@ static int ufshcd_exec_dev_cmd(struct ufs_hba *hba, enum dev_cmd_type cmd_type,int err;int resp; +if (hba->io_failed) +return -EIO ; + err =ufshcd_comp_devman_upiu (hba, cmd_type);if (err)return err;@@ -1661,16 +1666,21 @@ static int ufs_scsi_exec(struct udevice *scsi_dev, struct scsi_cmd *pccb) {struct ufs_hba *hba =dev_get_uclass_priv (scsi_dev->parent);u32 upiu_flags; -int ocs, result =0 ; +int err, ocs, result =0 ;u8 scsi_status; +if (hba->io_failed) +return -EIO ; +ufshcd_prepare_req_desc_hdr (hba, &upiu_flags, pccb->dma_dir);ufshcd_prepare_utp_scsi_cmd_upiu (hba, pccb, upiu_flags);prepare_prdt_table (hba, pccb);ufshcd_cache_flush (pccb->pdata, pccb->datalen); -ufshcd_send_command (hba,TASK_TAG ); + err =ufshcd_send_command (hba,TASK_TAG ); +if (err) +return err;ufshcd_cache_invalidate (pccb->pdata, pccb->datalen);drivers/ufs/ufs.h +2
-0@@ -719,6 +719,8 @@ struct ufs_hba {struct ufs_pwr_mode_info max_pwr_info;struct ufs_dev_cmd dev_cmd; +/* Do not reuse UTP descriptors after a request failed to quiesce. */ +bool io_failed; };static inline int ufshcd_ops_init (struct ufs_hba *hba)
PATCH 4/9 cmd: Kconfig: fix pstore documentation path
In reply to a message not in the archiveThe pstore Kconfig help refers to doc/pstore.rst, which does not exist; the document is at doc/usage/cmd/pstore.rst.
--- cmd/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
cmd/Kconfig +1 -1
@@ -2600,7 +2600,7 @@ config CMD_PSTORE This provides access to Linux PStore with Rammoops backend. The main feature is to allow to display or save PStore records. - See doc/pstore.rst for more information. + See doc/usage/cmd/pstore.rst for more information. if CMD_PSTORE
Signature · 1 line
2.50.1 (Apple Git-155)
PATCH 5/9 pstore: make the ramoops device tree node optional
In reply to a message not in the archiveU-Boot adds a ramoops reserved-memory node to the OS device tree when CONFIG_CMD_PSTORE is enabled. Some kernels register the same region themselves, for example Qualcomm downstream kernels through the ramoops_memreserve=4M command line parameter; a second ramoops device in the device tree then makes the kernel hang while populating platform devices.
Add CONFIG_CMD_PSTORE_FDT, defaulting to y to keep the existing behaviour, and return early from fdt_fixup_pstore() when it is disabled. The pstore command remains available to display or save records.
--- cmd/Kconfig | 8 ++++++++ cmd/pstore.c | 3 +++ doc/usage/cmd/pstore.rst | 10 +++++++--- 3 files changed, 18 insertions(+), 3 deletions(-)
cmd/Kconfig +8 -0
@@ -2604,6 +2604,14 @@ config CMD_PSTORE if CMD_PSTORE +config CMD_PSTORE_FDT + bool "Add ramoops node to the OS device tree" + default y + help + Add a ramoops reserved-memory node to the OS device tree using the + PStore parameters. Disable this if the kernel registers its own + ramoops device. The pstore command remains available to read records. + config CMD_PSTORE_MEM_ADDR hex "Memory Address" depends on CMD_PSTORE
cmd/pstore.c +3 -0
@@ -491,6 +491,9 @@ void fdt_fixup_pstore(void *blob)u32 addr_cells;u32 size_cells; +if (!IS_ENABLED (CONFIG_CMD_PSTORE_FDT )) +return ; + nodeoffset =fdt_path_offset (blob,"/" );if (nodeoffset <0 ) {/* Not found or something else bad happened. */
doc/usage/cmd/pstore.rst +7 -3
@@ -36,9 +36,13 @@ i.e.:: ramoops.mem_address=0x30000000 ramoops.mem_size=0x100000 ramoops.record_size=0x2000 ramoops.console_size=0x2000 memmap=0x100000$0x30000000 The same values should be set in U-Boot to be able to retrieve the records. -This values can be set at build time in U-Boot configuration file, or at runtime. -U-Boot automatically patches the Device Tree to pass the Ramoops parameters to -the kernel. +These values can be set at build time in the U-Boot configuration file, or at +runtime. With ``CONFIG_CMD_PSTORE_FDT`` enabled, U-Boot automatically adds a +ramoops reserved-memory node to the OS Device Tree using these parameters. +This option defaults to enabled when ``CONFIG_CMD_PSTORE`` is enabled. Disable +it when the kernel registers its own ramoops device, for example through +board-specific kernel parameters. The ``pstore`` command remains available to +read or save records when this option is disabled. The PStore configuration parameters are:
Signature · 1 line
2.50.1 (Apple Git-155)
Re: [PATCH 5/9] pstore: make the ramoops device tree node optional
Quoted 11 lines · Qing Li
U-Boot adds a ramoops reserved-memory node to the OS device tree when
CONFIG_CMD_PSTOREis enabled. Some kernels register the same region themselves, for example Qualcomm downstream kernels through the ramoops_memreserve=4M command line parameter; a second ramoops device in the device tree then makes the kernel hang while populating platform devices.Add
CONFIG_CMD_PSTORE_FDT, defaulting to y to keep the existing behaviour, and return early fromfdt_fixup_pstore()when it is disabled. The pstore command remains available to display or save records.
This is not a NAK. But, I don't like doing something just to work-around downstream (in other words, not to be upstreamed) modifications in the kernel. Is there a really compelling reason to not just fix the downstream tree here instead?
Signature · 1 line
Tom
PATCH 6/9 boot: image: skip FDT reservation replay after the fdt step
In reply to a message not in the archiveboot_fdt_add_mem_rsv_regions() removes the ranges described by gd->fdt_blob (the U-Boot control device tree) before adding those of the new blob. It runs both in the BOOTM_STATE_FDT step and again from image_setup_linux() during BOOTM_STATE_OS_PREP.
In a stepped boot (bootm fdt followed by bootm prep) the second call still sees gd->fdt_blob pointing at the control device tree, so it frees the control tree's ranges a second time. LMB tracks plain ranges, not their owner, so this also drops parts of the OS device tree's reservations before re-adding them; the re-add then fails with -EEXIST for the LMB_NOMAP regions. On Xiaomi crux this lost 128 KiB of the XBL/AOP reservation at 0x85f20000-0x85f3ffff.
Only add the reservations when the separate FDT step has not run.
--- boot/image-board.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
boot/image-board.c +8 -1
@@ -918,7 +918,14 @@ int image_setup_linux(struct bootm_headers *images)/* This function cannot be called without lmb support */ if (!CONFIG_IS_ENABLED (LMB ))return -EFAULT ; -if (CONFIG_IS_ENABLED (OF_LIBFDT )) +/* +* The separate "bootm fdt" state reserves these regions before FDT +* relocation. Don't process them again during prep: gd->fdt_blob still +* names the control FDT, so a second pass can free part of the Linux +* FDT's reservations before trying to add them again. +*/ +if (CONFIG_IS_ENABLED (OF_LIBFDT ) && + !(images->state &BOOTM_STATE_FDT ))boot_fdt_add_mem_rsv_regions (*of_flat_tree);if (IS_ENABLED (CONFIG_SYS_BOOT_GET_CMDLINE )) {
Signature · 1 line
2.50.1 (Apple Git-155)
Re: [PATCH 6/9] boot: image: skip FDT reservation replay after the fdt step
Quoted 13 lines · Qing Li
boot_fdt_add_mem_rsv_regions()removes the ranges described bygd->fdt_blob(the U-Boot control device tree) before adding those of the new blob. It runs both in theBOOTM_STATE_FDTstep and again fromimage_setup_linux()duringBOOTM_STATE_OS_PREP.In a stepped boot (bootm fdt followed by bootm prep) the second call still sees
gd->fdt_blobpointing at the control device tree, so it frees the control tree's ranges a second time. LMB tracks plain ranges, not their owner, so this also drops parts of the OS device tree's reservations before re-adding them; the re-add then fails with-EEXISTfor theLMB_NOMAPregions. On Xiaomi crux this lost 128 KiB of the XBL/AOP reservation at 0x85f20000-0x85f3ffff.
Quoted 1 line
Only add the reservations when the separate FDT step has not run.
Isn't this a more general bug? In other words when you just "bootm" we should be hitting this problem too, why aren't we?
Signature · 1 line
Tom
Re: [PATCH 6/9] boot: image: skip FDT reservation replay after the fdt step
In reply to Qing LiHi Qing,
Quoted 15 lines · Qing Li
boot: image: skip FDT reservation replay after the fdt step
boot_fdt_add_mem_rsv_regions()removes the ranges described bygd->fdt_blob(the U-Boot control device tree) before adding those of the new blob. It runs both in theBOOTM_STATE_FDTstep and again fromimage_setup_linux()duringBOOTM_STATE_OS_PREP.In a stepped boot (bootm fdt followed by bootm prep) the second call still sees
gd->fdt_blobpointing at the control device tree, so it frees the control tree's ranges a second time. LMB tracks plain ranges, not their owner, so this also drops parts of the OS device tree's reservations before re-adding them; the re-add then fails with-EEXISTfor theLMB_NOMAPregions. On Xiaomi crux this lost 128 KiB of the XBL/AOP reservation at 0x85f20000-0x85f3ffff.
Quoted 1 line
Only add the reservations when the separate FDT step has not run.
The free pass comes from 623f6c5b6ab7 ("boot: image-fdt: free old dtb reservations"), so please can you add a Fixes: tag for it?
boot/image-board.c int image_setup_linux(struct bootm_headers *images) · line 920
Quoted 11 lines
Signed-off-by Qing Li <[email protected]>
boot/image-board.c| 9 ++++++++-1 file changed, 8 insertions(+), 1 deletion(-)boot/image-board.c +2
-0@@ -918,7 +918,14 @@ int image_setup_linux(struct bootm_headers *images) +if (CONFIG_IS_ENABLED (OF_LIBFDT ) && + !(images->state &BOOTM_STATE_FDT ))boot_fdt_add_mem_rsv_regions (*of_flat_tree);
This skips the reservations, but boot_relocate_fdt() a few lines below still runs a second time in the stepped case. The 'bootm fdt' step has already relocated the tree and updated images->ft_addr and images->ft_len, so the prep step allocates another block (with a second CONFIG_SYS_FDT_PAD) and copies the tree again, and the first allocation is never freed.
MIPS handles this in boot_reloc_fdt() in arch/mips/lib/bootm.c by skipping both the reservations and the relocation when BOOTM_STATE_FDT is set. I suspect the same makes sense here, e.g. work out the condition once and use it for both calls. What do you think?
Please can you also add a test for this? Sandbox goes through image_setup_linux() and test/py/tests/test_fit.py already uses 'bootm prep', so a 'bootm fdt' followed by 'bootm prep' with a check of the resulting LMB reservations should be enough to catch it.
Regards,
Simon
PATCH 7/9 soc: qcom: smem: expose SoC identification in the environment
In reply to a message not in the archiveqcom_socinfo_init() already exports the serial number. Also export the socinfo id, version, raw id/version and the chip name so board scripts can distinguish SoC revisions and select the matching device tree without decoding SMEM themselves.
--- drivers/soc/qcom/smem.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
drivers/soc/qcom/smem.c +10 -0
@@ -1014,6 +1014,16 @@ int qcom_socinfo_init(void)return -ENOENT ; } +/* Expose the SoC identification for board scripts and diagnostics */ +env_set_ulong ("socinfo_id" ,le32_to_cpu (info->id)); +env_set_ulong ("socinfo_ver" ,le32_to_cpu (info->ver)); +if (offsetof(struct socinfo , raw_id) +sizeof (info->raw_id) <= item_size) { +env_set_ulong ("socinfo_raw_id" ,le32_to_cpu (info->raw_id)); +env_set_ulong ("socinfo_raw_ver" ,le32_to_cpu (info->raw_ver)); + } +if (offsetof(struct socinfo , chip_id) +SMEM_SOCINFO_CHIP_ID_LENGTH <= item_size) +env_set ("socinfo_chip" , info->chip_id); +return 0 ; }
Signature · 1 line
2.50.1 (Apple Git-155)
Re: [PATCH 7/9] soc: qcom: smem: expose SoC identification in the environment
Quoted 17 lines · Qing Li
qcom_socinfo_init()already exports the serial number. Also export the socinfo id, version, raw id/version and the chip name so board scripts can distinguish SoC revisions and select the matching device tree without decoding SMEM themselves.Signed-off-by Qing Li <[email protected]>--- drivers/soc/qcom/smem.c | 10 ++++++++++ 1 file changed, 10 insertions(+)drivers/soc/qcom/smem.c +0
-0@@ -1014,6 +1014,16 @@ int qcom_socinfo_init(void)return -ENOENT ; }
drivers/soc/qcom/smem.c int qcom_socinfo_init(void) · line 1025
Quoted 10 lines
drivers/soc/qcom/smem.c +9
-0+/* Expose the SoC identification for board scripts and diagnostics */ +env_set_ulong ("socinfo_id" ,le32_to_cpu (info->id)); +env_set_ulong ("socinfo_ver" ,le32_to_cpu (info->ver)); +if (offsetof(struct socinfo , raw_id) +sizeof (info->raw_id) <= item_size) { +env_set_ulong ("socinfo_raw_id" ,le32_to_cpu (info->raw_id)); +env_set_ulong ("socinfo_raw_ver" ,le32_to_cpu (info->raw_ver)); + } +if (offsetof(struct socinfo , chip_id) +SMEM_SOCINFO_CHIP_ID_LENGTH <= item_size) +env_set ("socinfo_chip" , info->chip_id);
These variables should be documented under doc/ somewhere in rST, and done in this same patch.
Signature · 1 line
Tom
PATCH 8/9 arm: dts: qcom: sm8150-xiaomi-crux: add board devicetree
In reply to a message not in the archiveAdd the devicetree for the Xiaomi Mi 9 Pro 5G (crux, SM8150). It is based on the sm8150-xiaomi-cepheus devicetree by Alexey Minnekhanov, with the crux-specific reserved-memory layout taken from the stock boot image; the covered peripherals are UFS and its PHYs, PM8150 regulators, the volume key and a simple framebuffer.
Only the USB 2.0 HS PHY is referenced: U-Boot has no driver for the SM8150 QMP USB3/DP PHY and DWC3 fails to probe when a PHY in its list cannot be resolved.
The devicetree has not been synced to dts/upstream yet, so it lives in arch/arm/dts/. Also add a MAINTAINERS entry for the board.
--- arch/arm/dts/sm8150-xiaomi-crux.dts | 612 ++++++++++++++++++++++++++++ board/qualcomm/MAINTAINERS | 5 + 2 files changed, 617 insertions(+) create mode 100644 arch/arm/dts/sm8150-xiaomi-crux.dts
arch/arm/dts/sm8150-xiaomi-crux.dts new file +612 -0
@@ -0,0 +1,612 @@ +// SPDX-License-Identifier: BSD-3-Clause +/* + * Copyright (c) 2021, Alexey Minnekhanov <[email protected]> + * Copyright (c) 2026, Qing Li <[email protected]> + */ + +/dts-v1/; + +#include <dt-bindings/gpio/gpio.h> +#include <dt-bindings/input/input.h> +#include <dt-bindings/input/gpio-keys.h> +#include <dt-bindings/pinctrl/qcom,pmic-gpio.h> +#include <dt-bindings/regulator/qcom,rpmh-regulator.h> +#include "sm8150.dtsi" +#include "pm8150.dtsi" +#include "pm8150b.dtsi" +#include "pm8150l.dtsi" + +/* + * Rewrite reserved memory maps inherited from sm8150.dtsi to match the ones + * used on xiaomi-cepheus. + * Note: this list is ordered by its memory address in sm8150.dtsi. + */ +/delete-node/ &xbl_mem; /* crux: 85d00000+1M dump, 85e00000+1.25M aop */ +/delete-node/ &aop_mem; +/delete-node/ &aop_cmd_db; +/delete-node/ &tz_mem; /* same address but larger, no place for rmtfs_mem! */ +/delete-node/ &rmtfs_mem; /* moved to completely different address */ +/delete-node/ &adsp_mem; /* same start address, but larger size */ +/delete-node/ &mpss_mem; /* same size, shifted higher, due to larger adsp_mem */ +/delete-node/ &venus_mem; /* same size, shifted higher */ +/delete-node/ &slpi_mem; /* same size, shifted higher */ +/delete-node/ &ipa_fw_mem; /* same size, shifted higher */ +/delete-node/ &ipa_gsi_mem; /* same size, shifted higher */ +/delete-node/ &gpu_mem; /* same size, shifted higher */ +/delete-node/ &spss_mem; /* same size, shifted higher */ +/delete-node/ &cdsp_mem; /* same size, shifted higher */ + +/ { + model = "Xiaomi Mi 9 Pro 5G"; + compatible = "xiaomi,crux", "qcom,sm8150"; + chassis-type = "handset"; + qcom,msm-id = <0x153 0x20000>; + qcom,board-id = <0x2b 0x1>; + + aliases { + serial0 = &uart2; + display0 = &framebuffer; + }; + + chosen { + #address-cells = <2>; + #size-cells = <2>; + ranges; + + stdout-path = "serial0:115200n8"; + + framebuffer: framebuffer@9c000000 { + compatible = "simple-framebuffer"; + reg = <0 0x9c000000 0 0x2400000>; + width = <1080>; + height = <2340>; + stride = <(1080 * 4)>; + format = "a8r8g8b8"; + /* + * That's (going to be) a lot of clocks, but it's necessary due + * to unused clk cleanup & no panel driver yet (& no dispcc either).. + */ + clocks = <&gcc GCC_DISP_HF_AXI_CLK>, + <&gcc GCC_DISP_SF_AXI_CLK>; + }; + }; + + gpio_keys { + compatible = "gpio-keys"; + pinctrl-names = "default"; + pinctrl-0 = <&vol_up_pin_a>; + + vol_up { + label = "volume_up"; + gpios = <&pm8150_gpios 6 GPIO_ACTIVE_LOW>; + linux,input-type = <EV_KEY>; + linux,code = <KEY_VOLUMEUP>; + wakeup-source; + debounce-interval = <15>; + }; + + }; + + reserved-memory { + xbl_dump_mem: memory@85d00000 { + no-map; + reg = <0x0 0x85d00000 0x0 0x100000>; + }; + + xbl_aop_mem: memory@85e00000 { + no-map; + reg = <0x0 0x85e00000 0x0 0x140000>; + }; + + aop_cmd_db: memory@85f20000 { + compatible = "qcom,cmd-db"; + no-map; + reg = <0x0 0x85f20000 0x0 0x20000>; + }; + tz_mem: memory@86200000 { + no-map; + reg = <0x0 0x86200000 0x0 0x5500000>; + phandle = <0x594>; + }; + + adsp_mem: memory@8be00000 { + no-map; + reg = <0x0 0x8be00000 0x0 0x2200000>; + }; + + mpss_mem: memory@8e000000 { + no-map; + reg = <0x0 0x8e000000 0x0 0x9600000>; + }; + + venus_mem: memory@97600000 { + no-map; + reg = <0x0 0x97600000 0x0 0x500000>; + }; + + slpi_mem: memory@97b00000 { + no-map; + reg = <0x0 0x97b00000 0x0 0x1400000>; + }; + + ipa_fw_mem: memory@98f00000 { + no-map; + reg = <0x0 0x98f00000 0x0 0x10000>; + }; + + ipa_gsi_mem: memory@98f10000 { + no-map; + reg = <0x0 0x98f10000 0x0 0x5000>; + }; + + gpu_mem: memory@98f15000 { + no-map; + reg = <0x0 0x98f15000 0x0 0x2000>; + }; + + spss_mem: memory@99000000 { + no-map; + reg = <0x0 0x99000000 0x0 0x100000>; + }; + + cdsp_mem: memory@99100000 { + no-map; + reg = <0x0 0x99100000 0x0 0x1400000>; + }; + + cont_splash_mem: memory@9c000000 { + reg = <0x0 0x9c000000 0x0 0x2400000>; + no-map; + }; + + cdsp_sec_mem: memory@a4c00000 { + reg = <0x0 0xa4c00000 0x0 0x3c00000>; + no-map; + }; + + ramoops@b0000000 { + compatible = "ramoops"; + reg = <0x0 0xb0000000 0x0 0x400000>; + console-size = <0x200000>; + ecc-size = <0>; + ftrace-size = <0>; + pmsg-size = <0x200000>; + record-size = <0>; + }; + + /* + * Downstream dynamically allocates rmtfs_mem region using + * dma_alloc_coherent and adds 4k guard pages before and after + * it to workaround some "XPU limitation". + */ + /* rmtfs_lower_guard */ + memory@f4100000 { + no-map; + reg = <0x0 0xf4100000 0x0 0x1000>; + }; + + rmtfs_mem: memory@f4101000 { + compatible = "qcom,rmtfs-mem"; + reg = <0x0 0xf4101000 0x0 0x300000>; + no-map; + + qcom,client-id = <1>; + qcom,vmid = <15>; + }; + + /* rmtfs_upper_guard */ + memory@f4401000 { + no-map; + reg = <0x0 0xf4401000 0x0 0x1000>; + }; + }; + + vdd_boost_vreg: vdd-boost-regulator { + compatible = "regulator-fixed"; + regulator-name = "vdd_boost_vreg"; + startup-delay-us = <4000>; + enable-active-high; + regulator-always-on; + gpio = <&pm8150b_gpios 5 GPIO_ACTIVE_HIGH>; + pinctrl-names = "default"; + pinctrl-0 = <&vdd_boost_en_pin>; + }; + + vph_pwr: vph-pwr-regulator { + compatible = "regulator-fixed"; + regulator-name = "vph_pwr"; + regulator-min-microvolt = <3700000>; + regulator-max-microvolt = <3700000>; + }; + + /* S4 is modeled as a fixed regulator in vendor sources */ + vreg_s4a_1p8: pm8150-s4-regulator { + compatible = "regulator-fixed"; + regulator-name = "vreg_s4a_1p8"; + + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + + regulator-always-on; + regulator-boot-on; + + vin-supply = <&vph_pwr>; + }; +}; + +&apps_rsc { + pm8150-rpmh-regulators { + compatible = "qcom,pm8150-rpmh-regulators"; + qcom,pmic-id = "a"; + + vdd-s1-supply = <&vph_pwr>; + vdd-s2-supply = <&vph_pwr>; + vdd-s3-supply = <&vph_pwr>; + vdd-s4-supply = <&vph_pwr>; + vdd-s5-supply = <&vph_pwr>; + vdd-s6-supply = <&vph_pwr>; + vdd-s7-supply = <&vph_pwr>; + vdd-s8-supply = <&vph_pwr>; + vdd-s9-supply = <&vph_pwr>; + vdd-s10-supply = <&vph_pwr>; + + vdd-l1-l8-l11-supply = <&vreg_s6a_0p9>; + vdd-l2-l10-supply = <&vreg_bob>; + vdd-l3-l4-l5-l18-supply = <&vreg_s6a_0p9>; + vdd-l6-l9-supply = <&vreg_s8c_1p3>; + vdd-l7-l12-l14-l15-supply = <&vreg_s5a_1p9>; + vdd-l13-l16-l17-supply = <&vreg_bob>; + + vreg_s2a_0p6: smps2 { + regulator-min-microvolt = <600000>; + regulator-max-microvolt = <600000>; + regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>; + regulator-name = "pm8150_s2a_0p6"; + }; + + vreg_s5a_1p9: smps5 { + regulator-min-microvolt = <1904000>; + regulator-max-microvolt = <2040000>; + regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>; + regulator-name = "pm8150_s5a_0p6"; + }; + + vreg_s6a_0p9: smps6 { + regulator-min-microvolt = <920000>; + regulator-max-microvolt = <1128000>; + regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>; + regulator-name = "pm8150_s6a_0p9"; + }; + + vreg_l1a_0p75: ldo1 { + regulator-min-microvolt = <752000>; + regulator-max-microvolt = <752000>; + regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>; + regulator-name = "pm8150_l1a_0p75"; + }; + + vreg_l2a_3p1: ldo2 { + regulator-min-microvolt = <3072000>; + regulator-max-microvolt = <3072000>; + regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>; + regulator-name = "pm8150_l2a_3p1"; + }; + + vreg_l3a_0p8: ldo3 { + regulator-min-microvolt = <480000>; + regulator-max-microvolt = <932000>; + regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>; + regulator-name = "pm8150_l3a_0p8"; + }; + + vreg_l5a_0p875: ldo5 { + regulator-min-microvolt = <880000>; + regulator-max-microvolt = <880000>; + regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>; + regulator-name = "pm8150_l5a_0p875"; + }; + + vreg_l6a_1p2: ldo6 { + regulator-min-microvolt = <1200000>; + regulator-max-microvolt = <1200000>; + regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>; + regulator-name = "pm8150_l6a_1p2"; + }; + + vreg_l7a_1p8: ldo7 { + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>; + regulator-name = "pm8150_l7a_1p8"; + }; + + vreg_l9a_1p2: ldo9 { + regulator-min-microvolt = <1200000>; + regulator-max-microvolt = <1200000>; + regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>; + regulator-name = "pm8150_l9a_1p2"; + }; + + vreg_l10a_2p5: ldo10 { + regulator-min-microvolt = <2504000>; + regulator-max-microvolt = <2960000>; + regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>; + regulator-name = "pm8150_l10a_2p5"; + }; + + vreg_l11a_0p8: ldo11 { + regulator-min-microvolt = <800000>; + regulator-max-microvolt = <800000>; + regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>; + regulator-name = "pm8150_l11a_0p8"; + }; + + vreg_l12a_1p8: ldo12 { + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>; + regulator-name = "pm8150_l12a_1p8"; + }; + + /* L13 is unused, but min/max are 3000000 for it. */ + + vreg_l14a_1p8: ldo14 { + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>; + regulator-name = "pm8150_l14a_1p8"; + }; + + vreg_l15a_1p7: ldo15 { + regulator-min-microvolt = <1704000>; + regulator-max-microvolt = <1704000>; + regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>; + regulator-name = "pm8150_l15a_1p7"; + }; + + vreg_l16a_2p7: ldo16 { + regulator-min-microvolt = <2704000>; + regulator-max-microvolt = <2960000>; + regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>; + regulator-name = "pm8150_l16a_2p7"; + }; + + vreg_l17a_3p0: ldo17 { + regulator-min-microvolt = <2856000>; + regulator-max-microvolt = <3008000>; + regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>; + regulator-name = "pm8150_l17a_3p0"; + }; + + vreg_l18a_0p8: ldo18 { + regulator-min-microvolt = <880000>; + regulator-max-microvolt = <912000>; + regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>; + regulator-name = "pm8150_l18a_0p8"; + }; + }; + + pm8150l-rpmh-regulators { + compatible = "qcom,pm8150l-rpmh-regulators"; + qcom,pmic-id = "c"; + + vdd-s1-supply = <&vph_pwr>; + vdd-s2-supply = <&vph_pwr>; + vdd-s3-supply = <&vph_pwr>; + vdd-s4-supply = <&vph_pwr>; + vdd-s5-supply = <&vph_pwr>; + vdd-s6-supply = <&vph_pwr>; + vdd-s7-supply = <&vph_pwr>; + vdd-s8-supply = <&vph_pwr>; + + vdd-l1-l8-supply = <&vreg_s4a_1p8>; + vdd-l2-l3-supply = <&vreg_s8c_1p3>; + vdd-l4-l5-l6-supply = <&vreg_bob>; + vdd-l7-l11-supply = <&vreg_bob>; + vdd-l9-l10-supply = <&vreg_bob>; + + vdd-bob-supply = <&vph_pwr>; + vdd-flash-supply = <&vreg_bob>; + vdd-rgb-supply = <&vreg_bob>; + + vreg_bob: bob { + regulator-min-microvolt = <3350000>; + regulator-max-microvolt = <4000000>; + /* tavil-slim-pgd will request 3300000 */ + regulator-initial-mode = <RPMH_REGULATOR_MODE_AUTO>; + regulator-allow-bypass; + regulator-name = "pm8150l_bob"; + }; + + vreg_s1c_1p1: smps1 { + regulator-min-microvolt = <1128000>; + regulator-max-microvolt = <1128000>; + regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>; + regulator-name = "pm8150l_s1c_1p1"; + }; + + vreg_s8c_1p3: smps8 { + regulator-min-microvolt = <1352000>; + regulator-max-microvolt = <1352000>; + regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>; + regulator-name = "pm8150l_s8c_1p3"; + }; + + vreg_l1c_1p8: ldo1 { + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>; + regulator-name = "pm8150l_l1c_1p8"; + }; + + vreg_l2c_1p3: ldo2 { + regulator-min-microvolt = <1304000>; + regulator-max-microvolt = <1304000>; + regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>; + regulator-name = "pm8150l_l2c_1p3"; + }; + + vreg_l3c_1p2: ldo3 { + regulator-min-microvolt = <1200000>; + regulator-max-microvolt = <1200000>; + regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>; + regulator-name = "pm8150l_l3c_1p2"; + }; + + vreg_l4c_1p8: ldo4 { + regulator-min-microvolt = <1704000>; + regulator-max-microvolt = <2928000>; + regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>; + regulator-name = "pm8150l_l4c_1p8"; + }; + + vreg_l5c_1p8: ldo5 { + regulator-min-microvolt = <1704000>; + regulator-max-microvolt = <2928000>; + regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>; + regulator-name = "pm8150l_l5c_1p8"; + }; + + vreg_l6c_2p9: ldo6 { + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <2960000>; + regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>; + regulator-allow-set-load; + regulator-name = "pm8150l_l6c_2p9"; + }; + + vreg_l7c_3p0: ldo7 { + regulator-min-microvolt = <2856000>; + regulator-max-microvolt = <3104000>; + regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>; + regulator-name = "pm8150l_l7c_3p0"; + }; + + vreg_l8c_1p8: ldo8 { + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>; + regulator-name = "pm8150l_l8c_1p8"; + }; + + vreg_l9c_2p9: ldo9 { + regulator-min-microvolt = <2704000>; + regulator-max-microvolt = <2960000>; + regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>; + regulator-allow-set-load; + regulator-name = "pm8150l_l9c_2p9"; + }; + + vreg_l10c_3p3: ldo10 { + regulator-min-microvolt = <3000000>; + regulator-max-microvolt = <3312000>; + regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>; + regulator-name = "pm8150l_l10c_3p3"; + }; + + vreg_l11c_3p3: ldo11 { + regulator-min-microvolt = <3000000>; + regulator-max-microvolt = <3312000>; + regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>; + regulator-name = "pm8150l_l11c_3p3"; + }; + }; +}; + +&pm8150_gpios { + vol_up_pin_a: vol-up-active { + pins = "gpio6"; + function = "normal"; + input-enable; + bias-pull-up; + qcom,drive-strength = <PMIC_GPIO_STRENGTH_NO>; + }; +}; + +&pm8150b_gpios { + vdd_boost_en_pin: vdd-boost-en-pin { + pins = "gpio12"; + function = "normal"; + output-low; + qcom,drive-strength = <PMIC_GPIO_STRENGTH_HIGH>; + }; +}; + +&pon { + mode-recovery = <0x1>; + mode-bootloader = <0x2>; + mode-rtc = <0x3>; + mode-normal = <0x20>; + mode-panic = <0x21>; +}; + +&pon_pwrkey { + status = "okay"; +}; + +&pon_resin { + linux,code = <KEY_VOLUMEDOWN>; + status = "okay"; +}; + +&tlmm { + /* gpios 0..3 are NFC spi, gpios 126..129 are FP spi */ + gpio-reserved-ranges = <0 4>, <126 4>; + +}; + +&uart2 { + status = "okay"; +}; + +&usb_1 { + status = "okay"; + qcom,select-utmi-as-pipe-clk; +}; + +&usb_1_dwc3 { + /* U-Boot has no driver for the SM8150 QMP USB3/DP PHY, and the + * DWC3 driver fails to probe if any phy in the list is missing. + * Use USB 2.0 only, like the working raphael U-Boot DT. + */ + phys = <&usb_1_hsphy>; + phy-names = "usb2-phy"; + snps,has-lpm-erratum; + snps,hird-threshold = /bits/ 8 <0x10>; + maximum-speed = "high-speed"; + dr_mode = "peripheral"; +}; + +&usb_1_hsphy { + status = "okay"; + vdda-pll-supply = <&vreg_l5a_0p875>; + vdda18-supply = <&vreg_l12a_1p8>; + vdda33-supply = <&vreg_l2a_3p1>; +}; + +&usb_1_qmpphy { + /* No QMP USB3 PHY driver in U-Boot: keep it disabled */ + status = "disabled"; +}; + +&ufs_mem_hc { + status = "okay"; + + reset-gpios = <&tlmm 175 GPIO_ACTIVE_LOW>; + + vcc-supply = <&vreg_l10a_2p5>; + vcc-max-microamp = <750000>; + vccq-supply = <&vreg_l9a_1p2>; + vccq-max-microamp = <700000>; + vccq2-supply = <&vreg_s4a_1p8>; + vccq2-max-microamp = <750000>; +}; + +&ufs_mem_phy { + status = "okay"; + + vdda-phy-supply = <&vreg_l5a_0p875>; + vdda-phy-max-microamp = <90200>; + vdda-pll-supply = <&vreg_l3c_1p2>; + vdda-pll-max-microamp = <19000>; +};
board/qualcomm/MAINTAINERS +5 -0
@@ -22,3 +22,8 @@ QUALCOMM DRAGONWING QCS9100 M: Varadarajan Narayanan <[email protected]> S: Maintained N: qcs9100 + +XIAOMI MI 9 PRO 5G (CRUX) +M: Qing Li <[email protected]> +S: Maintained +N: xiaomi-crux
Signature · 1 line
2.50.1 (Apple Git-155)
PATCH 9/9 board: qualcomm: xiaomi-crux: add board support
In reply to a message not in the archiveAdd the defconfig and default environment for the Xiaomi Mi 9 Pro 5G (crux, SM8150), based on qcom_defconfig plus the phone settings from board/qualcomm/qcom-phone.config.
- build the devicetree from arch/arm/dts because CONFIG_OF_UPSTREAM is disabled for the board: the crux devicetree is not in dts/upstream yet
- disable CONFIG_REQUIRE_SERIAL_CONSOLE: the phone has no externally accessible UART and U-Boot would panic before bringing up the USB console
- probe UFS and bring up the USB CDC-ACM console during preboot so the board is usable without a serial port
- enable the pstore command with the ramoops layout used by the downstream kernel (0xB0000000, 4 MiB, console/pmsg 2 MiB each), but keep CONFIG_CMD_PSTORE_FDT off because that kernel registers its own ramoops device
- enable CONFIG_SUPPORT_RAW_INITRD and CONFIG_OF_LIBFDT_OVERLAY to chainload Android recovery images with raw ramdisks and DTBO overlays
- keep the fastboot buffer in normal DRAM: 0x1A000000 is below the crux DRAM base and cannot be used for DMA; add fastboot_addr_r to the default environment
--- board/qualcomm/xiaomi-crux.env | 50 ++++++++++++++++++++++++++++++++ configs/xiaomi-crux_defconfig | 53 ++++++++++++++++++++++++++++++++++ 2 files changed, 103 insertions(+) create mode 100644 board/qualcomm/xiaomi-crux.env create mode 100644 configs/xiaomi-crux_defconfig
board/qualcomm/xiaomi-crux.env new file +50 -0
@@ -0,0 +1,50 @@ +# Bring-up environment for Xiaomi Mi 9 Pro 5G (crux) +# +# The phone has no external UART, so the first job is to bring the USB +# (CDC-ACM) console up automatically, then drop to the U-Boot shell. + +bootdelay=-1 +loglevel=7 +bootretry=-1 +stdin=serial,button-kbd +stdout=serial,vidconsole +stderr=serial,vidconsole + +# Probe storage and enable the USB serial gadget console on every boot. +preboot=log level 6; scsi scan; run serial_gadget +fastboot_addr_r=0xC0000000 + +serial_gadget=setenv stdin serial,button-kbd,usbacm; \ + setenv stdout serial,vidconsole,usbacm; \ + setenv stderr serial,vidconsole,usbacm; \ + echo "USB CDC-ACM console enabled" + +# Handy shortcuts, mapped to the qcom-phone menu too. +fastboot=fastboot -l $fastboot_addr_r usb 0 +usb_mass_storage=ums 0 scsi 0 + +# Keep autoboot disabled; leave the board at the U-Boot shell for bring-up. +bootcmd=echo "crux U-Boot: starting fastboot mode"; fastboot usb 0 + +menucmd=bootmenu +bootmenu_0=Boot first available device=bootefi bootmgr +bootmenu_1=Enable serial console gadget=run serial_gadget +bootmenu_2=Enable USB mass storage=echo "Press any key to exit UMS"; ums 0 scsi 0 +bootmenu_3=Enable fastboot mode=run fastboot +bootmenu_4=Drop to shell=setenv bootretry -1 +bootmenu_5=Reset device=reset +bootmenu_6=Dump environment=printenv +bootmenu_7=Board info=bdinfo +bootmenu_8=UFS device info=scsi info +bootmenu_9=Reset device=reset + +button_cmd_0_name=Volume Down +button_cmd_0=run menucmd + +# Drop the USB CDC-ACM console (its stop() releases the UDC) and +# start U-Boot's fastboot gadget instead. +usb_fastboot=setenv stdin serial,button-kbd; \ + setenv stdout serial,vidconsole; \ + setenv stderr serial,vidconsole; \ + echo "ACM stopped, starting fastboot"; \ + fastboot usb 0
configs/xiaomi-crux_defconfig new file +53 -0
53 lines not on this page · raw message
Signature · 1 line
2.50.1 (Apple Git-155)