[U-Boot] [PATCH] arm: omap2: am43xx: Enable CONFIG_BLK
From: Suniel Mahesh With DM_MMC enabled, enable CONFIG_BLK to remove this compile warning for am43xx based targets: = WARNING == This board does not use CONFIG_DM_MMC. Please update the board to use CONFIG_DM_MMC before the v2019.04 release. Failure to update by the deadline may result in board removal. See doc/driver-model/MIGRATION.txt for more info. Targets were compile tested, build was clean. Signed-off-by: Suniel Mahesh --- configs/am43xx_evm_defconfig | 2 +- configs/am43xx_evm_qspiboot_defconfig | 2 +- configs/am43xx_evm_rtconly_defconfig | 2 +- configs/am43xx_evm_usbhost_boot_defconfig | 2 +- configs/am43xx_hs_evm_defconfig | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/configs/am43xx_evm_defconfig b/configs/am43xx_evm_defconfig index 4bb5dfe..152f489e 100644 --- a/configs/am43xx_evm_defconfig +++ b/configs/am43xx_evm_defconfig @@ -37,7 +37,7 @@ CONFIG_REGMAP=y CONFIG_SPL_REGMAP=y CONFIG_SYSCON=y CONFIG_SPL_SYSCON=y -# CONFIG_BLK is not set +CONFIG_BLK=y CONFIG_DFU_MMC=y CONFIG_DFU_RAM=y CONFIG_DFU_SF=y diff --git a/configs/am43xx_evm_qspiboot_defconfig b/configs/am43xx_evm_qspiboot_defconfig index 7806b33..09f73d8 100644 --- a/configs/am43xx_evm_qspiboot_defconfig +++ b/configs/am43xx_evm_qspiboot_defconfig @@ -34,7 +34,7 @@ CONFIG_MULTI_DTB_FIT=y CONFIG_ENV_IS_IN_SPI_FLASH=y CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y CONFIG_DM=y -# CONFIG_BLK is not set +CONFIG_BLK=y CONFIG_DFU_MMC=y CONFIG_DFU_RAM=y CONFIG_DFU_SF=y diff --git a/configs/am43xx_evm_rtconly_defconfig b/configs/am43xx_evm_rtconly_defconfig index 1af908a..37a1f2b 100644 --- a/configs/am43xx_evm_rtconly_defconfig +++ b/configs/am43xx_evm_rtconly_defconfig @@ -29,7 +29,7 @@ CONFIG_DEFAULT_DEVICE_TREE="am437x-gp-evm" CONFIG_OF_LIST="am437x-gp-evm am437x-sk-evm am43x-epos-evm am437x-idk-evm" CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y CONFIG_DM=y -# CONFIG_BLK is not set +CONFIG_BLK=y CONFIG_DFU_MMC=y CONFIG_DFU_RAM=y CONFIG_DFU_SF=y diff --git a/configs/am43xx_evm_usbhost_boot_defconfig b/configs/am43xx_evm_usbhost_boot_defconfig index fc474aa..dbc2fe1 100644 --- a/configs/am43xx_evm_usbhost_boot_defconfig +++ b/configs/am43xx_evm_usbhost_boot_defconfig @@ -41,7 +41,7 @@ CONFIG_OF_LIST="am437x-gp-evm am437x-sk-evm am43x-epos-evm am437x-idk-evm" CONFIG_ENV_IS_IN_FAT=y CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y CONFIG_DM=y -# CONFIG_BLK is not set +CONFIG_BLK=y CONFIG_DFU_MMC=y CONFIG_DFU_RAM=y CONFIG_DFU_SF=y diff --git a/configs/am43xx_hs_evm_defconfig b/configs/am43xx_hs_evm_defconfig index fad564d..0a993b0 100644 --- a/configs/am43xx_hs_evm_defconfig +++ b/configs/am43xx_hs_evm_defconfig @@ -40,7 +40,7 @@ CONFIG_DEFAULT_DEVICE_TREE="am437x-gp-evm" CONFIG_OF_LIST="am437x-gp-evm am437x-sk-evm am43x-epos-evm am437x-idk-evm" CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y CONFIG_DM=y -# CONFIG_BLK is not set +CONFIG_BLK=y CONFIG_DFU_MMC=y CONFIG_DFU_RAM=y CONFIG_DFU_SF=y -- 2.7.4 ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
Re: [U-Boot] imx: add i.MX8MQ EVK support
Loop Jacky who has more knowledge in the ddr stuff. > Subject: re: imx: add i.MX8MQ EVK support > > Hi Peng > > In spl.c you have > > _ > static void spl_dram_init(void) > { > /* ddr init */ > if ((get_cpu_rev() & 0xfff) == CHIP_REV_2_1) > ddr_init(&dram_timing); > else > ddr_init(&dram_timing_b0); > } > > _ > > Could you explain why this is dependent on chip rev ? > > It it just the extra frequency in lpddr4_timing.c ? > > __ > { > /* P1 100mts 1D */ > .drate = 100, > .fw_type = FW_1D_IMAGE, > .fsp_cfg = lpddr4_fsp2_cfg, > .fsp_cfg_num = ARRAY_SIZE(lpddr4_fsp2_cfg), > }, > _ > > > Will other i.MX8MQ boards also need this check ? > > > Thanks > Troy ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH v4 3/4] phy: Add USB PHY driver for the cadence USB3
The cdns3-usb-phy driver supports both host and peripheral mode of usb driver which use cadence usb3 IP. Signed-off-by: Sherry Sun --- drivers/phy/Kconfig | 8 ++ drivers/phy/Makefile| 1 + drivers/phy/cdns3-usb-phy.c | 241 3 files changed, 250 insertions(+) create mode 100644 drivers/phy/cdns3-usb-phy.c diff --git a/drivers/phy/Kconfig b/drivers/phy/Kconfig index 957efb3984..6e50365d90 100644 --- a/drivers/phy/Kconfig +++ b/drivers/phy/Kconfig @@ -190,4 +190,12 @@ config MT76X8_USB_PHY This PHY is found on MT76x8 devices supporting USB. +config CDNS3_USB_PHY + bool "Support CDNS3 USB PHY" + depends on PHY + help + Support for the USB PHY in CDNS3 IP. + + This PHY is found on CDNS3 IP devices supporting USB. + endmenu diff --git a/drivers/phy/Makefile b/drivers/phy/Makefile index 90646ca55b..d9933e0439 100644 --- a/drivers/phy/Makefile +++ b/drivers/phy/Makefile @@ -21,3 +21,4 @@ obj-$(CONFIG_MSM8916_USB_PHY) += msm8916-usbh-phy.o obj-$(CONFIG_OMAP_USB2_PHY) += omap-usb2-phy.o obj-$(CONFIG_KEYSTONE_USB_PHY) += keystone-usb-phy.o obj-$(CONFIG_MT76X8_USB_PHY) += mt76x8-usb-phy.o +obj-$(CONFIG_CDNS3_USB_PHY) += cdns3-usb-phy.o diff --git a/drivers/phy/cdns3-usb-phy.c b/drivers/phy/cdns3-usb-phy.c new file mode 100644 index 00..c0d308075b --- /dev/null +++ b/drivers/phy/cdns3-usb-phy.c @@ -0,0 +1,241 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright 2019 NXP + * + * Cadence3 USB PHY driver + * + * Author: Sherry Sun + */ + +#include +#include +#include +#include +#include + +/* PHY registers */ +#define PHY_PMA_CMN_CTRL1 (0xC800 * 4) +#define TB_ADDR_CMN_DIAG_HSCLK_SEL (0x01e0 * 4) +#define TB_ADDR_CMN_PLL0_VCOCAL_INIT_TMR (0x0084 * 4) +#define TB_ADDR_CMN_PLL0_VCOCAL_ITER_TMR (0x0085 * 4) +#define TB_ADDR_CMN_PLL0_INTDIV(0x0094 * 4) +#define TB_ADDR_CMN_PLL0_FRACDIV (0x0095 * 4) +#define TB_ADDR_CMN_PLL0_HIGH_THR (0x0096 * 4) +#define TB_ADDR_CMN_PLL0_SS_CTRL1 (0x0098 * 4) +#define TB_ADDR_CMN_PLL0_SS_CTRL2 (0x0099 * 4) +#define TB_ADDR_CMN_PLL0_DSM_DIAG (0x0097 * 4) +#define TB_ADDR_CMN_DIAG_PLL0_OVRD (0x01c2 * 4) +#define TB_ADDR_CMN_DIAG_PLL0_FBH_OVRD (0x01c0 * 4) +#define TB_ADDR_CMN_DIAG_PLL0_FBL_OVRD (0x01c1 * 4) +#define TB_ADDR_CMN_DIAG_PLL0_V2I_TUNE (0x01C5 * 4) +#define TB_ADDR_CMN_DIAG_PLL0_CP_TUNE (0x01C6 * 4) +#define TB_ADDR_CMN_DIAG_PLL0_LF_PROG (0x01C7 * 4) +#define TB_ADDR_CMN_DIAG_PLL0_TEST_MODE(0x01c4 * 4) +#define TB_ADDR_CMN_PSM_CLK_CTRL (0x0061 * 4) +#define TB_ADDR_XCVR_DIAG_RX_LANE_CAL_RST_TMR (0x40ea * 4) +#define TB_ADDR_XCVR_PSM_RCTRL (0x4001 * 4) +#define TB_ADDR_TX_PSC_A0 (0x4100 * 4) +#define TB_ADDR_TX_PSC_A1 (0x4101 * 4) +#define TB_ADDR_TX_PSC_A2 (0x4102 * 4) +#define TB_ADDR_TX_PSC_A3 (0x4103 * 4) +#define TB_ADDR_TX_DIAG_ECTRL_OVRD (0x41f5 * 4) +#define TB_ADDR_TX_PSC_CAL (0x4106 * 4) +#define TB_ADDR_TX_PSC_RDY (0x4107 * 4) +#define TB_ADDR_RX_PSC_A0 (0x8000 * 4) +#define TB_ADDR_RX_PSC_A1 (0x8001 * 4) +#define TB_ADDR_RX_PSC_A2 (0x8002 * 4) +#define TB_ADDR_RX_PSC_A3 (0x8003 * 4) +#define TB_ADDR_RX_PSC_CAL (0x8006 * 4) +#define TB_ADDR_RX_PSC_RDY (0x8007 * 4) +#define TB_ADDR_TX_TXCC_MGNLS_MULT_000 (0x4058 * 4) +#define TB_ADDR_TX_DIAG_BGREF_PREDRV_DELAY (0x41e7 * 4) +#define TB_ADDR_RX_SLC_CU_ITER_TMR (0x80e3 * 4) +#define TB_ADDR_RX_SIGDET_HL_FILT_TMR (0x8090 * 4) +#define TB_ADDR_RX_SAMP_DAC_CTRL (0x8058 * 4) +#define TB_ADDR_RX_DIAG_SIGDET_TUNE(0x81dc * 4) +#define TB_ADDR_RX_DIAG_LFPSDET_TUNE2 (0x81df * 4) +#define TB_ADDR_RX_DIAG_BS_TM (0x81f5 * 4) +#define TB_ADDR_RX_DIAG_DFE_CTRL1 (0x81d3 * 4) +#define TB_ADDR_RX_DIAG_ILL_IQE_TRIM4 (0x81c7 * 4) +#define TB_ADDR_RX_DIAG_ILL_E_TRIM0(0x81c2 * 4) +#define TB_ADDR_RX_DIAG_ILL_IQ_TRIM0 (0x81c1 * 4) +#define TB_ADDR_RX_DIAG_ILL_IQE_TRIM6 (0x81c9 * 4) +#define TB_ADDR_RX_DIAG_RXFE_TM3 (0x81f8 * 4) +#define TB_ADDR_RX_DIAG_RXFE_TM4 (0x81f9 * 4) +#define TB_ADDR_RX_DIAG_LFPSDET_TUNE (0x81dd * 4) +#define TB_ADDR_RX_DIAG_DFE_CTRL3 (0x81d5 * 4) +#define TB_ADDR_RX_DIAG_SC2C_DELAY (0x81e1 * 4) +#define TB_ADDR_RX_REE_VGA_GAIN_NODFE (0x81bf * 4) +#define TB_ADDR_XCVR_PSM_CAL_TMR (0x4002 * 4) +#define TB_ADDR_XCVR_PSM_A0BYP_TMR (0x4004 * 4) +#define TB_ADDR_XCVR_PSM_A0IN_T
[U-Boot] [PATCH v4 4/4] USB: gadget: core: introduce ->udc_set_speed() method
This patch was copied from kernel commit: 67fdfda4a99ed. Sometimes, the gadget driver we want to run has max_speed lower than what the UDC supports. In such situations, UDC might want to make sure we don't try to connect on speeds not supported by the gadget driver because that will just fail. So here introduce a new optional ->udc_set_speed() method which can be implemented by interested UDC drivers to achieve this purpose. Signed-off-by: Sherry Sun --- drivers/usb/gadget/udc/udc-core.c | 23 +++ include/linux/usb/gadget.h| 2 ++ 2 files changed, 25 insertions(+) diff --git a/drivers/usb/gadget/udc/udc-core.c b/drivers/usb/gadget/udc/udc-core.c index 62b47781dd..8d1d90e3e3 100644 --- a/drivers/usb/gadget/udc/udc-core.c +++ b/drivers/usb/gadget/udc/udc-core.c @@ -267,6 +267,27 @@ EXPORT_SYMBOL_GPL(usb_del_gadget_udc); /* - */ +/** + * usb_gadget_udc_set_speed - tells usb device controller speed supported by + *current driver + * @udc: The device we want to set maximum speed + * @speed: The maximum speed to allowed to run + * + * This call is issued by the UDC Class driver before calling + * usb_gadget_udc_start() in order to make sure that we don't try to + * connect on speeds the gadget driver doesn't support. + */ +static inline void usb_gadget_udc_set_speed(struct usb_udc *udc, + enum usb_device_speed speed) +{ + if (udc->gadget->ops->udc_set_speed) { + enum usb_device_speed s; + + s = min(speed, udc->gadget->max_speed); + udc->gadget->ops->udc_set_speed(udc->gadget, s); + } +} + static int udc_bind_to_driver(struct usb_udc *udc, struct usb_gadget_driver *driver) { int ret; @@ -276,6 +297,8 @@ static int udc_bind_to_driver(struct usb_udc *udc, struct usb_gadget_driver *dri udc->driver = driver; + usb_gadget_udc_set_speed(udc, driver->speed); + ret = driver->bind(udc->gadget); if (ret) goto err1; diff --git a/include/linux/usb/gadget.h b/include/linux/usb/gadget.h index a34f3478f3..78e245a1b5 100644 --- a/include/linux/usb/gadget.h +++ b/include/linux/usb/gadget.h @@ -450,6 +450,8 @@ struct usb_gadget_ops { int (*match_ep)(struct usb_gadget *gadget, struct usb_ep *ep, struct usb_endpoint_descriptor *desc); + void(*udc_set_speed)(struct usb_gadget *gadget, +enum usb_device_speed); }; /** -- 2.17.1 ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH v4 2/4] USB: host: Add the USB3 host driver
Add the USB3 host driver for NXP imx8 platform, and the cadence IP is in it. The USB3 host driver support DM mode, it will probe USB3 host node in dts. Signed-off-by: Sherry Sun --- drivers/usb/host/Kconfig | 9 ++ drivers/usb/host/Makefile| 1 + drivers/usb/host/xhci-imx8.c | 209 +++ 3 files changed, 219 insertions(+) create mode 100644 drivers/usb/host/xhci-imx8.c diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig index ac68aa2d27..8360ca3869 100644 --- a/drivers/usb/host/Kconfig +++ b/drivers/usb/host/Kconfig @@ -95,6 +95,15 @@ config USB_XHCI_FSL depends on !SPL_NO_USB help Enables support for the on-chip xHCI controller on NXP Layerscape SoCs. + +config USB_XHCI_IMX8 + bool "XHCI support for i.MX8" + depends on ARCH_IMX8 + default y + help + Enables support for the on-chip xHCI controller on i.MX8QM and + i.MX8QXP SoCs. + endif # USB_XHCI_HCD config USB_EHCI_HCD diff --git a/drivers/usb/host/Makefile b/drivers/usb/host/Makefile index 6aa574f6f7..e5a0a4ea5a 100644 --- a/drivers/usb/host/Makefile +++ b/drivers/usb/host/Makefile @@ -55,6 +55,7 @@ obj-$(CONFIG_USB_XHCI_OMAP) += xhci-omap.o obj-$(CONFIG_USB_XHCI_PCI) += xhci-pci.o obj-$(CONFIG_USB_XHCI_RCAR) += xhci-rcar.o obj-$(CONFIG_USB_XHCI_STI) += dwc3-sti-glue.o +obj-$(CONFIG_USB_XHCI_IMX8) += xhci-imx8.o # designware obj-$(CONFIG_USB_DWC2) += dwc2.o diff --git a/drivers/usb/host/xhci-imx8.c b/drivers/usb/host/xhci-imx8.c new file mode 100644 index 00..20a0196060 --- /dev/null +++ b/drivers/usb/host/xhci-imx8.c @@ -0,0 +1,209 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright 2019 NXP + * + * NXP i.MX8 USB HOST xHCI Controller (Cadence IP) + * + * Author: Peter Chen + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include "xhci.h" + +/* Declare global data pointer */ +DECLARE_GLOBAL_DATA_PTR; + +/* Host registers */ +#define HCIVERSION_CAPLENGTH 0x1 +#define USBSTS 0x10084 + +/* None-core registers */ +#define USB3_CORE_CTRL10x00 +#define USB3_CORE_STATUS 0x0c +#define USB3_SSPHY_STATUS 0x4c + +/* USB3_CORE_CTRL1 */ +#define ALL_SW_RESET 0xfc00 +#define MODE_STRAP_MASK0x7 +#define PHYAHB_SW_RESETBIT(26) +#define OC_DISABLE BIT(9) +#define HOST_MODE BIT(1) +#define OTG_MODE BIT(0) + +/* USB3_CORE_STATUS */ +#define HOST_POWER_ON_READYBIT(12) + +/* USBSTS */ +#define CONTROLLER_NOT_READY BIT(11) + +/* USB3_SSPHY_STATUS */ +#define CLK_VLD0xf000 + +struct xhci_imx8_data { + void __iomem *usb3_ctrl_base; + void __iomem *usb3_core_base; + struct clk_bulk clks; + struct phy phy; +}; + +static struct xhci_imx8_data imx8_data; + +static int imx8_xhci_init(void) +{ + int ret; + + writel(CLK_VLD, imx8_data.usb3_ctrl_base + USB3_SSPHY_STATUS); + ret = wait_for_bit_le32(imx8_data.usb3_ctrl_base + USB3_SSPHY_STATUS, + CLK_VLD, true, 100, false); + if (ret) { + printf("clkvld is incorrect\n"); + return ret; + } + + clrsetbits_le32(imx8_data.usb3_ctrl_base + USB3_CORE_CTRL1, + MODE_STRAP_MASK, HOST_MODE | OC_DISABLE); + clrbits_le32(imx8_data.usb3_ctrl_base + USB3_CORE_CTRL1, +PHYAHB_SW_RESET); + generic_phy_init(&imx8_data.phy); + + /* clear all sw_rst */ + clrbits_le32(imx8_data.usb3_ctrl_base + USB3_CORE_CTRL1, ALL_SW_RESET); + + debug("wait xhci_power_on_ready\n"); + ret = wait_for_bit_le32(imx8_data.usb3_ctrl_base + USB3_CORE_STATUS, + HOST_POWER_ON_READY, true, 100, false); + if (ret) { + printf("wait xhci_power_on_ready timeout\n"); + return ret; + } + debug("xhci_power_on_ready\n"); + + debug("waiting CNR\n"); + ret = wait_for_bit_le32(imx8_data.usb3_core_base + USBSTS, + CONTROLLER_NOT_READY, false, 100, false); + if (ret) { + printf("wait CNR timeout\n"); + return ret; + } + debug("check CNR has finished\n"); + + return 0; +} + +static void imx8_xhci_reset(void) +{ + /* Set CORE ctrl to default value, that all rst are hold */ + writel(ALL_SW_RESET | OTG_MODE, + imx8_data.usb3_ctrl_base + USB3_CORE_CTRL1); +} + +static int xhci_imx8_clk_init(struct udevice *dev) +{ + int ret; + + ret = clk_get_bulk(dev, &imx8_data.clks); + if (ret) + return ret; + + ret = clk_enable_bulk(&imx8_data.clks); + if (ret) + return ret; + + return 0; +} + +static void xhci_imx8_get_reg_addr(struct udevice *dev) +{ + imx8_data.usb3_ctrl_base = + (void __
[U-Boot] [PATCH v4 0/4] USB: Add cadence USB3 gadget/host/phy driver
These patches introduce new Cadence driver to U-Boot. The first patch is to add the Cadence USB3 IP(CDNS3) core and driver for the usb gadget. The second patch introduce the xhci-imx8 usb host driver separately. The third patch introduce the cdns3 phy driver which can be used for both cdns3 host driver and gadget driver. The cdns3 usb gadget/host/phy driver are all used DM mode. The current driver has been validated on i.MX8 platform. If someone want to test it, please note that the additional dts nodes/ config macros/clock driver are also essential. You can also get my test patches at https://github.com/sherrysun1/u-boot-imx.git to start your test quickly. Changes in v4: - Keep all include list in files sorted. - Delete the unnecessary registers read in code. - Add ret return after wait_for_bit_le32() is failed. - Add macros instead those magic values. Sherry Sun (4): USB: gadget: Add the cadence USB3 gadget driver USB: host: Add the USB3 host driver phy: Add USB PHY driver for the cadence USB3 USB: gadget: core: introduce ->udc_set_speed() method Makefile |1 + doc/device-tree-bindings/usb/cdns-usb3.txt | 39 + drivers/phy/Kconfig|8 + drivers/phy/Makefile |1 + drivers/phy/cdns3-usb-phy.c| 241 +++ drivers/usb/Kconfig|2 + drivers/usb/cdns3/Kconfig | 20 + drivers/usb/cdns3/Makefile |5 + drivers/usb/cdns3/cdns3-generic.c | 113 + drivers/usb/cdns3/cdns3-nxp-reg-def.h | 93 + drivers/usb/cdns3/core.c | 203 ++ drivers/usb/cdns3/core.h | 118 ++ drivers/usb/cdns3/dev-regs-macro.h | 116 + drivers/usb/cdns3/dev-regs-map.h | 117 ++ drivers/usb/cdns3/gadget-export.h | 26 + drivers/usb/cdns3/gadget.c | 2218 drivers/usb/cdns3/gadget.h | 225 ++ drivers/usb/cdns3/io.h | 30 + drivers/usb/gadget/epautoconf.c|4 + drivers/usb/gadget/gadget_chips.h |7 + drivers/usb/gadget/udc/Makefile|1 + drivers/usb/gadget/udc/udc-core.c | 23 + drivers/usb/host/Kconfig |9 + drivers/usb/host/Makefile |1 + drivers/usb/host/xhci-imx8.c | 209 ++ include/linux/usb/gadget.h |5 + scripts/Makefile.spl |1 + 27 files changed, 3836 insertions(+) create mode 100644 doc/device-tree-bindings/usb/cdns-usb3.txt create mode 100644 drivers/phy/cdns3-usb-phy.c create mode 100644 drivers/usb/cdns3/Kconfig create mode 100644 drivers/usb/cdns3/Makefile create mode 100644 drivers/usb/cdns3/cdns3-generic.c create mode 100644 drivers/usb/cdns3/cdns3-nxp-reg-def.h create mode 100644 drivers/usb/cdns3/core.c create mode 100644 drivers/usb/cdns3/core.h create mode 100644 drivers/usb/cdns3/dev-regs-macro.h create mode 100644 drivers/usb/cdns3/dev-regs-map.h create mode 100644 drivers/usb/cdns3/gadget-export.h create mode 100644 drivers/usb/cdns3/gadget.c create mode 100644 drivers/usb/cdns3/gadget.h create mode 100644 drivers/usb/cdns3/io.h create mode 100644 drivers/usb/host/xhci-imx8.c -- 2.17.1 ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
Re: [U-Boot] [PATCH v3 2/4] USB: host: Add the USB3 host driver
Hi Marek, > > On 8/16/19 8:10 AM, Sherry Sun wrote: > > [...] > > > diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig index > > ac68aa2d27..cc1dfe463b 100644 > > --- a/drivers/usb/host/Kconfig > > +++ b/drivers/usb/host/Kconfig > > @@ -95,6 +95,15 @@ config USB_XHCI_FSL > > depends on !SPL_NO_USB > > help > > Enables support for the on-chip xHCI controller on NXP Layerscape > SoCs. > > + > > +config USB_XHCI_IMX8 > > + bool "XHCI support for imx8" > > i.MX8 I guess ? Yes, you are right, I have changed these to i.MX8 instead of imx8. > > [...] > > > diff --git a/drivers/usb/host/xhci-imx8.c > > b/drivers/usb/host/xhci-imx8.c new file mode 100644 index > > 00..0669a05c17 > > --- /dev/null > > +++ b/drivers/usb/host/xhci-imx8.c > > @@ -0,0 +1,189 @@ > > +// SPDX-License-Identifier: GPL-2.0+ > > +/* > > + * Copyright 2019 NXP > > + * > > + * NXP i.MX8 USB HOST xHCI Controller (Cadence IP) > > + * > > + * Author: Peter Chen */ > > + > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > Keep the list sorted Okay, I have done this. > > > +#include "xhci.h" > > + > > +/* Declare global data pointer */ > > +DECLARE_GLOBAL_DATA_PTR; > > + > > +/* Host registers */ > > +#define HCIVERSION_CAPLENGTH 0x1 > > +#define USBSTS0x10084 > > + > > +/* None-core registers */ > > +#define USB3_CORE_CTRL10x00 > > +#define USB3_CORE_STATUS 0x0c > > +#define USB3_SSPHY_STATUS 0x4c > > + > > +struct xhci_imx8_data { > > + void __iomem *usb3_ctrl_base; > > + void __iomem *usb3_core_base; > > + struct clk_bulk clks; > > + struct phy phy; > > +}; > > + > > +static struct xhci_imx8_data imx8_data; > > + > > +static void imx8_xhci_init(void) > > +{ > > + u32 tmp_data; > > + int ret; > > + > > + tmp_data = readl(imx8_data.usb3_ctrl_base + USB3_SSPHY_STATUS); > > + writel(tmp_data, imx8_data.usb3_ctrl_base + USB3_SSPHY_STATUS); > > Is this read-write really needed ? I reviewed this register definition. And found the read is not needed, but the write is needed. I have changed this read-write already. > > > + tmp_data = readl(imx8_data.usb3_ctrl_base + USB3_SSPHY_STATUS); > > + ret = wait_for_bit_le32(imx8_data.usb3_ctrl_base + USB3_SSPHY_STATUS, > > + 0xf000, true, 100, false); > > + if (ret) > > + printf("clkvld is incorrect\n"); > > Shouldn't this return ret ? Okay, have done this. > > > + clrsetbits_le32(imx8_data.usb3_ctrl_base + USB3_CORE_CTRL1, > > + 0x7, 0x202); > > + clrbits_le32(imx8_data.usb3_ctrl_base + USB3_CORE_CTRL1, 1 << 26); > > + generic_phy_init(&imx8_data.phy); > > + > > + /* clear all sw_rst */ > > + clrbits_le32(imx8_data.usb3_ctrl_base + USB3_CORE_CTRL1, 0xFC << > > +24); > > + > > + debug("wait xhci_power_on_ready\n"); > > + ret = wait_for_bit_le32(imx8_data.usb3_ctrl_base + USB3_CORE_STATUS, > > + 0x1000, true, 100, false); > > + if (ret) > > + printf("wait xhci_power_on_ready timeout\n"); > > return ret on failure ? Okay, have done this. > > > + debug("xhci_power_on_ready\n"); > > + > > + debug("waiting CNR 0x%x\n", tmp_data); > > + ret = wait_for_bit_le32(imx8_data.usb3_core_base + USBSTS, > > + 0x800, false, 100, false); > > + if (ret) > > + printf("wait CNR timeout\n"); > > return ret on failure ? Okay, have done this. > > > + debug("check CNR has finished\n"); > > +} > > + > > +static void imx8_xhci_reset(void) > > +{ > > + /* Set CORE ctrl to default value, that all rst are hold */ > > + writel(0xfc01, imx8_data.usb3_ctrl_base + USB3_CORE_CTRL1); > > What are these magic values ? Add macros for them. Okay, have done this. > > > +} > > + > > +static int xhci_imx8_clk_init(struct udevice *dev) { > > + int ret; > > + > > + ret = clk_get_bulk(dev, &imx8_data.clks); > > + if (ret) > > + return ret; > > + > > + ret = clk_enable_bulk(&imx8_data.clks); > > + if (ret) > > + return ret; > > + > > + return 0; > > +} > > + > > +static int xhci_imx8_get_reg_addr(struct udevice *dev) { > > + imx8_data.usb3_ctrl_base = > > + (void __iomem *)devfdt_get_addr_index(dev, 0); > > + imx8_data.usb3_core_base = > > + (void __iomem *)devfdt_get_addr_index(dev, 4); > > + > > + return 0; > > +} > > + > > +static int xhci_imx8_probe(struct udevice *dev) { > > + struct xhci_hccr *hccr; > > + struct xhci_hcor *hcor; > > + struct udevice usbotg_dev; > > + struct power_domain pd; > > + int usbotg_off; > > + int ret = 0; > > + int len; > > + > > + usbotg_off = fdtdec_lookup_phandle(gd->fdt_blob, > > + dev_of_offset(dev), > > + "cdns3,usb"); > > + if (usbo
Re: [U-Boot] Question about GPL v3 font
On Fri, Aug 16, 2019 at 2:13 AM Tom Rini wrote: > > On Tue, Aug 13, 2019 at 03:34:20AM -0600, Simon Glass wrote: > > Hi, > > > > On Fri, 26 Jul 2019 at 11:07, Tom Rini wrote: > > > > > > On Fri, Jul 26, 2019 at 06:42:47PM +0900, Masahiro Yamada wrote: > > > > > > > Hi. > > > > > > > > According to the Kconfig entry, > > > > drivers/video/fonts/nimbus_sans_l_regular.ttf > > > > is licensed under GPL v3. > > > > > > > > How the license is handled when U-Boot is compiled with > > > > CONFIG_CONSOLE_TRUETYPE_NIMBUS=y ? > > > > > > > > I am asking this since many companies, I guess, > > > > have GPL-v3 allergy. > > > > > > > > > > > > config CONSOLE_TRUETYPE_NIMBUS > > > > bool "Nimbus Sans Regular" > > > > depends on CONSOLE_TRUETYPE > > > > default y > > > > help > > > > Nimbus Sans L is a version of Nimbus Sans using Adobe font > > > > sources. > > > > It was designed in 1987. A subset of Nimbus Sans L were > > > > released > > > > under the GPL. Although the characters are not exactly the > > > > same, > > > > Nimbus Sans L has metrics almost identical to Helvetica and > > > > Arial. > > > > (From Wikipedia, the free encyclopedia) > > > > From: https://fontlibrary.org/en/font/nimbus-sans-l > > > > License: GNU GPL v3 > > > > http://www.gnu.org/copyleft/gpl.html > > > > > > It's a good question. I suspect the answer is that we should drop that > > > font as I don't know if you can combine "GPLv2 only" and "GPLv2 or > > > later" with "GPLv3". > > > > Yes, agreed. Can we find another similar font? Is it important to have a *similar* font? We have 3 more fonts in drivers/video/fonts/, so they should be functional at least. The license incompatibility is a more fatal problem. So, we should drop this font as soon as possible. When _we_ find nice fonts, we can add them later. It is desirable, but not important. > > Depends on who "we" is I suppose. Yes, I would love to see someone > submit a new font that's GPLv2 only compatible. > > -- > Tom > ___ > U-Boot mailing list > U-Boot@lists.denx.de > https://lists.denx.de/listinfo/u-boot -- Best Regards Masahiro Yamada ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
Re: [U-Boot] imx: add i.MX8MQ EVK support
Hi Peng In spl.c you have _ static void spl_dram_init(void) { /* ddr init */ if ((get_cpu_rev() & 0xfff) == CHIP_REV_2_1) ddr_init(&dram_timing); else ddr_init(&dram_timing_b0); } _ Could you explain why this is dependent on chip rev ? It it just the extra frequency in lpddr4_timing.c ? __ { /* P1 100mts 1D */ .drate = 100, .fw_type = FW_1D_IMAGE, .fsp_cfg = lpddr4_fsp2_cfg, .fsp_cfg_num = ARRAY_SIZE(lpddr4_fsp2_cfg), }, _ Will other i.MX8MQ boards also need this check ? Thanks Troy ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
Re: [U-Boot] [PATCH 2/2] mmc: Rename timeout parameters for clarification
> Subject: [PATCH 2/2] mmc: Rename timeout parameters for clarification > > It's quite hard to figure out time units for various function that have > timeout > parameters. This leads to possible errors when one forgets to convert ms to > us, for example. Let's rename those parameters correspondingly to > 'timeout_us' and 'timeout_ms' to prevent such issues further. > > While at it, add time units info as comments to struct mmc fields. > > This commit doesn't change the behavior, only renames parameters names. > Buildman should report no changes at all. > > Signed-off-by: Sam Protsenko > --- > drivers/mmc/mmc-uclass.c | 8 > drivers/mmc/mmc.c | 24 > drivers/mmc/mmc_write.c| 8 > drivers/mmc/omap_hsmmc.c | 6 +++--- > drivers/mmc/renesas-sdhi.c | 7 --- > include/mmc.h | 12 ++-- > 6 files changed, 33 insertions(+), 32 deletions(-) > > diff --git a/drivers/mmc/mmc-uclass.c b/drivers/mmc/mmc-uclass.c index > 551007905c..f740bae3c7 100644 > --- a/drivers/mmc/mmc-uclass.c > +++ b/drivers/mmc/mmc-uclass.c > @@ -47,18 +47,18 @@ int mmc_set_ios(struct mmc *mmc) > return dm_mmc_set_ios(mmc->dev); > } > > -int dm_mmc_wait_dat0(struct udevice *dev, int state, int timeout) > +int dm_mmc_wait_dat0(struct udevice *dev, int state, int timeout_us) > { > struct dm_mmc_ops *ops = mmc_get_ops(dev); > > if (!ops->wait_dat0) > return -ENOSYS; > - return ops->wait_dat0(dev, state, timeout); > + return ops->wait_dat0(dev, state, timeout_us); > } > > -int mmc_wait_dat0(struct mmc *mmc, int state, int timeout) > +int mmc_wait_dat0(struct mmc *mmc, int state, int timeout_us) > { > - return dm_mmc_wait_dat0(mmc->dev, state, timeout); > + return dm_mmc_wait_dat0(mmc->dev, state, timeout_us); > } > > int dm_mmc_get_wp(struct udevice *dev) > diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c index > e247730ff2..c8f71cd0c1 100644 > --- a/drivers/mmc/mmc.c > +++ b/drivers/mmc/mmc.c > @@ -31,7 +31,7 @@ static int mmc_select_mode_and_width(struct mmc > *mmc, uint card_caps); > > #if !CONFIG_IS_ENABLED(DM_MMC) > > -static int mmc_wait_dat0(struct mmc *mmc, int state, int timeout) > +static int mmc_wait_dat0(struct mmc *mmc, int state, int timeout_us) > { > return -ENOSYS; > } > @@ -230,12 +230,12 @@ int mmc_send_status(struct mmc *mmc, unsigned > int *status) > return -ECOMM; > } > > -int mmc_poll_for_busy(struct mmc *mmc, int timeout) > +int mmc_poll_for_busy(struct mmc *mmc, int timeout_ms) > { > unsigned int status; > int err; > > - err = mmc_wait_dat0(mmc, 1, timeout * 1000); > + err = mmc_wait_dat0(mmc, 1, timeout_ms * 1000); > if (err != -ENOSYS) > return err; > > @@ -256,13 +256,13 @@ int mmc_poll_for_busy(struct mmc *mmc, int > timeout) > return -ECOMM; > } > > - if (timeout-- <= 0) > + if (timeout_ms-- <= 0) > break; > > udelay(1000); > } > > - if (timeout <= 0) { > + if (timeout_ms <= 0) { > #if !defined(CONFIG_SPL_BUILD) || > defined(CONFIG_SPL_LIBCOMMON_SUPPORT) > pr_err("Timeout waiting card ready\n"); #endif @@ -750,17 > +750,17 @@ static int __mmc_switch(struct mmc *mmc, u8 set, u8 index, u8 > value, { > unsigned int status, start; > struct mmc_cmd cmd; > - int timeout = DEFAULT_CMD6_TIMEOUT_MS; > + int timeout_ms = DEFAULT_CMD6_TIMEOUT_MS; > bool is_part_switch = (set == EXT_CSD_CMD_SET_NORMAL) && > (index == EXT_CSD_PART_CONF); > int retries = 3; > int ret; > > if (mmc->gen_cmd6_time) > - timeout = mmc->gen_cmd6_time * 10; > + timeout_ms = mmc->gen_cmd6_time * 10; > > if (is_part_switch && mmc->part_switch_time) > - timeout = mmc->part_switch_time * 10; > + timeout_ms = mmc->part_switch_time * 10; > > cmd.cmdidx = MMC_CMD_SWITCH; > cmd.resp_type = MMC_RSP_R1b; > @@ -778,7 +778,7 @@ static int __mmc_switch(struct mmc *mmc, u8 set, > u8 index, u8 value, > start = get_timer(0); > > /* poll dat0 for rdy/buys status */ > - ret = mmc_wait_dat0(mmc, 1, timeout * 1000); > + ret = mmc_wait_dat0(mmc, 1, timeout_ms * 1000); > if (ret && ret != -ENOSYS) > return ret; > > @@ -788,11 +788,11 @@ static int __mmc_switch(struct mmc *mmc, u8 set, > u8 index, u8 value, >* stated timeout to be sufficient. >*/ > if (ret == -ENOSYS && !send_status) > - mdelay(timeout); > + mdelay(timeout_ms); > > /* Finally wait until the card is ready or indicates a failure >* to switch. It doesn't hurt to use CMD13 here even if send_status > - * is false, because by now (after 'timeout' ms) the bus should be > + * is false, because by now (after 'timeout_ms' ms) the bu
Re: [U-Boot] [PATCH 1/2] mmc: Fix timeout values passed to mmc_wait_dat0()
> Subject: [PATCH 1/2] mmc: Fix timeout values passed to mmc_wait_dat0() > > mmc_wait_dat0() expects timeout argument to be in usec units. But some > overlying functions operate on timeout in msec units. Convert timeout from > msec to usec when passing it to mmc_wait_dat0(). > > This fixes 'avb' commands on BeagleBoard X15, because next chain was > failing: > > get_partition() -> mmc_switch_part() -> __mmc_switch() -> > mmc_wait_dat0() > > when passing incorrect timeout from __mmc_switch() to mmc_wait_dat0(). > > Fixes: bb98b8c5c06a ("mmc: During a switch, poll on dat0 if available and > check the final status") > Signed-off-by: Sam Protsenko > --- > drivers/mmc/mmc.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c index > eecc7d687e..e247730ff2 100644 > --- a/drivers/mmc/mmc.c > +++ b/drivers/mmc/mmc.c > @@ -235,7 +235,7 @@ int mmc_poll_for_busy(struct mmc *mmc, int > timeout) > unsigned int status; > int err; > > - err = mmc_wait_dat0(mmc, 1, timeout); > + err = mmc_wait_dat0(mmc, 1, timeout * 1000); > if (err != -ENOSYS) > return err; > > @@ -778,7 +778,7 @@ static int __mmc_switch(struct mmc *mmc, u8 set, > u8 index, u8 value, > start = get_timer(0); > > /* poll dat0 for rdy/buys status */ > - ret = mmc_wait_dat0(mmc, 1, timeout); > + ret = mmc_wait_dat0(mmc, 1, timeout * 1000); > if (ret && ret != -ENOSYS) > return ret; > Reviewed-by: Peng Fan > -- > 2.20.1 ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
Re: [U-Boot] [PATCH v2 8/9] spl: Introduce SPL_DM_GPIO Kconfig define
> Subject: [PATCH v2 8/9] spl: Introduce SPL_DM_GPIO Kconfig define > > This define indicates if DM_GPIO shall be supported in SPL. This allows proper > operation of DM converted GPIO drivers in SPL, which use > #if !CONFIG_IS_ENABLED(DM_GPIO) to also support not yet DM/DTS > converted boards. > > Signed-off-by: Lukasz Majewski > --- > > Changes in v2: > - New patch > > common/spl/Kconfig | 6 ++ > 1 file changed, 6 insertions(+) > > diff --git a/common/spl/Kconfig b/common/spl/Kconfig index > 44c5ab61ec..0a3877ec28 100644 > --- a/common/spl/Kconfig > +++ b/common/spl/Kconfig > @@ -430,6 +430,12 @@ config SPL_DMA_SUPPORT > the CPU moving the data. Enable this option to build the drivers > in drivers/dma as part of an SPL build. > > +config SPL_DM_GPIO > + bool "Support Driver Model GPIO drivers" > + depends on SPL_GPIO_SUPPORT > + help > + Enable support for Driver Model based GPIO drivers in SPL. > + > config SPL_DRIVERS_MISC_SUPPORT > bool "Support misc drivers" > help Reviewed-by: Peng Fan > -- > 2.11.0 ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
Re: [U-Boot] [PATCH v2 5/9] spi: Add support for SPL_OF_PLATDATA to mxs_spi.c driver
> Subject: [PATCH v2 5/9] spi: Add support for SPL_OF_PLATDATA to mxs_spi.c > driver > > After this patch the mxs_spi.c DM/DTS driver can be used at early SPL to read > payload from SPI-NOR memories. > > It was necessary to adjust its name to 'fsl_imx_2{38}_spi' to match > requirements for SPL_OF_PLATDATA usage. > > Signed-off-by: Lukasz Majewski > --- > > Changes in v2: None > > drivers/spi/mxs_spi.c | 34 -- > 1 file changed, 32 insertions(+), 2 deletions(-) > > diff --git a/drivers/spi/mxs_spi.c b/drivers/spi/mxs_spi.c index > d475830f17..58b1c67a19 100644 > --- a/drivers/spi/mxs_spi.c > +++ b/drivers/spi/mxs_spi.c > @@ -57,7 +57,18 @@ static inline struct mxs_spi_slave *to_mxs_slave(struct > spi_slave *slave) #else #include #include > +#include > + > +#ifdef CONFIG_MX28 > +#define dtd_fsl_imx_spi dtd_fsl_imx28_spi #else /* CONFIG_MX23 */ > +#define dtd_fsl_imx_spi dtd_fsl_imx23_spi #endif > + > struct mxs_spi_platdata { > +#if CONFIG_IS_ENABLED(OF_PLATDATA) > + struct dtd_fsl_imx_spi dtplat; > +#endif > s32 frequency; /* Default clock frequency, -1 for none */ > fdt_addr_t base;/* SPI IP block base address */ > int num_cs; /* Number of CSes supported */ > @@ -430,11 +441,26 @@ static int mxs_spi_probe(struct udevice *bus) > int ret; > > debug("%s: probe\n", __func__); > + > +#if CONFIG_IS_ENABLED(OF_PLATDATA) > + struct dtd_fsl_imx_spi *dtplat = &plat->dtplat; > + struct phandle_1_arg *p1a = &dtplat->clocks[0]; > + > + priv->regs = (struct mxs_ssp_regs *)dtplat->reg[0]; > + priv->dma_channel = dtplat->dmas[1]; > + priv->clk_id = p1a->arg[0]; > + priv->max_freq = dtplat->spi_max_frequency; > + plat->num_cs = dtplat->num_cs; > + > + debug("OF_PLATDATA: regs: 0x%x max freq: %d clkid: %d\n", > + (unsigned int)priv->regs, priv->max_freq, priv->clk_id); #else > priv->regs = (struct mxs_ssp_regs *)plat->base; > priv->max_freq = plat->frequency; > > priv->dma_channel = plat->dma_id; > priv->clk_id = plat->clk_id; > +#endif > > mxs_reset_block(&priv->regs->hw_ssp_ctrl0_reg); > > @@ -571,16 +597,20 @@ static int mxs_ofdata_to_platdata(struct udevice > *bus) > > return 0; > } > -#endif > > static const struct udevice_id mxs_spi_ids[] = { > { .compatible = "fsl,imx23-spi" }, > { .compatible = "fsl,imx28-spi" }, > { } > }; > +#endif > > U_BOOT_DRIVER(mxs_spi) = { > - .name = "mxs_spi", > +#ifdef CONFIG_MX28 > + .name = "fsl_imx28_spi", > +#else /* CONFIG_MX23 */ > + .name = "fsl_imx23_spi", > +#endif > .id = UCLASS_SPI, > #if CONFIG_IS_ENABLED(OF_CONTROL) > && !CONFIG_IS_ENABLED(OF_PLATDATA) > .of_match = mxs_spi_ids, Reviewed-by: Peng Fan > -- > 2.11.0 ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
Re: [U-Boot] [PATCH v2 4/9] spi: fix: Call mxs_reset_block() during DM/DTS probe
> Subject: [PATCH v2 4/9] spi: fix: Call mxs_reset_block() during DM/DTS probe > > Without this change the DM/DTS version of mxs_spi driver doesn't reset the > SPI IP block in probe. > As a result this driver (when used solely on U-Boot proper) relies on reset > performed by mxs spi driver in SPL. > > In the use case where eMMC is used in SPL as a boot primary device, the > mxs_reset_block() is not called at all and DM/DTS aware SPI driver in U-Boot > proper is malfunctioning. > > Signed-off-by: Lukasz Majewski > --- > > Changes in v2: None > > drivers/spi/mxs_spi.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/drivers/spi/mxs_spi.c b/drivers/spi/mxs_spi.c index > b1cc83aab1..d475830f17 100644 > --- a/drivers/spi/mxs_spi.c > +++ b/drivers/spi/mxs_spi.c > @@ -436,6 +436,8 @@ static int mxs_spi_probe(struct udevice *bus) > priv->dma_channel = plat->dma_id; > priv->clk_id = plat->clk_id; > > + mxs_reset_block(&priv->regs->hw_ssp_ctrl0_reg); > + > ret = mxs_dma_init_channel(priv->dma_channel); > if (ret) { > printf("%s: DMA init channel error %d\n", __func__, ret); Acked-by: Peng Fan > -- > 2.11.0 ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
Re: [U-Boot] [PATCH v2 3/9] spl: Init proper struct driver member (platdata_auto_alloc_size) for mxs_spi
> Subject: [PATCH v2 3/9] spl: Init proper struct driver member > (platdata_auto_alloc_size) for mxs_spi > > This change initializes proper member of struct driver - > platdata_auto_alloc_size instead of priv_auto_alloc_size, which is setup > twice. > > Signed-off-by: Lukasz Majewski > > --- > > Changes in v2: > - New patch > > drivers/spi/mxs_spi.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/spi/mxs_spi.c b/drivers/spi/mxs_spi.c index > 3a9756fbf1..b1cc83aab1 100644 > --- a/drivers/spi/mxs_spi.c > +++ b/drivers/spi/mxs_spi.c > @@ -584,7 +584,7 @@ U_BOOT_DRIVER(mxs_spi) = { > .of_match = mxs_spi_ids, > .ofdata_to_platdata = mxs_ofdata_to_platdata, #endif > - .priv_auto_alloc_size = sizeof(struct mxs_spi_platdata), > + .platdata_auto_alloc_size = sizeof(struct mxs_spi_platdata), > .ops= &mxs_spi_ops, > .priv_auto_alloc_size = sizeof(struct mxs_spi_priv), > .probe = mxs_spi_probe, Reviewed-by: Peng Fan > -- > 2.11.0 ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
Re: [U-Boot] [PATCH v2 1/9] doc: fix: Replace SPL_OF_PLATDATA with OF_PLATDATA in examples
> Subject: [PATCH v2 1/9] doc: fix: Replace SPL_OF_PLATDATA with > OF_PLATDATA in examples > > The of-plat.rst file till this change has been using #if > CONFIG_IS_ENABLED(SPL_OF_PLATDATA) it its examples. > > This is at best misleading as SPL_OF_PLATDATA is always defined when we > want to use this SPL tinification feature (also in U-Boot proper). > As a result the OF_PLATDATA SPL specific code is also compiled in when > U-Boot proper is build. > > Signed-off-by: Lukasz Majewski > --- > > Changes in v2: None > > doc/driver-model/of-plat.rst | 8 > 1 file changed, 4 insertions(+), 4 deletions(-) > > diff --git a/doc/driver-model/of-plat.rst b/doc/driver-model/of-plat.rst index > 0d3cd8c01e..a38e58e4d2 100644 > --- a/doc/driver-model/of-plat.rst > +++ b/doc/driver-model/of-plat.rst > @@ -224,7 +224,7 @@ For example: > #include > > struct mmc_platdata { > -#if CONFIG_IS_ENABLED(SPL_OF_PLATDATA) > +#if CONFIG_IS_ENABLED(OF_PLATDATA) > /* Put this first since driver model will copy the data here */ > struct dtd_mmc dtplat; > #endif > @@ -237,7 +237,7 @@ For example: > > static int mmc_ofdata_to_platdata(struct udevice *dev) > { > -#if !CONFIG_IS_ENABLED(SPL_OF_PLATDATA) > +#if !CONFIG_IS_ENABLED(OF_PLATDATA) > /* Decode the device tree data */ > struct mmc_platdata *plat = dev_get_platdata(dev); > const void *blob = gd->fdt_blob; @@ -253,7 +253,7 @@ For > example: > { > struct mmc_platdata *plat = dev_get_platdata(dev); > > -#if CONFIG_IS_ENABLED(SPL_OF_PLATDATA) > +#if CONFIG_IS_ENABLED(OF_PLATDATA) > /* Decode the of-platdata from the C structures */ > struct dtd_mmc *dtplat = &plat->dtplat; > > @@ -308,7 +308,7 @@ The dt-structs.h file includes the generated file > (include/generated//dt-structs.h) if CONFIG_SPL_OF_PLATDATA is enabled. > Otherwise (such as in U-Boot proper) these structs are not available. This > prevents them being used inadvertently. All usage must be bracketed with -#if > CONFIG_IS_ENABLED(SPL_OF_PLATDATA). > +#if CONFIG_IS_ENABLED(OF_PLATDATA). > > The dt-platdata.c file contains the device declarations and is is built in > spl/dt-platdata.c. Reviewed-by: Peng Fan > -- > 2.11.0 ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
Re: [U-Boot] [PATCH v2 2/9] dts: imx28: Remove #include "imx28.dtsi" from imx28-u-boot.dtsi file
> Subject: [PATCH v2 2/9] dts: imx28: Remove #include "imx28.dtsi" from > imx28-u-boot.dtsi file > > After this change it is possible to use imx28--u-boot.dtsi with the > imx28-u-boot.dtsi explicitly included without breaking setup from > imx28-.dts file. > > The problem is that the imx28.dtsi included in a wrong place overrides the > changes made in imx28-.dts. As a result some devices are "disabled" > in the final DTB. > > Signed-off-by: Lukasz Majewski > --- > > Changes in v2: None > > arch/arm/dts/imx28-u-boot.dtsi | 1 - > 1 file changed, 1 deletion(-) > > diff --git a/arch/arm/dts/imx28-u-boot.dtsi > b/arch/arm/dts/imx28-u-boot.dtsi index d545b402a7..9db72a6be3 100644 > --- a/arch/arm/dts/imx28-u-boot.dtsi > +++ b/arch/arm/dts/imx28-u-boot.dtsi > @@ -5,7 +5,6 @@ > * > * SPDX-License-Identifier: GPL-2.0+ or X11 > */ > -#include "imx28.dtsi" > > &gpio0 { > gpio-ranges = <&pinctrl 0 0 29>; Reviewed-by: Peng Fan > -- > 2.11.0 ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] Please pull u-boot-x86
Hi Tom, This PR includes the following changes in x86: - QEMU build warning fix when CONFIG_DISTRO_DEFAULTS=n - Small fixes on x86 reST docs - Allow CBFS to be used in SPL - Remove x86 specific GD flags The following changes since commit 81fed78c0a59af0d5698b13608eb4d26be84f397: Merge tag 'efi-2019-10-rc3' of https://gitlab.denx.de/u-boot/custodians/u-boot-efi (2019-08-17 10:31:25 -0400) are available in the git repository at: https://gitlab.denx.de/u-boot/custodians/u-boot-x86 for you to fetch changes up to d117f917bfd2ccf4eaf90bddfa256501a554b1a4: global_data: Remove comment of reserved arch-specific GD flags (2019-08-18 21:54:10 +0800) Bin Meng (1): x86: qemu: Fix build warnings with CONFIG_DISTRO_DEFAULTS=n Heinrich Schuchardt (2): doc: formatting slimbootloader.rst doc: arch: correct links in x86.rst Simon Glass (6): cbfs: Allow CBFS to be used in SPL cbfs: Move declarations above functions cbfs: Move static variables into a struct cbfs: Move result variable into the struct cbfs: Add functions to support multiple CBFSs cbfs: Rename camel-case variables Stefan Roese (2): x86: Remove x86 specific GD flags as they are not referenced at all global_data: Remove comment of reserved arch-specific GD flags arch/x86/cpu/coreboot/coreboot.c | 3 -- arch/x86/cpu/start.S | 9 + arch/x86/cpu/start16.S | 3 -- arch/x86/include/asm/global_data.h | 6 cmd/cbfs.c | 4 +-- doc/arch/x86.rst | 3 +- doc/board/intel/slimbootloader.rst | 2 +- fs/Makefile| 1 + fs/cbfs/Kconfig| 12 +++ fs/cbfs/cbfs.c | 231 -- include/asm-generic/global_data.h | 2 +- include/cbfs.h | 29 include/configs/x86-common.h | 11 +++--- 13 files changed, 210 insertions(+), 106 deletions(-) Regards, Bin ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
Re: [U-Boot] Travis test/py sandbox_spl test fail
Hi Simon, Stephen, Could you help to comment on my other mail, which patch cause this failure. Thanks, - Kever On 2019/8/14 下午11:49, Stephen Warren wrote: On 8/13/19 8:06 PM, Kever Yang wrote: Hi Stephen, On 2019/8/14 上午4:54, Stephen Warren wrote: On 8/13/19 3:39 AM, Simon Glass wrote: +Stephen Hi Kever, On Tue, 13 Aug 2019 at 03:35, Kever Yang wrote: Hi Simon, I got fail in test/py sandbox_spl, and the log says: E OSError: [Errno 5] Input/output error I have no idea about what's wrong in source code, could you help to take a look? Travis job: https://travis-ci.org/keveryang/u-boot/jobs/571125119 When I've seen this (ugly) error it is normally because U-Boot crashed, e.g. with a segfault. Yes, that's the typical reason. If you run test.py locally you'll be able to access the log file (which Travis doesn't save), which will likely give you more details about the crash, and/or you could attach gdb to the sandbox process to trap the problem too. I got: $ ./u-boot bloblist_init() Existing bloblist not found: creating new bloblist [1] 958 segmentation fault (core dumped) ./u-boot And no more logs, is there any other log file I can check? There probably isn't any more log information beyond that. I think the next step would be to run U-Boot sandbox under gdb, reproduce the problem, and then debug it. ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
Re: [U-Boot] [PATCH 0/1] i.MX8QM ROM 7720 a1 board won't boot
> Subject: Re: [PATCH 0/1] i.MX8QM ROM 7720 a1 board won't boot > > On 16/08/19, Marcel Ziswiler wrote: > > Hi Oliver > > > > On Fri, 2019-08-16 at 12:43 +, Oliver Graute wrote: > > > I'am currently working on the following patch to get the imx8qm- > > > rom7720-a1 > > > > That version sounds suspiciously like it may be based on initial alpha > > silicon from NXP which as far as I know is not supported anywhere any > > more. Not even in downstream. > > > > If it has alpha silicon my suggestion is to throw it away and move on. > > > > > board working with recent u-boot v2019.07. > > > > v2019.07 has long since been released. So what you are talking about > > would be any future release like v2020.01 as even the v2019.10 merge > > window long since closed. > > > > > Unfortunaly I get no output on my > > > serial line. > > > > Alpha chips came with different boot ROM requiring completely > > different SCFW as far as I know. > > I have to correct myself. After some investigation I can say that I have the > B-Silicium of imx8qm on this board. So should I rename everything from a1 to > b1? Check scfw uart to see whether there is any output from scu uart. Make sure you using and adapt scfw to your board. Regards, Peng. > > Best regards, > > Oliver ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
Re: [U-Boot] [PATCH 2/4] rockchip: dts: rk3328-rock64: enable usb3 xhci controller
Hi Matwey, On 2019/8/17 下午10:15, Matwey V. Kornilov wrote: Hi Kever, I've just tested the series on my Rock64 and I see the following issue. An USB pen-drive is not discovered by `usb start' when attached to the USB3 (blue) port. The USB3 is not working correctly by the default code, and it works after I enable some debug option in xHCI, maybe some more delay is needed for XHCI? I have no idea for which part of the xHCI driver is not work correct now. Thanks, - Kever Attaching to USB2 port works fine. чт, 15 авг. 2019 г. в 11:14, Kever Yang : Rock64 has a USB3.0 port, enable the controller so that we can use it. Signed-off-by: Kever Yang --- arch/arm/dts/rk3328-rock64-u-boot.dtsi | 4 1 file changed, 4 insertions(+) diff --git a/arch/arm/dts/rk3328-rock64-u-boot.dtsi b/arch/arm/dts/rk3328-rock64-u-boot.dtsi index dbcce6ac64..21c2afca3c 100644 --- a/arch/arm/dts/rk3328-rock64-u-boot.dtsi +++ b/arch/arm/dts/rk3328-rock64-u-boot.dtsi @@ -32,3 +32,7 @@ &sdmmc { u-boot,dm-pre-reloc; }; + +&usb_host0_xhci { + status = "okay"; +}; -- 2.17.1 ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH 2/2] odroid-c2: enable USB host controller
Enable the second USB controller, which is connected to a hub with 4 ports. The first controller is for the OTG port and is currently not supported. Signed-off-by: Beniamino Galvani --- arch/arm/dts/meson-gxbb-odroidc2-u-boot.dtsi | 8 configs/odroid-c2_defconfig | 7 +++ include/configs/meson64.h| 5 + 3 files changed, 20 insertions(+) diff --git a/arch/arm/dts/meson-gxbb-odroidc2-u-boot.dtsi b/arch/arm/dts/meson-gxbb-odroidc2-u-boot.dtsi index c35158d7e9..484b40504d 100644 --- a/arch/arm/dts/meson-gxbb-odroidc2-u-boot.dtsi +++ b/arch/arm/dts/meson-gxbb-odroidc2-u-boot.dtsi @@ -5,3 +5,11 @@ */ #include "meson-gx-u-boot.dtsi" + +&usb0 { + status = "disabled"; +}; + +&usb1 { + hnp-srp-disable; +}; diff --git a/configs/odroid-c2_defconfig b/configs/odroid-c2_defconfig index 8849058d33..366ea125af 100644 --- a/configs/odroid-c2_defconfig +++ b/configs/odroid-c2_defconfig @@ -16,6 +16,7 @@ CONFIG_CMD_GPIO=y CONFIG_CMD_I2C=y # CONFIG_CMD_LOADS is not set CONFIG_CMD_MMC=y +CONFIG_CMD_USB=y # CONFIG_CMD_SETEXPR is not set CONFIG_CMD_REGULATOR=y CONFIG_OF_CONTROL=y @@ -29,13 +30,19 @@ CONFIG_MMC_MESON_GX=y CONFIG_PHY_REALTEK=y CONFIG_DM_ETH=y CONFIG_ETH_DESIGNWARE=y +CONFIG_PHY=y +CONFIG_MESON_GXBB_USB_PHY=y CONFIG_PINCTRL=y CONFIG_PINCTRL_MESON_GXBB=y CONFIG_DM_REGULATOR=y CONFIG_DM_REGULATOR_FIXED=y +CONFIG_DM_REGULATOR_GPIO=y CONFIG_DM_RESET=y CONFIG_DEBUG_UART_MESON=y CONFIG_DEBUG_UART_ANNOUNCE=y CONFIG_DEBUG_UART_SKIP_INIT=y CONFIG_MESON_SERIAL=y +CONFIG_USB=y +CONFIG_DM_USB=y +CONFIG_USB_DWC2=y CONFIG_OF_LIBFDT_OVERLAY=y diff --git a/include/configs/meson64.h b/include/configs/meson64.h index f8d3eee292..483a8f567c 100644 --- a/include/configs/meson64.h +++ b/include/configs/meson64.h @@ -16,6 +16,11 @@ #define GICC_BASE 0xc4302000 #endif +/* USB */ +#if defined(CONFIG_MESON_GXBB) +#define CONFIG_DWC2_UTMI_WIDTH 16 +#endif + /* For splashscreen */ #ifdef CONFIG_DM_VIDEO #define CONFIG_VIDEO_BMP_RLE8 -- 2.21.0 ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH 1/2] phy: meson: add GXBB PHY driver
This adds support for the USB PHY found on Amlogic GXBB SoCs. Signed-off-by: Beniamino Galvani --- drivers/phy/Kconfig | 8 ++ drivers/phy/Makefile | 1 + drivers/phy/meson-gxbb-usb2.c | 235 ++ 3 files changed, 244 insertions(+) create mode 100644 drivers/phy/meson-gxbb-usb2.c diff --git a/drivers/phy/Kconfig b/drivers/phy/Kconfig index 3942f035eb..2190f6f970 100644 --- a/drivers/phy/Kconfig +++ b/drivers/phy/Kconfig @@ -154,6 +154,14 @@ config PHY_STM32_USBPHYC between an HS USB OTG controller and an HS USB Host controller, selected by an USB switch. +config MESON_GXBB_USB_PHY + bool "Amlogic Meson GXBB USB PHY" + depends on PHY && ARCH_MESON && MESON_GXBB + imply REGMAP + help + This is the generic phy driver for the Amlogic Meson GXBB + USB2 PHY. + config MESON_GXL_USB_PHY bool "Amlogic Meson GXL USB PHYs" depends on PHY && ARCH_MESON && (MESON_GXL || MESON_GXM) diff --git a/drivers/phy/Makefile b/drivers/phy/Makefile index 3157f1b7ee..dde3b0ecef 100644 --- a/drivers/phy/Makefile +++ b/drivers/phy/Makefile @@ -16,6 +16,7 @@ obj-$(CONFIG_STI_USB_PHY) += sti_usb_phy.o obj-$(CONFIG_PHY_RCAR_GEN2) += phy-rcar-gen2.o obj-$(CONFIG_PHY_RCAR_GEN3) += phy-rcar-gen3.o obj-$(CONFIG_PHY_STM32_USBPHYC) += phy-stm32-usbphyc.o +obj-$(CONFIG_MESON_GXBB_USB_PHY) += meson-gxbb-usb2.o obj-$(CONFIG_MESON_GXL_USB_PHY) += meson-gxl-usb2.o meson-gxl-usb3.o obj-$(CONFIG_MESON_G12A_USB_PHY) += meson-g12a-usb2.o meson-g12a-usb3-pcie.o obj-$(CONFIG_MSM8916_USB_PHY) += msm8916-usbh-phy.o diff --git a/drivers/phy/meson-gxbb-usb2.c b/drivers/phy/meson-gxbb-usb2.c new file mode 100644 index 00..88c2ec69b2 --- /dev/null +++ b/drivers/phy/meson-gxbb-usb2.c @@ -0,0 +1,235 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Meson8, Meson8b and GXBB USB2 PHY driver + * + * Copyright (C) 2016 Martin Blumenstingl + * Copyright (C) 2018 BayLibre, SAS + * + * Author: Beniamino Galvani + */ + +#include +#include +#include +#include +#include +#include +#include + +#define REG_CONFIG 0x00 + #define REG_CONFIG_CLK_EN BIT(0) + #define REG_CONFIG_CLK_SEL_MASK GENMASK(3, 1) + #define REG_CONFIG_CLK_DIV_MASK GENMASK(10, 4) + #define REG_CONFIG_CLK_32k_ALTSEL BIT(15) + #define REG_CONFIG_TEST_TRIGBIT(31) + +#define REG_CTRL 0x04 + #define REG_CTRL_SOFT_PRST BIT(0) + #define REG_CTRL_SOFT_HRESETBIT(1) + #define REG_CTRL_SS_SCALEDOWN_MODE_MASK GENMASK(3, 2) + #define REG_CTRL_CLK_DET_RSTBIT(4) + #define REG_CTRL_INTR_SEL BIT(5) + #define REG_CTRL_CLK_DETECTED BIT(8) + #define REG_CTRL_SOF_SENT_RCVD_TGL BIT(9) + #define REG_CTRL_SOF_TOGGLE_OUT BIT(10) + #define REG_CTRL_POWER_ON_RESET BIT(15) + #define REG_CTRL_SLEEPM BIT(16) + #define REG_CTRL_TX_BITSTUFF_ENN_H BIT(17) + #define REG_CTRL_TX_BITSTUFF_ENNBIT(18) + #define REG_CTRL_COMMON_ON BIT(19) + #define REG_CTRL_REF_CLK_SEL_MASK GENMASK(21, 20) + #define REG_CTRL_REF_CLK_SEL_SHIFT 20 + #define REG_CTRL_FSEL_MASK GENMASK(24, 22) + #define REG_CTRL_FSEL_SHIFT 22 + #define REG_CTRL_PORT_RESET BIT(25) + #define REG_CTRL_THREAD_ID_MASK GENMASK(31, 26) + +/* bits [31:26], [24:21] and [15:3] seem to be read-only */ +#define REG_ADP_BC 0x0c + #define REG_ADP_BC_VBUS_VLD_EXT_SEL BIT(0) + #define REG_ADP_BC_VBUS_VLD_EXT BIT(1) + #define REG_ADP_BC_OTG_DISABLE BIT(2) + #define REG_ADP_BC_ID_PULLUPBIT(3) + #define REG_ADP_BC_DRV_VBUS BIT(4) + #define REG_ADP_BC_ADP_PRB_EN BIT(5) + #define REG_ADP_BC_ADP_DISCHARGEBIT(6) + #define REG_ADP_BC_ADP_CHARGE BIT(7) + #define REG_ADP_BC_SESS_END BIT(8) + #define REG_ADP_BC_DEVICE_SESS_VLD BIT(9) + #define REG_ADP_BC_B_VALID BIT(10) + #define REG_ADP_BC_A_VALID BIT(11) + #define REG_ADP_BC_ID_DIG BIT(12) + #define REG_ADP_BC_VBUS_VALID BIT(13) + #define REG_ADP_BC_ADP_PROBEBIT(14) + #define REG_ADP_BC_ADP_SENSEBIT(15) + #define REG_ADP_BC_ACA_ENABLE
[U-Boot] Enable USB host controller on Odroid-C2
Hi, these two patches enable the USB host controller on Odroid-C2. The first patch adds a PHY driver; the second one enables the necessary configuration options and updates the device tree. Note that the DWC2 driver currently does not support enabling PHYs from the device tree and so the following series (still on review) is needed as runtime requirement for the second patch: [PATCH 0/5] usb: host: dwc2: use driver model for PHY and CLOCK Thanks, Beniamino Beniamino Galvani (2): phy: meson: add GXBB PHY driver odroid-c2: enable USB host controller arch/arm/dts/meson-gxbb-odroidc2-u-boot.dtsi | 8 + configs/odroid-c2_defconfig | 7 + drivers/phy/Kconfig | 8 + drivers/phy/Makefile | 1 + drivers/phy/meson-gxbb-usb2.c| 235 +++ include/configs/meson64.h| 5 + 6 files changed, 264 insertions(+) create mode 100644 drivers/phy/meson-gxbb-usb2.c -- 2.21.0 ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH 08/10] x86: Move fsp_infoheader.h to the generic fsp directory
This header file is the same for FSP v1 and v2. Move it into the general fsp directory. Signed-off-by: Simon Glass --- arch/x86/include/asm/fsp1/fsp_support.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/include/asm/fsp1/fsp_support.h b/arch/x86/include/asm/fsp1/fsp_support.h index 7da19227d5..b93607f738 100644 --- a/arch/x86/include/asm/fsp1/fsp_support.h +++ b/arch/x86/include/asm/fsp1/fsp_support.h @@ -9,10 +9,10 @@ #include #include +#include #include #include "fsp_hob.h" #include "fsp_ffs.h" -#include "fsp_infoheader.h" #include "fsp_bootmode.h" #include -- 2.23.0.rc1.153.gdeed80330f-goog ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH 03/10] x86: Create a new fsp_arch.h header
At present fsp_support.h includes fsp_vpd.h which is an FPSv1 concept (VPD means Vital Product Data). For FSPv2 only UPD (Updatable Product Data) is used. To avoid mangling header files, put these two includes in a separate header which we can adjust as necessary for FSPv2. Signed-off-by: Simon Glass --- arch/x86/include/asm/fsp1/fsp_support.h | 3 +-- arch/x86/include/asm/fsp_arch.h | 20 2 files changed, 21 insertions(+), 2 deletions(-) create mode 100644 arch/x86/include/asm/fsp_arch.h diff --git a/arch/x86/include/asm/fsp1/fsp_support.h b/arch/x86/include/asm/fsp1/fsp_support.h index 72fbcbc393..423b523e60 100644 --- a/arch/x86/include/asm/fsp1/fsp_support.h +++ b/arch/x86/include/asm/fsp1/fsp_support.h @@ -14,8 +14,7 @@ #include "fsp_api.h" #include "fsp_infoheader.h" #include "fsp_bootmode.h" -#include -#include +#include #define FSP_LOWMEM_BASE0x10UL #define FSP_HIGHMEM_BASE 0x1ULL diff --git a/arch/x86/include/asm/fsp_arch.h b/arch/x86/include/asm/fsp_arch.h new file mode 100644 index 00..fb7f9109f7 --- /dev/null +++ b/arch/x86/include/asm/fsp_arch.h @@ -0,0 +1,20 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* + * Copyright 2019 Google LLC + * Written by Simon Glass + * + * Architecture-specific definitions (FSP config and VPD/UPD) + */ + +#ifndef __FSP_ARCH_H__ +#define __FSP_ARCH_H__ + +/* + * Note: use #ifndef __ASSEMBLY__ around any struct definitions or other C code + * since this file can be included from assembly. + */ + +#include +#include + +#endif -- 2.23.0.rc1.153.gdeed80330f-goog ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH 07/10] x86: Move fsp_hob.h to the generic fsp directory
This header file is the same for FSP v1 and v2. Move it into the general fsp directory. Signed-off-by: Simon Glass --- arch/x86/include/asm/{fsp1 => fsp}/fsp_hob.h| 0 arch/x86/include/asm/{fsp1 => fsp}/fsp_infoheader.h | 0 arch/x86/include/asm/fsp1/fsp_support.h | 1 + 3 files changed, 1 insertion(+) rename arch/x86/include/asm/{fsp1 => fsp}/fsp_hob.h (100%) rename arch/x86/include/asm/{fsp1 => fsp}/fsp_infoheader.h (100%) diff --git a/arch/x86/include/asm/fsp1/fsp_hob.h b/arch/x86/include/asm/fsp/fsp_hob.h similarity index 100% rename from arch/x86/include/asm/fsp1/fsp_hob.h rename to arch/x86/include/asm/fsp/fsp_hob.h diff --git a/arch/x86/include/asm/fsp1/fsp_infoheader.h b/arch/x86/include/asm/fsp/fsp_infoheader.h similarity index 100% rename from arch/x86/include/asm/fsp1/fsp_infoheader.h rename to arch/x86/include/asm/fsp/fsp_infoheader.h diff --git a/arch/x86/include/asm/fsp1/fsp_support.h b/arch/x86/include/asm/fsp1/fsp_support.h index 464f129809..7da19227d5 100644 --- a/arch/x86/include/asm/fsp1/fsp_support.h +++ b/arch/x86/include/asm/fsp1/fsp_support.h @@ -8,6 +8,7 @@ #define __FSP_SUPPORT_H__ #include +#include #include #include "fsp_hob.h" #include "fsp_ffs.h" -- 2.23.0.rc1.153.gdeed80330f-goog ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH 09/10] x86: Move fsp_bootmode.h to the generic fsp directory
This header file is the same for FSP v1 and v2, although there may be some additions to come. Move it into the generic fsp directory. Signed-off-by: Simon Glass --- arch/x86/include/asm/{fsp1 => fsp}/fsp_bootmode.h | 0 arch/x86/include/asm/fsp1/fsp_support.h | 3 +-- 2 files changed, 1 insertion(+), 2 deletions(-) rename arch/x86/include/asm/{fsp1 => fsp}/fsp_bootmode.h (100%) diff --git a/arch/x86/include/asm/fsp1/fsp_bootmode.h b/arch/x86/include/asm/fsp/fsp_bootmode.h similarity index 100% rename from arch/x86/include/asm/fsp1/fsp_bootmode.h rename to arch/x86/include/asm/fsp/fsp_bootmode.h diff --git a/arch/x86/include/asm/fsp1/fsp_support.h b/arch/x86/include/asm/fsp1/fsp_support.h index b93607f738..8f81e0ff2c 100644 --- a/arch/x86/include/asm/fsp1/fsp_support.h +++ b/arch/x86/include/asm/fsp1/fsp_support.h @@ -7,13 +7,12 @@ #ifndef __FSP_SUPPORT_H__ #define __FSP_SUPPORT_H__ +#include #include #include #include #include -#include "fsp_hob.h" #include "fsp_ffs.h" -#include "fsp_bootmode.h" #include #define FSP_LOWMEM_BASE0x10UL -- 2.23.0.rc1.153.gdeed80330f-goog ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH 04/10] x86: Move fsp_api.h inclusion out of fsp_support.h
This header file is different for each version of FSP. Move it into the fsp_arch.h header file. Signed-off-by: Simon Glass --- arch/x86/include/asm/fsp1/fsp_support.h | 1 - arch/x86/include/asm/fsp_arch.h | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/include/asm/fsp1/fsp_support.h b/arch/x86/include/asm/fsp1/fsp_support.h index 423b523e60..9a7c002bfc 100644 --- a/arch/x86/include/asm/fsp1/fsp_support.h +++ b/arch/x86/include/asm/fsp1/fsp_support.h @@ -11,7 +11,6 @@ #include "fsp_hob.h" #include "fsp_fv.h" #include "fsp_ffs.h" -#include "fsp_api.h" #include "fsp_infoheader.h" #include "fsp_bootmode.h" #include diff --git a/arch/x86/include/asm/fsp_arch.h b/arch/x86/include/asm/fsp_arch.h index fb7f9109f7..b223141c44 100644 --- a/arch/x86/include/asm/fsp_arch.h +++ b/arch/x86/include/asm/fsp_arch.h @@ -14,6 +14,7 @@ * since this file can be included from assembly. */ +#include #include #include -- 2.23.0.rc1.153.gdeed80330f-goog ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH 10/10] x86: Move fsp_ffs.h include to fsp_arch.h
This include file is only used for FSP v1. Avoid including it from fdt_support.h so we can use the latter with FSP v2. Signed-off-by: Simon Glass --- arch/x86/include/asm/fsp_arch.h | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/x86/include/asm/fsp_arch.h b/arch/x86/include/asm/fsp_arch.h index b223141c44..3b2077b392 100644 --- a/arch/x86/include/asm/fsp_arch.h +++ b/arch/x86/include/asm/fsp_arch.h @@ -15,6 +15,7 @@ */ #include +#include #include #include -- 2.23.0.rc1.153.gdeed80330f-goog ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH 06/10] x86: Move fsp_fv.h to the generic fsp directory
This header file is the same for FSP v1 and v2. Move it into the general fsp directory. Signed-off-by: Simon Glass --- arch/x86/include/asm/{fsp1 => fsp}/fsp_fv.h | 0 arch/x86/include/asm/fsp1/fsp_support.h | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename arch/x86/include/asm/{fsp1 => fsp}/fsp_fv.h (100%) diff --git a/arch/x86/include/asm/fsp1/fsp_fv.h b/arch/x86/include/asm/fsp/fsp_fv.h similarity index 100% rename from arch/x86/include/asm/fsp1/fsp_fv.h rename to arch/x86/include/asm/fsp/fsp_fv.h diff --git a/arch/x86/include/asm/fsp1/fsp_support.h b/arch/x86/include/asm/fsp1/fsp_support.h index bf0bbc7654..464f129809 100644 --- a/arch/x86/include/asm/fsp1/fsp_support.h +++ b/arch/x86/include/asm/fsp1/fsp_support.h @@ -7,9 +7,9 @@ #ifndef __FSP_SUPPORT_H__ #define __FSP_SUPPORT_H__ +#include #include #include "fsp_hob.h" -#include "fsp_fv.h" #include "fsp_ffs.h" #include "fsp_infoheader.h" #include "fsp_bootmode.h" -- 2.23.0.rc1.153.gdeed80330f-goog ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH 02/10] x86: fsp: Move fsp_azalia include out of fsp_support.h
This file is only used by one board and we don't need the types for most FSP files so it is wasteful to include it so widely. Drop it from this header. Signed-off-by: Simon Glass --- arch/x86/cpu/braswell/fsp_configs.c | 1 + arch/x86/include/asm/fsp1/fsp_support.h | 4 +++- board/advantech/som-db5800-som-6867/som-db5800-som-6867.c | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/arch/x86/cpu/braswell/fsp_configs.c b/arch/x86/cpu/braswell/fsp_configs.c index 607e333f21..6f217ce7d6 100644 --- a/arch/x86/cpu/braswell/fsp_configs.c +++ b/arch/x86/cpu/braswell/fsp_configs.c @@ -5,6 +5,7 @@ #include #include +#include #include DECLARE_GLOBAL_DATA_PTR; diff --git a/arch/x86/include/asm/fsp1/fsp_support.h b/arch/x86/include/asm/fsp1/fsp_support.h index 7b92392a27..72fbcbc393 100644 --- a/arch/x86/include/asm/fsp1/fsp_support.h +++ b/arch/x86/include/asm/fsp1/fsp_support.h @@ -14,7 +14,6 @@ #include "fsp_api.h" #include "fsp_infoheader.h" #include "fsp_bootmode.h" -#include "fsp_azalia.h" #include #include @@ -22,6 +21,9 @@ #define FSP_HIGHMEM_BASE 0x1ULL #define UPD_TERMINATOR 0x55AA +struct efi_guid; +struct fspinit_rtbuf; +struct fsp_config_data; /** * FSP Continuation assembly helper routine diff --git a/board/advantech/som-db5800-som-6867/som-db5800-som-6867.c b/board/advantech/som-db5800-som-6867/som-db5800-som-6867.c index 8f4c587371..212f77fd62 100644 --- a/board/advantech/som-db5800-som-6867/som-db5800-som-6867.c +++ b/board/advantech/som-db5800-som-6867/som-db5800-som-6867.c @@ -5,6 +5,7 @@ */ #include +#include #include /* ALC262 Verb Table - 10EC0262 */ -- 2.23.0.rc1.153.gdeed80330f-goog ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH 05/10] x86: Move fsp_types.h to the generic fsp directory
This header file is the same for FSP v1 and v2. Move it into the general fsp directory. Signed-off-by: Simon Glass --- arch/x86/include/asm/{fsp1 => fsp}/fsp_types.h | 0 arch/x86/include/asm/fsp1/fsp_support.h| 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename arch/x86/include/asm/{fsp1 => fsp}/fsp_types.h (100%) diff --git a/arch/x86/include/asm/fsp1/fsp_types.h b/arch/x86/include/asm/fsp/fsp_types.h similarity index 100% rename from arch/x86/include/asm/fsp1/fsp_types.h rename to arch/x86/include/asm/fsp/fsp_types.h diff --git a/arch/x86/include/asm/fsp1/fsp_support.h b/arch/x86/include/asm/fsp1/fsp_support.h index 9a7c002bfc..bf0bbc7654 100644 --- a/arch/x86/include/asm/fsp1/fsp_support.h +++ b/arch/x86/include/asm/fsp1/fsp_support.h @@ -7,7 +7,7 @@ #ifndef __FSP_SUPPORT_H__ #define __FSP_SUPPORT_H__ -#include "fsp_types.h" +#include #include "fsp_hob.h" #include "fsp_fv.h" #include "fsp_ffs.h" -- 2.23.0.rc1.153.gdeed80330f-goog ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH 01/10] x86: Rename existing FSP code to fsp1
Since there is now a new version of the FSP and it is incompatible with the existing version, move the code into an fsp1 directory. This will allow us to put FSP v2 code into an fsp2 directory. Add a Kconfig which defines which version is in use. Some of the code in this new fsp1/ directory is generic across both FSPv1 and FSPv2. Future patches will address this. Signed-off-by: Simon Glass --- arch/x86/Kconfig | 25 ++- arch/x86/cpu/baytrail/acpi.c | 2 +- arch/x86/cpu/baytrail/fsp_configs.c | 2 +- arch/x86/cpu/braswell/fsp_configs.c | 2 +- arch/x86/cpu/ivybridge/fsp_configs.c | 2 +- arch/x86/cpu/queensbay/fsp_configs.c | 2 +- arch/x86/cpu/queensbay/tnc.c | 2 +- arch/x86/include/asm/{fsp => fsp1}/fsp_api.h | 0 .../include/asm/{fsp => fsp1}/fsp_azalia.h| 0 .../include/asm/{fsp => fsp1}/fsp_bootmode.h | 0 arch/x86/include/asm/{fsp => fsp1}/fsp_ffs.h | 0 arch/x86/include/asm/{fsp => fsp1}/fsp_fv.h | 0 arch/x86/include/asm/{fsp => fsp1}/fsp_hob.h | 0 .../asm/{fsp => fsp1}/fsp_infoheader.h| 0 .../include/asm/{fsp => fsp1}/fsp_support.h | 0 .../x86/include/asm/{fsp => fsp1}/fsp_types.h | 0 arch/x86/include/asm/u-boot-x86.h | 2 +- arch/x86/lib/Makefile | 3 ++- arch/x86/lib/{fsp => fsp1}/Makefile | 0 arch/x86/lib/{fsp => fsp1}/fsp_car.S | 0 arch/x86/lib/{fsp => fsp1}/fsp_common.c | 2 +- arch/x86/lib/{fsp => fsp1}/fsp_dram.c | 2 +- arch/x86/lib/{fsp => fsp1}/fsp_graphics.c | 2 +- arch/x86/lib/{fsp => fsp1}/fsp_support.c | 2 +- .../som-db5800-som-6867/som-db5800-som-6867.c | 2 +- board/intel/cherryhill/cherryhill.c | 2 +- cmd/x86/fsp.c | 2 +- drivers/pci/pci-uclass.c | 2 +- 28 files changed, 41 insertions(+), 17 deletions(-) rename arch/x86/include/asm/{fsp => fsp1}/fsp_api.h (100%) rename arch/x86/include/asm/{fsp => fsp1}/fsp_azalia.h (100%) rename arch/x86/include/asm/{fsp => fsp1}/fsp_bootmode.h (100%) rename arch/x86/include/asm/{fsp => fsp1}/fsp_ffs.h (100%) rename arch/x86/include/asm/{fsp => fsp1}/fsp_fv.h (100%) rename arch/x86/include/asm/{fsp => fsp1}/fsp_hob.h (100%) rename arch/x86/include/asm/{fsp => fsp1}/fsp_infoheader.h (100%) rename arch/x86/include/asm/{fsp => fsp1}/fsp_support.h (100%) rename arch/x86/include/asm/{fsp => fsp1}/fsp_types.h (100%) rename arch/x86/lib/{fsp => fsp1}/Makefile (100%) rename arch/x86/lib/{fsp => fsp1}/fsp_car.S (100%) rename arch/x86/lib/{fsp => fsp1}/fsp_common.c (99%) rename arch/x86/lib/{fsp => fsp1}/fsp_dram.c (98%) rename arch/x86/lib/{fsp => fsp1}/fsp_graphics.c (98%) rename arch/x86/lib/{fsp => fsp1}/fsp_support.c (99%) diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index 218e817cf3..04e8a1a4e0 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -364,6 +364,29 @@ config HAVE_FSP Note: Without this binary U-Boot will not be able to set up its SDRAM so will not boot. +choice + prompt "FSP version" + depends on HAVE_FSP + default FSP_VERSION1 + help + Selects the FSP version to use. Intel has published several versions + of the FSP External Architecture Specification and this allows + selection of the version number used by a particular SoC. + +config FSP_VERSION1 + bool "FSP version 1.x" + help + This covers versions 1.0 and 1.1a. See here for details: + https://github.com/IntelFsp/fsp1/wiki + +config FSP_VERSION2 + bool "FSP version 2.x" + help + This covers versions 2.0 and 2.1. See here for details: + https://github.com/IntelFsp/fsp1/wiki + +endchoice + config FSP_FILE string "Firmware Support Package binary filename" depends on HAVE_FSP @@ -429,7 +452,7 @@ config ENABLE_MRC_CACHE For platforms that use Intel FSP for the memory initialization, please check FSP output HOB via U-Boot command 'fsp hob' to see - if there is FSP_NON_VOLATILE_STORAGE_HOB_GUID (asm/fsp/fsp_hob.h). + if there is FSP_NON_VOLATILE_STORAGE_HOB_GUID (asm/fsp1/fsp_hob.h). If such GUID does not exist, MRC cache is not available on such platform (eg: Intel Queensbay), which means selecting this option here does not make any difference. diff --git a/arch/x86/cpu/baytrail/acpi.c b/arch/x86/cpu/baytrail/acpi.c index 445e4ba2d7..1e3829a433 100644 --- a/arch/x86/cpu/baytrail/acpi.c +++ b/arch/x86/cpu/baytrail/acpi.c @@ -167,7 +167,7 @@ void acpi_create_gnvs(struct acpi_global_nvs *gnvs) * and PMC_BASE_ADDRESS are accessed, so we need make sure the base addresses * of these two blocks are programmed by either U-Boot or FSP. * - * It has been verified that 1st phase API (see arch/x86/lib/fsp/fsp_car.S) + * It has been verified that 1st
[U-Boot] [PATCH 00/10] x86: Prepare for adding FSP2 code
At present the x86 FSP (Firmware Support Package) code assumes that FSP version 1 is used. Since this code was added to U-Boot a new version (FSP2) has been produced by Intel. In preparation for adding support for FSP2, move the existing code into a directory that indicates it is used for FSP1. Simon Glass (10): x86: Rename existing FSP code to fsp1 x86: fsp: Move fsp_azalia include out of fsp_support.h x86: Create a new fsp_arch.h header x86: Move fsp_api.h inclusion out of fsp_support.h x86: Move fsp_types.h to the generic fsp directory x86: Move fsp_fv.h to the generic fsp directory x86: Move fsp_hob.h to the generic fsp directory x86: Move fsp_infoheader.h to the generic fsp directory x86: Move fsp_bootmode.h to the generic fsp directory x86: Move fsp_ffs.h include to fsp_arch.h arch/x86/Kconfig | 25 ++- arch/x86/cpu/baytrail/acpi.c | 2 +- arch/x86/cpu/baytrail/fsp_configs.c | 2 +- arch/x86/cpu/braswell/fsp_configs.c | 3 ++- arch/x86/cpu/ivybridge/fsp_configs.c | 2 +- arch/x86/cpu/queensbay/fsp_configs.c | 2 +- arch/x86/cpu/queensbay/tnc.c | 2 +- arch/x86/include/asm/{fsp => fsp1}/fsp_api.h | 0 .../include/asm/{fsp => fsp1}/fsp_azalia.h| 0 arch/x86/include/asm/{fsp => fsp1}/fsp_ffs.h | 0 .../include/asm/{fsp => fsp1}/fsp_support.h | 18 ++--- arch/x86/include/asm/fsp_arch.h | 22 arch/x86/include/asm/u-boot-x86.h | 2 +- arch/x86/lib/Makefile | 3 ++- arch/x86/lib/{fsp => fsp1}/Makefile | 0 arch/x86/lib/{fsp => fsp1}/fsp_car.S | 0 arch/x86/lib/{fsp => fsp1}/fsp_common.c | 2 +- arch/x86/lib/{fsp => fsp1}/fsp_dram.c | 2 +- arch/x86/lib/{fsp => fsp1}/fsp_graphics.c | 2 +- arch/x86/lib/{fsp => fsp1}/fsp_support.c | 2 +- .../som-db5800-som-6867/som-db5800-som-6867.c | 3 ++- board/intel/cherryhill/cherryhill.c | 2 +- cmd/x86/fsp.c | 2 +- drivers/pci/pci-uclass.c | 2 +- 24 files changed, 74 insertions(+), 26 deletions(-) rename arch/x86/include/asm/{fsp => fsp1}/fsp_api.h (100%) rename arch/x86/include/asm/{fsp => fsp1}/fsp_azalia.h (100%) rename arch/x86/include/asm/{fsp => fsp1}/fsp_ffs.h (100%) rename arch/x86/include/asm/{fsp => fsp1}/fsp_support.h (95%) create mode 100644 arch/x86/include/asm/fsp_arch.h rename arch/x86/lib/{fsp => fsp1}/Makefile (100%) rename arch/x86/lib/{fsp => fsp1}/fsp_car.S (100%) rename arch/x86/lib/{fsp => fsp1}/fsp_common.c (99%) rename arch/x86/lib/{fsp => fsp1}/fsp_dram.c (98%) rename arch/x86/lib/{fsp => fsp1}/fsp_graphics.c (98%) rename arch/x86/lib/{fsp => fsp1}/fsp_support.c (99%) -- 2.23.0.rc1.153.gdeed80330f-goog ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH v2 9/9] spi: Add support for SPL_OF_PLATDATA to mxs_gpio.c driver
After this patch the mxs_gpio.c DM/DTS driver can be used at early SPL to read states of gpio pins (and for example alter the boot flow). It was necessary to adjust its name to 'fsl_imx_2{38}_gpio' to match requirements for SPL_OF_PLATDATA usage. Signed-off-by: Lukasz Majewski --- Changes in v2: - New patch drivers/gpio/mxs_gpio.c | 72 + 1 file changed, 55 insertions(+), 17 deletions(-) diff --git a/drivers/gpio/mxs_gpio.c b/drivers/gpio/mxs_gpio.c index b2451fdda8..5795155e3e 100644 --- a/drivers/gpio/mxs_gpio.c +++ b/drivers/gpio/mxs_gpio.c @@ -131,9 +131,16 @@ int name_to_gpio(const char *name) #else /* CONFIG_DM_GPIO */ #include #include +#include #include #define MXS_MAX_GPIO_PER_BANK 32 +#ifdef CONFIG_MX28 +#define dtd_fsl_imx_gpio dtd_fsl_imx28_gpio +#else /* CONFIG_MX23 */ +#define dtd_fsl_imx_gpio dtd_fsl_imx23_gpio +#endif + DECLARE_GLOBAL_DATA_PTR; /* * According to i.MX28 Reference Manual: @@ -146,6 +153,14 @@ DECLARE_GLOBAL_DATA_PTR; * Bank 4: 0-20 -> 21 PINS */ +struct mxs_gpio_platdata { +#if CONFIG_IS_ENABLED(OF_PLATDATA) + struct dtd_fsl_imx_gpio dtplat; +#endif + unsigned int bank; + int gpio_ranges; +}; + struct mxs_gpio_priv { unsigned int bank; }; @@ -223,22 +238,19 @@ static const struct dm_gpio_ops gpio_mxs_ops = { static int mxs_gpio_probe(struct udevice *dev) { + struct mxs_gpio_platdata *plat = dev_get_platdata(dev); struct mxs_gpio_priv *priv = dev_get_priv(dev); struct gpio_dev_priv *uc_priv = dev_get_uclass_priv(dev); - struct fdtdec_phandle_args args; - int node = dev_of_offset(dev); char name[16], *str; - fdt_addr_t addr; - int ret; - - addr = devfdt_get_addr(dev); - if (addr == FDT_ADDR_T_NONE) { - printf("%s: No 'reg' property defined!\n", __func__); - return -EINVAL; - } - - priv->bank = (unsigned int)addr; +#if CONFIG_IS_ENABLED(OF_PLATDATA) + struct dtd_fsl_imx_gpio *dtplat = &plat->dtplat; + priv->bank = (unsigned int)dtplat->reg[0]; + uc_priv->gpio_count = dtplat->gpio_ranges[3]; +#else + priv->bank = (unsigned int)plat->bank; + uc_priv->gpio_count = plat->gpio_ranges; +#endif snprintf(name, sizeof(name), "GPIO%d_", priv->bank); str = strdup(name); if (!str) @@ -246,16 +258,33 @@ static int mxs_gpio_probe(struct udevice *dev) uc_priv->bank_name = str; + debug("%s: %s: %d pins base: 0x%x\n", __func__, uc_priv->bank_name, + uc_priv->gpio_count, priv->bank); + + return 0; +} + +#if CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA) +static int mxs_ofdata_to_platdata(struct udevice *dev) +{ + struct mxs_gpio_platdata *plat = dev->platdata; + struct fdtdec_phandle_args args; + int node = dev_of_offset(dev); + int ret; + + plat->bank = devfdt_get_addr(dev); + if (plat->bank == FDT_ADDR_T_NONE) { + printf("%s: No 'reg' property defined!\n", __func__); + return -EINVAL; + } + ret = fdtdec_parse_phandle_with_args(gd->fdt_blob, node, "gpio-ranges", NULL, 3, 0, &args); if (ret) printf("%s: 'gpio-ranges' not defined - using default!\n", __func__); - uc_priv->gpio_count = ret == 0 ? args.args[2] : MXS_MAX_GPIO_PER_BANK; - - debug("%s: %s: %d pins\n", __func__, uc_priv->bank_name, - uc_priv->gpio_count); + plat->gpio_ranges = ret == 0 ? args.args[2] : MXS_MAX_GPIO_PER_BANK; return 0; } @@ -265,13 +294,22 @@ static const struct udevice_id mxs_gpio_ids[] = { { .compatible = "fsl,imx28-gpio" }, { } }; +#endif U_BOOT_DRIVER(gpio_mxs) = { - .name = "gpio_mxs", +#ifdef CONFIG_MX28 + .name = "fsl_imx28_gpio", +#else /* CONFIG_MX23 */ + .name = "fsl_imx23_gpio", +#endif .id = UCLASS_GPIO, .ops= &gpio_mxs_ops, .probe = mxs_gpio_probe, .priv_auto_alloc_size = sizeof(struct mxs_gpio_priv), + .platdata_auto_alloc_size = sizeof(struct mxs_gpio_platdata), +#if CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA) .of_match = mxs_gpio_ids, + .ofdata_to_platdata = mxs_ofdata_to_platdata, +#endif }; #endif /* CONFIG_DM_GPIO */ -- 2.11.0 ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH v2 8/9] spl: Introduce SPL_DM_GPIO Kconfig define
This define indicates if DM_GPIO shall be supported in SPL. This allows proper operation of DM converted GPIO drivers in SPL, which use #if !CONFIG_IS_ENABLED(DM_GPIO) to also support not yet DM/DTS converted boards. Signed-off-by: Lukasz Majewski --- Changes in v2: - New patch common/spl/Kconfig | 6 ++ 1 file changed, 6 insertions(+) diff --git a/common/spl/Kconfig b/common/spl/Kconfig index 44c5ab61ec..0a3877ec28 100644 --- a/common/spl/Kconfig +++ b/common/spl/Kconfig @@ -430,6 +430,12 @@ config SPL_DMA_SUPPORT the CPU moving the data. Enable this option to build the drivers in drivers/dma as part of an SPL build. +config SPL_DM_GPIO + bool "Support Driver Model GPIO drivers" + depends on SPL_GPIO_SUPPORT + help + Enable support for Driver Model based GPIO drivers in SPL. + config SPL_DRIVERS_MISC_SUPPORT bool "Support misc drivers" help -- 2.11.0 ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH v2 7/9] mmc: Replace printf with debug call for timeouts in the i.MX28 mxs driver
This change replaces printf() with debug() for the notification about commands timeouts. This is done on purpose (also other drivers use such approach - dw_mmc.c, mvebu_mmc.c), as the mmc core code (mmc.c) uses timeouts to assess if one is using sd card or eMMC device. In such situation timeout is a some kind of a "normal" behavior and there shall not be any output to the console. There is no impact on boot time for boards using this driver (even in SPL) when two extra timeouts are returned (no SD card present, only eMMC available). Boot time tested with grabserial: sudo grabserial -b 115200 -d /dev/ttyUSB1 -e 30 -t -m "^U-Boot SPL*" Signed-off-by: Lukasz Majewski --- Changes in v2: - New patch drivers/mmc/mxsmmc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/mmc/mxsmmc.c b/drivers/mmc/mxsmmc.c index 7ea47f9801..9414eff42b 100644 --- a/drivers/mmc/mxsmmc.c +++ b/drivers/mmc/mxsmmc.c @@ -432,8 +432,8 @@ mxsmmc_send_cmd(struct udevice *dev, struct mmc_cmd *cmd, struct mmc_data *data) /* Check command timeout */ if (reg & SSP_STATUS_RESP_TIMEOUT) { - printf("MMC%d: Command %d timeout (status 0x%08x)\n", - devnum, cmd->cmdidx, reg); + debug("MMC%d: Command %d timeout (status 0x%08x)\n", + devnum, cmd->cmdidx, reg); return -ETIMEDOUT; } -- 2.11.0 ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH v2 4/9] spi: fix: Call mxs_reset_block() during DM/DTS probe
Without this change the DM/DTS version of mxs_spi driver doesn't reset the SPI IP block in probe. As a result this driver (when used solely on U-Boot proper) relies on reset performed by mxs spi driver in SPL. In the use case where eMMC is used in SPL as a boot primary device, the mxs_reset_block() is not called at all and DM/DTS aware SPI driver in U-Boot proper is malfunctioning. Signed-off-by: Lukasz Majewski --- Changes in v2: None drivers/spi/mxs_spi.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/spi/mxs_spi.c b/drivers/spi/mxs_spi.c index b1cc83aab1..d475830f17 100644 --- a/drivers/spi/mxs_spi.c +++ b/drivers/spi/mxs_spi.c @@ -436,6 +436,8 @@ static int mxs_spi_probe(struct udevice *bus) priv->dma_channel = plat->dma_id; priv->clk_id = plat->clk_id; + mxs_reset_block(&priv->regs->hw_ssp_ctrl0_reg); + ret = mxs_dma_init_channel(priv->dma_channel); if (ret) { printf("%s: DMA init channel error %d\n", __func__, ret); -- 2.11.0 ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH v2 2/9] dts: imx28: Remove #include "imx28.dtsi" from imx28-u-boot.dtsi file
After this change it is possible to use imx28--u-boot.dtsi with the imx28-u-boot.dtsi explicitly included without breaking setup from imx28-.dts file. The problem is that the imx28.dtsi included in a wrong place overrides the changes made in imx28-.dts. As a result some devices are "disabled" in the final DTB. Signed-off-by: Lukasz Majewski --- Changes in v2: None arch/arm/dts/imx28-u-boot.dtsi | 1 - 1 file changed, 1 deletion(-) diff --git a/arch/arm/dts/imx28-u-boot.dtsi b/arch/arm/dts/imx28-u-boot.dtsi index d545b402a7..9db72a6be3 100644 --- a/arch/arm/dts/imx28-u-boot.dtsi +++ b/arch/arm/dts/imx28-u-boot.dtsi @@ -5,7 +5,6 @@ * * SPDX-License-Identifier: GPL-2.0+ or X11 */ -#include "imx28.dtsi" &gpio0 { gpio-ranges = <&pinctrl 0 0 29>; -- 2.11.0 ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH v2 6/9] mmc: Convert mxsmmc eMMC driver for i.MX2{38} to DM/DTS
This patch converts the mxsmmc driver to support DM/DTS. Moreover, it is also possible to use it in early SPL with SPL_OF_PLATDATA enabled. Signed-off-by: Lukasz Majewski --- Changes in v2: - Correct position of struct mmc_ops mxsmmc_ops to avoid build breaks on board using legacy i.MX28 mmc driver. drivers/mmc/mxsmmc.c | 443 +++ 1 file changed, 373 insertions(+), 70 deletions(-) diff --git a/drivers/mmc/mxsmmc.c b/drivers/mmc/mxsmmc.c index 92db4ae5a6..7ea47f9801 100644 --- a/drivers/mmc/mxsmmc.c +++ b/drivers/mmc/mxsmmc.c @@ -2,6 +2,9 @@ /* * Freescale i.MX28 SSP MMC driver * + * Copyright (C) 2019 DENX Software Engineering + * Lukasz Majewski, DENX Software Engineering, lu...@denx.de + * * Copyright (C) 2011 Marek Vasut * on behalf of DENX Software Engineering GmbH * @@ -16,6 +19,7 @@ * (C) Copyright 2003 * Kyle Harris, Nexus Technologies, Inc. khar...@nexus-tech.net */ + #include #include #include @@ -27,18 +31,55 @@ #include #include +#defineMXSMMC_MAX_TIMEOUT 1 +#define MXSMMC_SMALL_TRANSFER 512 + +#if !CONFIG_IS_ENABLED(DM_MMC) struct mxsmmc_priv { int id; - struct mxs_ssp_regs *regs; - uint32_tbuswidth; int (*mmc_is_wp)(int); int (*mmc_cd)(int); - struct mxs_dma_desc *desc; struct mmc_config cfg;/* mmc configuration */ + struct mxs_dma_desc *desc; + uint32_tbuswidth; + struct mxs_ssp_regs *regs; }; +#else /* CONFIG_IS_ENABLED(DM_MMC) */ +#include +#include +#include + +#ifdef CONFIG_MX28 +#define dtd_fsl_imx_mmc dtd_fsl_imx28_mmc +#else /* CONFIG_MX23 */ +#define dtd_fsl_imx_mmc dtd_fsl_imx23_mmc +#endif -#defineMXSMMC_MAX_TIMEOUT 1 -#define MXSMMC_SMALL_TRANSFER 512 +struct mxsmmc_platdata { +#if CONFIG_IS_ENABLED(OF_PLATDATA) + struct dtd_fsl_imx_mmc dtplat; +#endif + struct mmc_config cfg; + struct mmc mmc; + fdt_addr_t base; + int non_removable; + int buswidth; + int dma_id; + int clk_id; +}; + +struct mxsmmc_priv { + int clkid; + struct mxs_dma_desc *desc; + u32 buswidth; + struct mxs_ssp_regs *regs; + unsigned intdma_channel; +}; +#endif + +#if !CONFIG_IS_ENABLED(DM_MMC) +static int mxsmmc_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd, + struct mmc_data *data); static int mxsmmc_cd(struct mxsmmc_priv *priv) { @@ -50,6 +91,132 @@ static int mxsmmc_cd(struct mxsmmc_priv *priv) return !(readl(&ssp_regs->hw_ssp_status) & SSP_STATUS_CARD_DETECT); } +static int mxsmmc_set_ios(struct mmc *mmc) +{ + struct mxsmmc_priv *priv = mmc->priv; + struct mxs_ssp_regs *ssp_regs = priv->regs; + + /* Set the clock speed */ + if (mmc->clock) + mxs_set_ssp_busclock(priv->id, mmc->clock / 1000); + + switch (mmc->bus_width) { + case 1: + priv->buswidth = SSP_CTRL0_BUS_WIDTH_ONE_BIT; + break; + case 4: + priv->buswidth = SSP_CTRL0_BUS_WIDTH_FOUR_BIT; + break; + case 8: + priv->buswidth = SSP_CTRL0_BUS_WIDTH_EIGHT_BIT; + break; + } + + /* Set the bus width */ + clrsetbits_le32(&ssp_regs->hw_ssp_ctrl0, + SSP_CTRL0_BUS_WIDTH_MASK, priv->buswidth); + + debug("MMC%d: Set %d bits bus width\n", + mmc->block_dev.devnum, mmc->bus_width); + + return 0; +} + +static int mxsmmc_init(struct mmc *mmc) +{ + struct mxsmmc_priv *priv = mmc->priv; + struct mxs_ssp_regs *ssp_regs = priv->regs; + + /* Reset SSP */ + mxs_reset_block(&ssp_regs->hw_ssp_ctrl0_reg); + + /* Reconfigure the SSP block for MMC operation */ + writel(SSP_CTRL1_SSP_MODE_SD_MMC | + SSP_CTRL1_WORD_LENGTH_EIGHT_BITS | + SSP_CTRL1_DMA_ENABLE | + SSP_CTRL1_POLARITY | + SSP_CTRL1_RECV_TIMEOUT_IRQ_EN | + SSP_CTRL1_DATA_CRC_IRQ_EN | + SSP_CTRL1_DATA_TIMEOUT_IRQ_EN | + SSP_CTRL1_RESP_TIMEOUT_IRQ_EN | + SSP_CTRL1_RESP_ERR_IRQ_EN, + &ssp_regs->hw_ssp_ctrl1_set); + + /* Set initial bit clock 400 KHz */ + mxs_set_ssp_busclock(priv->id, 400); + + /* Send initial 74 clock cycles (185 us @ 400 KHz)*/ + writel(SSP_CMD0_CONT_CLKING_EN, &ssp_regs->hw_ssp_cmd0_set); + udelay(200); + writel(SSP_CMD0_CONT_CLKING_EN, &ssp_regs->hw_ssp_cmd0_clr); + + return 0; +} + +static const struct mmc_ops mxsmmc_ops = { + .send_cmd = mxsmmc_send_cmd, + .set_ios= mxsmmc_set_ios, + .init = mxsmmc_init, +}; + +int mxsmmc_initialize(bd_t *bis, int id, int (*wp)(int), int (*cd)(int)) +{ +
[U-Boot] [PATCH v2 5/9] spi: Add support for SPL_OF_PLATDATA to mxs_spi.c driver
After this patch the mxs_spi.c DM/DTS driver can be used at early SPL to read payload from SPI-NOR memories. It was necessary to adjust its name to 'fsl_imx_2{38}_spi' to match requirements for SPL_OF_PLATDATA usage. Signed-off-by: Lukasz Majewski --- Changes in v2: None drivers/spi/mxs_spi.c | 34 -- 1 file changed, 32 insertions(+), 2 deletions(-) diff --git a/drivers/spi/mxs_spi.c b/drivers/spi/mxs_spi.c index d475830f17..58b1c67a19 100644 --- a/drivers/spi/mxs_spi.c +++ b/drivers/spi/mxs_spi.c @@ -57,7 +57,18 @@ static inline struct mxs_spi_slave *to_mxs_slave(struct spi_slave *slave) #else #include #include +#include + +#ifdef CONFIG_MX28 +#define dtd_fsl_imx_spi dtd_fsl_imx28_spi +#else /* CONFIG_MX23 */ +#define dtd_fsl_imx_spi dtd_fsl_imx23_spi +#endif + struct mxs_spi_platdata { +#if CONFIG_IS_ENABLED(OF_PLATDATA) + struct dtd_fsl_imx_spi dtplat; +#endif s32 frequency; /* Default clock frequency, -1 for none */ fdt_addr_t base;/* SPI IP block base address */ int num_cs; /* Number of CSes supported */ @@ -430,11 +441,26 @@ static int mxs_spi_probe(struct udevice *bus) int ret; debug("%s: probe\n", __func__); + +#if CONFIG_IS_ENABLED(OF_PLATDATA) + struct dtd_fsl_imx_spi *dtplat = &plat->dtplat; + struct phandle_1_arg *p1a = &dtplat->clocks[0]; + + priv->regs = (struct mxs_ssp_regs *)dtplat->reg[0]; + priv->dma_channel = dtplat->dmas[1]; + priv->clk_id = p1a->arg[0]; + priv->max_freq = dtplat->spi_max_frequency; + plat->num_cs = dtplat->num_cs; + + debug("OF_PLATDATA: regs: 0x%x max freq: %d clkid: %d\n", + (unsigned int)priv->regs, priv->max_freq, priv->clk_id); +#else priv->regs = (struct mxs_ssp_regs *)plat->base; priv->max_freq = plat->frequency; priv->dma_channel = plat->dma_id; priv->clk_id = plat->clk_id; +#endif mxs_reset_block(&priv->regs->hw_ssp_ctrl0_reg); @@ -571,16 +597,20 @@ static int mxs_ofdata_to_platdata(struct udevice *bus) return 0; } -#endif static const struct udevice_id mxs_spi_ids[] = { { .compatible = "fsl,imx23-spi" }, { .compatible = "fsl,imx28-spi" }, { } }; +#endif U_BOOT_DRIVER(mxs_spi) = { - .name = "mxs_spi", +#ifdef CONFIG_MX28 + .name = "fsl_imx28_spi", +#else /* CONFIG_MX23 */ + .name = "fsl_imx23_spi", +#endif .id = UCLASS_SPI, #if CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA) .of_match = mxs_spi_ids, -- 2.11.0 ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH v2 1/9] doc: fix: Replace SPL_OF_PLATDATA with OF_PLATDATA in examples
The of-plat.rst file till this change has been using #if CONFIG_IS_ENABLED(SPL_OF_PLATDATA) it its examples. This is at best misleading as SPL_OF_PLATDATA is always defined when we want to use this SPL tinification feature (also in U-Boot proper). As a result the OF_PLATDATA SPL specific code is also compiled in when U-Boot proper is build. Signed-off-by: Lukasz Majewski --- Changes in v2: None doc/driver-model/of-plat.rst | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/driver-model/of-plat.rst b/doc/driver-model/of-plat.rst index 0d3cd8c01e..a38e58e4d2 100644 --- a/doc/driver-model/of-plat.rst +++ b/doc/driver-model/of-plat.rst @@ -224,7 +224,7 @@ For example: #include struct mmc_platdata { -#if CONFIG_IS_ENABLED(SPL_OF_PLATDATA) +#if CONFIG_IS_ENABLED(OF_PLATDATA) /* Put this first since driver model will copy the data here */ struct dtd_mmc dtplat; #endif @@ -237,7 +237,7 @@ For example: static int mmc_ofdata_to_platdata(struct udevice *dev) { -#if !CONFIG_IS_ENABLED(SPL_OF_PLATDATA) +#if !CONFIG_IS_ENABLED(OF_PLATDATA) /* Decode the device tree data */ struct mmc_platdata *plat = dev_get_platdata(dev); const void *blob = gd->fdt_blob; @@ -253,7 +253,7 @@ For example: { struct mmc_platdata *plat = dev_get_platdata(dev); -#if CONFIG_IS_ENABLED(SPL_OF_PLATDATA) +#if CONFIG_IS_ENABLED(OF_PLATDATA) /* Decode the of-platdata from the C structures */ struct dtd_mmc *dtplat = &plat->dtplat; @@ -308,7 +308,7 @@ The dt-structs.h file includes the generated file (include/generated//dt-structs.h) if CONFIG_SPL_OF_PLATDATA is enabled. Otherwise (such as in U-Boot proper) these structs are not available. This prevents them being used inadvertently. All usage must be bracketed with -#if CONFIG_IS_ENABLED(SPL_OF_PLATDATA). +#if CONFIG_IS_ENABLED(OF_PLATDATA). The dt-platdata.c file contains the device declarations and is is built in spl/dt-platdata.c. -- 2.11.0 ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH v2 3/9] spl: Init proper struct driver member (platdata_auto_alloc_size) for mxs_spi
This change initializes proper member of struct driver - platdata_auto_alloc_size instead of priv_auto_alloc_size, which is setup twice. Signed-off-by: Lukasz Majewski --- Changes in v2: - New patch drivers/spi/mxs_spi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/spi/mxs_spi.c b/drivers/spi/mxs_spi.c index 3a9756fbf1..b1cc83aab1 100644 --- a/drivers/spi/mxs_spi.c +++ b/drivers/spi/mxs_spi.c @@ -584,7 +584,7 @@ U_BOOT_DRIVER(mxs_spi) = { .of_match = mxs_spi_ids, .ofdata_to_platdata = mxs_ofdata_to_platdata, #endif - .priv_auto_alloc_size = sizeof(struct mxs_spi_platdata), + .platdata_auto_alloc_size = sizeof(struct mxs_spi_platdata), .ops= &mxs_spi_ops, .priv_auto_alloc_size = sizeof(struct mxs_spi_priv), .probe = mxs_spi_probe, -- 2.11.0 ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH v2 0/9] imx: mxs: Fixes and DM/DTS conversion code for several i.MX28 drivers
This patch series focuses on fixing and enhancing the i.MX28 to be converted to DM/DTS. The mxs gpio, spi and eMMC drivers has been fixed and converted to DM/DTS. Changes in v2: - New patch - Correct position of struct mmc_ops mxsmmc_ops to avoid build breaks on board using legacy i.MX28 mmc driver. - New patch - New patch - New patch Lukasz Majewski (9): doc: fix: Replace SPL_OF_PLATDATA with OF_PLATDATA in examples dts: imx28: Remove #include "imx28.dtsi" from imx28-u-boot.dtsi file spl: Init proper struct driver member (platdata_auto_alloc_size) for mxs_spi spi: fix: Call mxs_reset_block() during DM/DTS probe spi: Add support for SPL_OF_PLATDATA to mxs_spi.c driver mmc: Convert mxsmmc eMMC driver for i.MX2{38} to DM/DTS mmc: Replace printf with debug call for timeouts in the i.MX28 mxs driver spl: Introduce SPL_DM_GPIO Kconfig define spi: Add support for SPL_OF_PLATDATA to mxs_gpio.c driver arch/arm/dts/imx28-u-boot.dtsi | 1 - common/spl/Kconfig | 6 + doc/driver-model/of-plat.rst | 8 +- drivers/gpio/mxs_gpio.c| 72 +-- drivers/mmc/mxsmmc.c | 445 ++--- drivers/spi/mxs_spi.c | 38 +++- 6 files changed, 474 insertions(+), 96 deletions(-) -- 2.11.0 ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
Re: [U-Boot] Rockpro64_V2.1 2018-07-02 Boot Freeze
+ Kever On Sun, Aug 18, 2019 at 1:21 AM Kurt Miller wrote: > > Hello, > > The Rockpro64_V2.1 2018-07-02 using master code base freezes > with only the following output: > > U-Boot TPL 2019.10-rc2-1-gdf33f86468-dirty (Aug 16 2019 - 22:31:31) > > Whereas another board dated 2018-06-06 works and outputs the following: > > U-Boot TPL 2019.10-rc2-1-gdf33f86468-dirty (Aug 16 2019 - 22:31:31) > Trying to boot from BOOTROM > Returning to boot ROM... > > U-Boot SPL 2019.10-rc2-1-gdf33f86468-dirty (Aug 16 2019 - 22:31:31 +0200) > > Both board have 4G RAM. > > U-Boot was built by Mark Kettenis from master with only the > baud rate changed for both tests. The 2018-07-02 board has different > markings for the CPU and the RAM as follows: > > 2018-06-06 2018-07-02 > CPU: RK3399 RK3399 > SBETMF976 1652 SBETNM271 1826 > > RAM: PS006-075 BT PS052-053 BT > N1YJ 83RL > > Please let me know if there is additional information needed to > further diagnose the boot freeze. Please use mainline, and with doc/README.rockchip instructions. I'm able to boot with mainline tree. U-Boot TPL 2019.10-rc2-00016-g81fed78c0a (Aug 19 2019 - 00:17:17) Trying to boot from BOOTROM Returning to boot ROM... U-Boot SPL 2019.10-rc2-00016-g81fed78c0a (Aug 19 2019 - 00:17:17 +0530) Trying to boot from MMC1 U-Boot 2019.10-rc2-00016-g81fed78c0a (Aug 19 2019 - 00:17:17 +0530) Model: Pine64 RockPro64 DRAM: 3.9 GiB MMC: dwmmc@fe32: 1, sdhci@fe33: 0 Loading Environment from MMC... *** Warning - bad CRC, using default environment In:serial@ff1a Out: serial@ff1a Err: serial@ff1a Model: Pine64 RockPro64 rockchip_dnl_key_pressed: adc_channel_single_shot fail! Net: ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
Re: [U-Boot] [PATCH 1/1] riscv: qemu: enable CONFIG_CMD_BOOTEFI_SELFTEST
On 8/18/19 1:58 PM, Bin Meng wrote: > On Sun, Aug 18, 2019 at 6:51 PM Heinrich Schuchardt > wrote: >> >> Enable CONFIG_CMD_BOOTEFI_SELFTEST for the QEMU RISC-V boards. >> >> Travis CI QEMU testing has been enabled for qemu-riscv64_defconfig. With >> this patch we will test the UEFI sub-system on the board. >> >> Signed-off-by: Heinrich Schuchardt >> --- >> configs/qemu-riscv32_defconfig | 1 + >> configs/qemu-riscv32_smode_defconfig | 1 + >> configs/qemu-riscv64_defconfig | 1 + >> configs/qemu-riscv64_smode_defconfig | 1 + >> 4 files changed, 4 insertions(+) >> > > Reviewed-by: Bin Meng > Hello Bin, thanks for reviewing. I will add the patch to the EFI tree. Best regards Heinrich ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH 2/2] sun50i: a64: A64-Teres-I board detect builtin keyboard
A64-Teres-I board is a laptop which comes with a builtin keyboard. The keyboard+trackpad controller pauses for 2 seconds at a firmware prompt before loading its HID interface. U-Boot needs to wait equally long to reliably enable the keyboard. Tested-by: Jonas Smedegaard Signed-off-by: Jonas Smedegaard Series-Cc: Jagan Teki --- configs/teres_i_defconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/configs/teres_i_defconfig b/configs/teres_i_defconfig index cfd696f8a3..602150a3fb 100644 --- a/configs/teres_i_defconfig +++ b/configs/teres_i_defconfig @@ -8,6 +8,7 @@ CONFIG_MMC_SUNXI_SLOT_EXTRA=2 CONFIG_USB1_VBUS_PIN="PL7" CONFIG_I2C0_ENABLE=y CONFIG_USE_PREBOOT=y +CONFIG_PREBOOT="setenv usb_pgood_delay 2000; usb reset" # CONFIG_CMD_FLASH is not set # CONFIG_SPL_DOS_PARTITION is not set # CONFIG_SPL_EFI_PARTITION is not set -- 2.23.0.rc1 ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH 1/2] sunxi: fix support board-specific CONFIG_PREBOOT
commit 37304aaf60bf ("Convert CONFIG_USE_PREBOOT and CONFIG_PREBOOT to Kconfig") intended to support CONFIG_PREBOOT, but include/configs/sunxi-common.h hardcodes preboot as part of internally defined CONSOLE_STDIN_SETTINGS, silently ignoring any board-specific CONFIG_PREBOOT. Tested-by: Jonas Smedegaard Signed-off-by: Jonas Smedegaard Series-Cc: Jagan Teki --- include/configs/sunxi-common.h | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/include/configs/sunxi-common.h b/include/configs/sunxi-common.h index d7133a73fc..2069884b63 100644 --- a/include/configs/sunxi-common.h +++ b/include/configs/sunxi-common.h @@ -432,8 +432,13 @@ extern int soft_i2c_gpio_scl; #include #ifdef CONFIG_USB_KEYBOARD +#ifdef CONFIG_USE_PREBOOT +#ifndef CONFIG_PREBOOT +#define CONFIG_PREBOOT \ + "usb start" +#endif +#endif #define CONSOLE_STDIN_SETTINGS \ - "preboot=usb start\0" \ "stdin=serial,usbkbd\0" #else #define CONSOLE_STDIN_SETTINGS \ -- 2.23.0.rc1 ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
Re: [U-Boot] [PATCH 2/2] global_data: Remove comment of reserved arch-specific GD flags
On Fri, Aug 16, 2019 at 11:59 PM Simon Glass wrote: > > On Fri, 16 Aug 2019 at 10:05, Simon Goldschmidt > wrote: > > > > > > > > Stefan Roese schrieb am Fr., 16. Aug. 2019, 14:45: > >> > >> With the removal of the x86 specific GD flags, there are no arch- > >> specific GD flags any more. Let's remove the comment about reserving the > >> upper 16 bits for arch-specific flags in the common header. This gives > >> us more flexibility with the usage of the GD flags. > >> > >> As a matter of fact, we are already using more than 16 bits for common > >> GD flags (with the addition of GD_FLG_WDT_READY). > >> > >> Signed-off-by: Stefan Roese > >> Cc: Bin Meng > >> Cc: Simon Glass > >> Cc: Tom Rini > >> Cc: Simon Goldschmidt > > > > > > Reviewed-by: Simon Goldschmidt > > Reviewed-by: Simon Glass applied to u-boot-x86, thanks! ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
Re: [U-Boot] [PATCH v2 3/6] cbfs: Move static variables into a struct
On Fri, Aug 16, 2019 at 10:43 PM Bin Meng wrote: > > On Thu, Aug 15, 2019 at 3:18 PM Bin Meng wrote: > > > > On Thu, Aug 15, 2019 at 9:56 AM Simon Glass wrote: > > > > > > At present there are a number of static variables in BSS. This cannot work > > > with SPL, at least until BSS is available in board_init_r(). > > > > > > Move the variables into a struct, so it is possible to malloc() it and use > > > it before BSS is available. > > > > > > Signed-off-by: Simon Glass > > > --- > > > > > > Changes in v2: > > > - Make cbfs_init() static > > > - Move whitespace changes to next patch > > > > > > > Reviewed-by: Bin Meng > > Tested-by: Bin Meng applied to u-boot-x86, thanks! ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
Re: [U-Boot] [PATCH v2 6/6] cbfs: Rename camel-case variables
On Fri, Aug 16, 2019 at 10:44 PM Bin Meng wrote: > > On Thu, Aug 15, 2019 at 9:56 AM Simon Glass wrote: > > > > Rename some camel-case variables to match U-Boot style. > > > > Camel case is not generally allowed in U-Boot. Rename this variable to fit > > in with the style. > > > > Signed-off-by: Simon Glass > > Reviewed-by: Bin Meng > > --- > > > > Changes in v2: None > > > > fs/cbfs/cbfs.c | 44 ++-- > > 1 file changed, 22 insertions(+), 22 deletions(-) > > > > Tested-by: Bin Meng applied to u-boot-x86, thanks! ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
Re: [U-Boot] [PATCH 1/2] x86: Remove x86 specific GD flags as they are not referenced at all
On Fri, Aug 16, 2019 at 11:04 PM Simon Goldschmidt wrote: > > > > Stefan Roese schrieb am Fr., 16. Aug. 2019, 14:45: >> >> This patch removes the x86 architecture specific GD flags >> (GD_FLG_COLD_BOOT & GD_FLG_WARM_BOOT), as they are not used. Only >> GD_FLG_COLD_BOOT is referenced in coreboot.c but assigned in start16.S. >> But the coreboot target does not use start16.S at all and boots directly >> from the 32-bit start code. >> >> Signed-off-by: Stefan Roese >> Cc: Bin Meng >> Cc: Simon Glass >> Cc: Tom Rini >> Cc: Simon Goldschmidt > > > Reviewed-by: Simon Goldschmidt applied to u-boot-x86, thanks! ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
Re: [U-Boot] [PATCH v2 4/6] cbfs: Move result variable into the struct
On Fri, Aug 16, 2019 at 10:43 PM Bin Meng wrote: > > On Thu, Aug 15, 2019 at 9:56 AM Simon Glass wrote: > > > > Move the result variable into the struct also, so that it can be used when > > BSS is not available. Add a function to read it. > > > > Note that all functions sill use the BSS version of the data. > > > > Signed-off-by: Simon Glass > > Reviewed-by: Bin Meng > > --- > > > > Changes in v2: None > > > > cmd/cbfs.c | 4 ++-- > > fs/cbfs/cbfs.c | 48 > > include/cbfs.h | 7 +++ > > 3 files changed, 37 insertions(+), 22 deletions(-) > > > > Tested-by: Bin Meng applied to u-boot-x86, thanks! ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
Re: [U-Boot] [PATCH v2 2/6] cbfs: Move declarations above functions
On Fri, Aug 16, 2019 at 10:42 PM Bin Meng wrote: > > On Thu, Aug 15, 2019 at 9:56 AM Simon Glass wrote: > > > > At present this file has a function at the top, above declarations. This > > is normally avoided, so fix it. > > > > Signed-off-by: Simon Glass > > Reviewed-by: Bin Meng > > --- > > > > Changes in v2: None > > > > fs/cbfs/cbfs.c | 14 +- > > 1 file changed, 5 insertions(+), 9 deletions(-) > > > > Tested-by: Bin Meng applied to u-boot-x86, thanks! ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
Re: [U-Boot] [PATCH v2 5/6] cbfs: Add functions to support multiple CBFSs
On Fri, Aug 16, 2019 at 10:43 PM Bin Meng wrote: > > On Thu, Aug 15, 2019 at 9:56 AM Simon Glass wrote: > > > > Sometimes an image has multiple CBFS. The current CBFS API is limited to > > handling only one at time. Also it keeps track of the CBFS internally in > > BSS, which does not work before relocation, for example. > > > > Add a few new functions to overcome these limitations. > > > > Signed-off-by: Simon Glass > > Reviewed-by: Bin Meng > > --- > > > > Changes in v2: None > > > > fs/cbfs/cbfs.c | 46 ++ > > include/cbfs.h | 22 ++ > > 2 files changed, 68 insertions(+) > > > > Tested-by: Bin Meng applied to u-boot-x86, thanks! ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
Re: [U-Boot] [PATCH v2 1/6] cbfs: Allow CBFS to be used in SPL
On Fri, Aug 16, 2019 at 10:42 PM Bin Meng wrote: > > On Thu, Aug 15, 2019 at 9:56 AM Simon Glass wrote: > > > > Add a new Kconfig option to enable CBFS in SPL. This can be useful when > > the memory-init code is in CBFS. > > > > Signed-off-by: Simon Glass > > Reviewed-by: Bin Meng > > --- > > > > Changes in v2: > > - Fix typo in Kconfig help > > > > fs/Makefile | 1 + > > fs/cbfs/Kconfig | 12 > > 2 files changed, 13 insertions(+) > > > > Tested-by: Bin Meng applied to u-boot-x86, thanks! ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
Re: [U-Boot] [PATCH 1/1] riscv: qemu: enable CONFIG_CMD_BOOTEFI_SELFTEST
On Sun, Aug 18, 2019 at 6:51 PM Heinrich Schuchardt wrote: > > Enable CONFIG_CMD_BOOTEFI_SELFTEST for the QEMU RISC-V boards. > > Travis CI QEMU testing has been enabled for qemu-riscv64_defconfig. With > this patch we will test the UEFI sub-system on the board. > > Signed-off-by: Heinrich Schuchardt > --- > configs/qemu-riscv32_defconfig | 1 + > configs/qemu-riscv32_smode_defconfig | 1 + > configs/qemu-riscv64_defconfig | 1 + > configs/qemu-riscv64_smode_defconfig | 1 + > 4 files changed, 4 insertions(+) > Reviewed-by: Bin Meng ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
Re: [U-Boot] [PATCH v5 1/5] usb_kdb: only process events successfully received
On 8/18/19 10:55 AM, Michal Suchanek wrote: > Causes unbound key repeat on error otherwise. > > Signed-off-by: Michal Suchanek > --- > v2: fix indentation > v4: fix ! condition to >= 0 > v5: fix commit message typo Applied all, thanks. ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH 1/1] riscv: qemu: enable CONFIG_CMD_BOOTEFI_SELFTEST
Enable CONFIG_CMD_BOOTEFI_SELFTEST for the QEMU RISC-V boards. Travis CI QEMU testing has been enabled for qemu-riscv64_defconfig. With this patch we will test the UEFI sub-system on the board. Signed-off-by: Heinrich Schuchardt --- configs/qemu-riscv32_defconfig | 1 + configs/qemu-riscv32_smode_defconfig | 1 + configs/qemu-riscv64_defconfig | 1 + configs/qemu-riscv64_smode_defconfig | 1 + 4 files changed, 4 insertions(+) diff --git a/configs/qemu-riscv32_defconfig b/configs/qemu-riscv32_defconfig index d5b33b5c2b..fe09a0da88 100644 --- a/configs/qemu-riscv32_defconfig +++ b/configs/qemu-riscv32_defconfig @@ -5,5 +5,6 @@ CONFIG_DISTRO_DEFAULTS=y CONFIG_FIT=y CONFIG_DISPLAY_CPUINFO=y CONFIG_DISPLAY_BOARDINFO=y +CONFIG_CMD_BOOTEFI_SELFTEST=y # CONFIG_CMD_MII is not set CONFIG_OF_PRIOR_STAGE=y diff --git a/configs/qemu-riscv32_smode_defconfig b/configs/qemu-riscv32_smode_defconfig index a80e68b8c7..7103324421 100644 --- a/configs/qemu-riscv32_smode_defconfig +++ b/configs/qemu-riscv32_smode_defconfig @@ -6,5 +6,6 @@ CONFIG_DISTRO_DEFAULTS=y CONFIG_FIT=y CONFIG_DISPLAY_CPUINFO=y CONFIG_DISPLAY_BOARDINFO=y +CONFIG_CMD_BOOTEFI_SELFTEST=y # CONFIG_CMD_MII is not set CONFIG_OF_PRIOR_STAGE=y diff --git a/configs/qemu-riscv64_defconfig b/configs/qemu-riscv64_defconfig index 19a5849226..ef84dfded2 100644 --- a/configs/qemu-riscv64_defconfig +++ b/configs/qemu-riscv64_defconfig @@ -6,5 +6,6 @@ CONFIG_DISTRO_DEFAULTS=y CONFIG_FIT=y CONFIG_DISPLAY_CPUINFO=y CONFIG_DISPLAY_BOARDINFO=y +CONFIG_CMD_BOOTEFI_SELFTEST=y # CONFIG_CMD_MII is not set CONFIG_OF_PRIOR_STAGE=y diff --git a/configs/qemu-riscv64_smode_defconfig b/configs/qemu-riscv64_smode_defconfig index 74743a5ebe..1c7a2d150c 100644 --- a/configs/qemu-riscv64_smode_defconfig +++ b/configs/qemu-riscv64_smode_defconfig @@ -7,5 +7,6 @@ CONFIG_DISTRO_DEFAULTS=y CONFIG_FIT=y CONFIG_DISPLAY_CPUINFO=y CONFIG_DISPLAY_BOARDINFO=y +CONFIG_CMD_BOOTEFI_SELFTEST=y # CONFIG_CMD_MII is not set CONFIG_OF_PRIOR_STAGE=y -- 2.20.1 ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH v5 4/5] usb: Add nonblock argument to submit_int_msg
This will be used to implement non-blocking keyboard polling in case of errors. Signed-off-by: Michal Suchanek --- v2: add missing hunk from last patch v4: - propagate nonblock argument to wrapper - add documentation of nonblock argument to wrapper v5: - also propagate the extra argument to USB emulator - wrap lines slightly over 80 characters --- common/usb.c | 9 ++--- common/usb_kbd.c | 4 ++-- common/usb_storage.c | 2 +- drivers/usb/emul/sandbox_keyb.c| 3 ++- drivers/usb/emul/usb-emul-uclass.c | 6 -- drivers/usb/host/dwc2.c| 13 - drivers/usb/host/ehci-hcd.c| 13 - drivers/usb/host/ohci-hcd.c| 4 ++-- drivers/usb/host/r8a66597-hcd.c| 2 +- drivers/usb/host/sl811-hcd.c | 2 +- drivers/usb/host/usb-sandbox.c | 5 +++-- drivers/usb/host/usb-uclass.c | 5 +++-- drivers/usb/host/xhci.c| 13 - drivers/usb/musb-new/musb_uboot.c | 12 +++- include/usb.h | 9 + 15 files changed, 61 insertions(+), 41 deletions(-) diff --git a/common/usb.c b/common/usb.c index 14b27521395c..d9bcb5a57e89 100644 --- a/common/usb.c +++ b/common/usb.c @@ -192,12 +192,15 @@ int usb_disable_asynch(int disable) */ /* - * submits an Interrupt Message + * submits an Interrupt Message. Some drivers may implement non-blocking + * polling: when non-block is true and the device is not responding return + * -EAGAIN instead of waiting for device to respond. */ int usb_int_msg(struct usb_device *dev, unsigned long pipe, - void *buffer, int transfer_len, int interval) + void *buffer, int transfer_len, int interval, bool nonblock) { - return submit_int_msg(dev, pipe, buffer, transfer_len, interval); + return submit_int_msg(dev, pipe, buffer, transfer_len, interval, + nonblock); } /* diff --git a/common/usb_kbd.c b/common/usb_kbd.c index ebfd972bea03..d178af248af0 100644 --- a/common/usb_kbd.c +++ b/common/usb_kbd.c @@ -341,7 +341,7 @@ static inline void usb_kbd_poll_for_event(struct usb_device *dev) /* Submit a interrupt transfer request */ if (usb_int_msg(dev, data->intpipe, &data->new[0], - data->intpktsize, data->intinterval) >= 0) + data->intpktsize, data->intinterval, true) >= 0) usb_kbd_irq_worker(dev); #elif defined(CONFIG_SYS_USB_EVENT_POLL_VIA_CONTROL_EP) || \ defined(CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE) @@ -505,7 +505,7 @@ static int usb_kbd_probe_dev(struct usb_device *dev, unsigned int ifnum) 1, 0, data->new, USB_KBD_BOOT_REPORT_SIZE) < 0) { #else if (usb_int_msg(dev, data->intpipe, data->new, data->intpktsize, - data->intinterval) < 0) { + data->intinterval, false) < 0) { #endif printf("Failed to get keyboard state from device %04x:%04x\n", dev->descriptor.idVendor, dev->descriptor.idProduct); diff --git a/common/usb_storage.c b/common/usb_storage.c index 9a4155c08a16..54f8e53c6307 100644 --- a/common/usb_storage.c +++ b/common/usb_storage.c @@ -651,7 +651,7 @@ static int usb_stor_CBI_get_status(struct scsi_cmd *srb, struct us_data *us) us->ip_wanted = 1; usb_int_msg(us->pusb_dev, us->irqpipe, - (void *)&us->ip_data, us->irqmaxp, us->irqinterval); + (void *)&us->ip_data, us->irqmaxp, us->irqinterval, false); timeout = 1000; while (timeout--) { if (us->ip_wanted == 0) diff --git a/drivers/usb/emul/sandbox_keyb.c b/drivers/usb/emul/sandbox_keyb.c index 635945179efc..dc43880d27e6 100644 --- a/drivers/usb/emul/sandbox_keyb.c +++ b/drivers/usb/emul/sandbox_keyb.c @@ -178,7 +178,8 @@ static int sandbox_keyb_control(struct udevice *dev, struct usb_device *udev, } static int sandbox_keyb_interrupt(struct udevice *dev, struct usb_device *udev, - unsigned long pipe, void *buffer, int length, int interval) + unsigned long pipe, void *buffer, int length, int interval, + bool nonblock) { struct sandbox_keyb_priv *priv = dev_get_priv(dev); uint8_t *data = buffer; diff --git a/drivers/usb/emul/usb-emul-uclass.c b/drivers/usb/emul/usb-emul-uclass.c index 973981545b91..50da6bda8e4e 100644 --- a/drivers/usb/emul/usb-emul-uclass.c +++ b/drivers/usb/emul/usb-emul-uclass.c @@ -245,7 +245,8 @@ int usb_emul_bulk(struct udevice *emul, struct usb_device *udev, } int usb_emul_int(struct udevice *emul, struct usb_device *udev, - unsigned long pipe, void *buffer, int length, int interval) + unsigned long pipe, void *buffer, int length, int interval, + bool nonblock) { struct dm_usb_ops *ops = usb_get_emul_ops(emul); @@ -253,7 +254,8 @@ int us
[U-Boot] [PATCH v5 5/5] dwc2: use the nonblock argument in submit_int_msg
An USB 1.1 keyboard connected to dwc2 through a high-speed hub does not report status until it changes. With this patch you can enable keyboard by pressing a key while USB devices are probed. Without a keypress no state is reported and the probe times out. We don't want to wait for a keypress or timeout while polling for keypresses so implement an int_msg nonblock variant that exits early on error. Signed-off-by: Michal Suchanek --- v2: move superfluous hunk to earlier patch --- drivers/usb/host/dwc2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/host/dwc2.c b/drivers/usb/host/dwc2.c index bc6166283c63..350d820a6e50 100644 --- a/drivers/usb/host/dwc2.c +++ b/drivers/usb/host/dwc2.c @@ -1123,7 +1123,7 @@ int _submit_int_msg(struct dwc2_priv *priv, struct usb_device *dev, return -ETIMEDOUT; } ret = _submit_bulk_msg(priv, dev, pipe, buffer, len); - if (ret != -EAGAIN) + if ((ret != -EAGAIN) || nonblock) return ret; } } -- 2.22.0 ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH v5 3/5] usb: storage: submit_int_msg -> usb_int_msg
Use the wrapper as other callers do. Signed-off-by: Michal Suchanek --- v2: usb_submit_int_msg -> usb_int_msg v3: fix indentation v5: fix superfluous space in type cast --- common/usb_storage.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/usb_storage.c b/common/usb_storage.c index 8c889bb1a648..9a4155c08a16 100644 --- a/common/usb_storage.c +++ b/common/usb_storage.c @@ -650,8 +650,8 @@ static int usb_stor_CBI_get_status(struct scsi_cmd *srb, struct us_data *us) int timeout; us->ip_wanted = 1; - submit_int_msg(us->pusb_dev, us->irqpipe, - (void *) &us->ip_data, us->irqmaxp, us->irqinterval); + usb_int_msg(us->pusb_dev, us->irqpipe, + (void *)&us->ip_data, us->irqmaxp, us->irqinterval); timeout = 1000; while (timeout--) { if (us->ip_wanted == 0) -- 2.22.0 ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH v5 1/5] usb_kdb: only process events successfully received
Causes unbound key repeat on error otherwise. Signed-off-by: Michal Suchanek --- v2: fix indentation v4: fix ! condition to >= 0 v5: fix commit message typo --- common/usb_kbd.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/common/usb_kbd.c b/common/usb_kbd.c index 387373746147..e0c1e6d2b796 100644 --- a/common/usb_kbd.c +++ b/common/usb_kbd.c @@ -340,10 +340,9 @@ static inline void usb_kbd_poll_for_event(struct usb_device *dev) struct usb_kbd_pdata *data = dev->privptr; /* Submit a interrupt transfer request */ - usb_submit_int_msg(dev, data->intpipe, &data->new[0], data->intpktsize, - data->intinterval); - - usb_kbd_irq_worker(dev); + if (usb_submit_int_msg(dev, data->intpipe, &data->new[0], + data->intpktsize, data->intinterval) >= 0) + usb_kbd_irq_worker(dev); #elif defined(CONFIG_SYS_USB_EVENT_POLL_VIA_CONTROL_EP) || \ defined(CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE) #if defined(CONFIG_SYS_USB_EVENT_POLL_VIA_CONTROL_EP) -- 2.22.0 ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH v5 2/5] usb: usb_submit_int_msg -> usb_int_msg
This aligns naming with usb_bulk_msg and usb_control_msg. Signed-off-by: Michal Suchanek --- v2: new patch v4: fix indentation of function arguments --- common/usb.c | 4 ++-- common/usb_kbd.c | 8 include/usb.h| 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/common/usb.c b/common/usb.c index b70f614d244f..14b27521395c 100644 --- a/common/usb.c +++ b/common/usb.c @@ -194,8 +194,8 @@ int usb_disable_asynch(int disable) /* * submits an Interrupt Message */ -int usb_submit_int_msg(struct usb_device *dev, unsigned long pipe, - void *buffer, int transfer_len, int interval) +int usb_int_msg(struct usb_device *dev, unsigned long pipe, + void *buffer, int transfer_len, int interval) { return submit_int_msg(dev, pipe, buffer, transfer_len, interval); } diff --git a/common/usb_kbd.c b/common/usb_kbd.c index e0c1e6d2b796..ebfd972bea03 100644 --- a/common/usb_kbd.c +++ b/common/usb_kbd.c @@ -340,8 +340,8 @@ static inline void usb_kbd_poll_for_event(struct usb_device *dev) struct usb_kbd_pdata *data = dev->privptr; /* Submit a interrupt transfer request */ - if (usb_submit_int_msg(dev, data->intpipe, &data->new[0], - data->intpktsize, data->intinterval) >= 0) + if (usb_int_msg(dev, data->intpipe, &data->new[0], + data->intpktsize, data->intinterval) >= 0) usb_kbd_irq_worker(dev); #elif defined(CONFIG_SYS_USB_EVENT_POLL_VIA_CONTROL_EP) || \ defined(CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE) @@ -504,8 +504,8 @@ static int usb_kbd_probe_dev(struct usb_device *dev, unsigned int ifnum) if (usb_get_report(dev, iface->desc.bInterfaceNumber, 1, 0, data->new, USB_KBD_BOOT_REPORT_SIZE) < 0) { #else - if (usb_submit_int_msg(dev, data->intpipe, data->new, data->intpktsize, - data->intinterval) < 0) { + if (usb_int_msg(dev, data->intpipe, data->new, data->intpktsize, + data->intinterval) < 0) { #endif printf("Failed to get keyboard state from device %04x:%04x\n", dev->descriptor.idVendor, dev->descriptor.idProduct); diff --git a/include/usb.h b/include/usb.h index 420a30e49fa1..0d38d8333a98 100644 --- a/include/usb.h +++ b/include/usb.h @@ -261,8 +261,8 @@ int usb_control_msg(struct usb_device *dev, unsigned int pipe, void *data, unsigned short size, int timeout); int usb_bulk_msg(struct usb_device *dev, unsigned int pipe, void *data, int len, int *actual_length, int timeout); -int usb_submit_int_msg(struct usb_device *dev, unsigned long pipe, - void *buffer, int transfer_len, int interval); +int usb_int_msg(struct usb_device *dev, unsigned long pipe, + void *buffer, int transfer_len, int interval); int usb_disable_asynch(int disable); int usb_maxpacket(struct usb_device *dev, unsigned long pipe); int usb_get_configuration_no(struct usb_device *dev, int cfgno, -- 2.22.0 ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot