From 8ed9d6d719e45e9264640fb1691cc79d342da4c6 Mon Sep 17 00:00:00 2001 From: arturo182 Date: Fri, 20 Dec 2024 06:08:56 +0100 Subject: [PATCH 1/2] tess: Print progress while flashing --- board/tess/flash.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/board/tess/flash.sh b/board/tess/flash.sh index 6d22970397a1..7a3306ce3ebd 100755 --- a/board/tess/flash.sh +++ b/board/tess/flash.sh @@ -1,7 +1,7 @@ #!/bin/sh -./output/host/usr/bin/sunxi-fel -v uboot output/images/u-boot-sunxi-with-spl.bin \ +./output/host/usr/bin/sunxi-fel --progress -v uboot output/images/u-boot-sunxi-with-spl.bin \ write 0x42000000 output/images/zImage \ write 0x43000000 output/images/sun8i-t113s-tess.dtb \ write 0x43100000 output/images/boot.scr \ - write 0x43300000 output/images/rootfs.cpio.uboot \ No newline at end of file + write 0x43300000 output/images/rootfs.cpio.uboot From 124db322eeef6e89c1bba709feec8fa5dc521eed Mon Sep 17 00:00:00 2001 From: arturo182 Date: Fri, 20 Dec 2024 06:09:24 +0100 Subject: [PATCH 2/2] tess: Enable ums in uboot --- .../uboot/0001-fix-sunxi-usb-gadget.patch | 79 +++++++++++++++++++ board/tess/uboot/tess_defconfig | 9 +++ 2 files changed, 88 insertions(+) create mode 100644 board/tess/patches/uboot/0001-fix-sunxi-usb-gadget.patch diff --git a/board/tess/patches/uboot/0001-fix-sunxi-usb-gadget.patch b/board/tess/patches/uboot/0001-fix-sunxi-usb-gadget.patch new file mode 100644 index 000000000000..a7a50436986b --- /dev/null +++ b/board/tess/patches/uboot/0001-fix-sunxi-usb-gadget.patch @@ -0,0 +1,79 @@ +--- a/drivers/usb/musb-new/sunxi.c ++++ b/drivers/usb/musb-new/sunxi.c +@@ -429,6 +429,16 @@ static struct musb_hdrc_config musb_config_h3 = { + .ram_bits = SUNXI_MUSB_RAM_BITS, + }; + ++#if CONFIG_IS_ENABLED(DM_USB_GADGET) ++int dm_usb_gadget_handle_interrupts(struct udevice *dev) { ++ struct sunxi_glue *glue = dev_get_priv(dev); ++ struct musb_host_data *host = &glue->mdata; ++ ++ host->host->isr(0, host->host); ++ return 0; ++} ++#endif ++ + static int musb_usb_probe(struct udevice *dev) + { + struct sunxi_glue *glue = dev_get_priv(dev); +@@ -437,10 +447,6 @@ static int musb_usb_probe(struct udevice *dev) + void *base = dev_read_addr_ptr(dev); + int ret; + +-#ifdef CONFIG_USB_MUSB_HOST +- struct usb_bus_priv *priv = dev_get_uclass_priv(dev); +-#endif +- + if (!base) + return -EINVAL; + +@@ -471,25 +477,30 @@ static int musb_usb_probe(struct udevice *dev) + pdata.platform_ops = &sunxi_musb_ops; + pdata.config = glue->cfg->config; + +-#ifdef CONFIG_USB_MUSB_HOST +- priv->desc_before_addr = true; +- +- pdata.mode = MUSB_HOST; +- host->host = musb_init_controller(&pdata, &glue->dev, base); +- if (!host->host) +- return -EIO; +- +- ret = musb_lowlevel_init(host); +- if (!ret) +- printf("Allwinner mUSB OTG (Host)\n"); +-#else +- pdata.mode = MUSB_PERIPHERAL; +- host->host = musb_register(&pdata, &glue->dev, base); +- if (IS_ERR_OR_NULL(host->host)) +- return -EIO; ++ if (IS_ENABLED(CONFIG_USB_MUSB_HOST)) { ++ struct usb_bus_priv *priv = dev_get_uclass_priv(dev); ++ priv->desc_before_addr = true; ++ ++ pdata.mode = MUSB_HOST; ++ host->host = musb_init_controller(&pdata, &glue->dev, base); ++ if (!host->host) ++ return -EIO; ++ ++ return musb_lowlevel_init(host); ++ } else if (CONFIG_IS_ENABLED(DM_USB_GADGET)) { ++ pdata.mode = MUSB_PERIPHERAL; ++ host->host = musb_init_controller(&pdata, &glue->dev, base); ++ if (!host->host) ++ return -EIO; ++ return usb_add_gadget_udc(&glue->dev, &host->host->g); ++ } else { ++ pdata.mode = MUSB_PERIPHERAL; ++ host->host = musb_register(&pdata, &glue->dev, base); ++ if (IS_ERR_OR_NULL(host->host)) ++ return -EIO; + +- printf("Allwinner mUSB OTG (Peripheral)\n"); +-#endif ++ return 0; ++ } + + return ret; + } diff --git a/board/tess/uboot/tess_defconfig b/board/tess/uboot/tess_defconfig index 491a396b139c..1298b6221f36 100644 --- a/board/tess/uboot/tess_defconfig +++ b/board/tess/uboot/tess_defconfig @@ -7,9 +7,18 @@ CONFIG_DRAM_CLK=792 CONFIG_DRAM_ZQ=8092667 CONFIG_SUNXI_MINIMUM_DRAM_MB=128 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set +CONFIG_SYS_STDIO_DEREGISTER=y +# CONFIG_SYS_DEVICE_NULLDEV is not set +CONFIG_CMD_USB_MASS_STORAGE=y +# CONFIG_USB_FUNCTION_FASTBOOT is not set CONFIG_DRAM_SUNXI_ODT_EN=0 CONFIG_DRAM_SUNXI_TPR0=0x004a2195 CONFIG_DRAM_SUNXI_TPR11=0x340000 CONFIG_DRAM_SUNXI_TPR12=0x46 CONFIG_DRAM_SUNXI_TPR13=0x34000100 CONFIG_CONS_INDEX=4 +CONFIG_DM_USB_GADGET=y +CONFIG_USB_MUSB_GADGET=y +CONFIG_USB_GADGET_DOWNLOAD=y +# CONFIG_USB_ETHER is not set +CONFIG_CIRCBUF=y