aboutsummaryrefslogtreecommitdiff
path: root/drivers
AgeCommit message (Collapse)Author
2023-08-09treewide: unify the linker symbol reference formatShiji Yang
Now all linker symbols are declared as type char[]. Though we can reference the address via both the array name 'var' and its address '&var'. It's better to unify them to avoid confusing developers. This patch converts all '&var' linker symbol refrences to the most commonly used format 'var'. Signed-off-by: Shiji Yang <yangshiji66@outlook.com> Reviewed-by: Tom Rini <trini@konsulko.com>
2023-08-09Kconfigs: Correct default of "0" on hex type entriesTom Rini
It is not a parse error to have a default value of "0" for a "hex" type entry, instead of "0x0". However, "0" and "0x0" are not treated the same even by the tools themselves. Correct this by changing the default value from "0" to "0x0" for all hex type questions that had the incorrect default. Fix one instance (in two configs) of a default of "0" being used on a hex question to be "0x0". Remove the cases where a defconfig had set a value of "0x0" to be used as the default had been "0". Signed-off-by: Tom Rini <trini@konsulko.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-08-08pci: correct function name in messageHeinrich Schuchardt
If an error message contains a function name, it should match the name of the function throwing the message. Fixes: 7739d93d8288 ("pci: Match region flags using a mask") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-08-08remoteproc: uclass: Clean up a returnDan Carpenter
We know that "pa" is non-NULL so it's nicer to just return zero instead of return !pa. This has no effect on runtime behavior. Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-08-08fdt: off by one in ofnode_lookup_fdt()Dan Carpenter
The "oftree_count" is the number of entries which have been set in the oftree_list[] array. If all the entries have been initialized then this off by one would result in reading one element beyond the end of the array. Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-08-08cros_ec: Fix an error code is cros_ec_get_sku_id()Dan Carpenter
The ec_command_inptr() function returns negative error codes or the number of bytes that it was able to read. The cros_ec_get_sku_id() function should return negative error codes. Right now it returns positive error codes or negative byte counts. Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-08-08Revert "lib: string: Fix strlcpy return value", fix callersMatthias Schiffer
Both the Linux kernel and libbsd agree that strlcpy() should always return strlen(src) and not include the NUL termination. The incorrect U-Boot implementation makes it impossible to check the return value for truncation, and breaks code written with the usual implementation in mind (for example, fdtdec_add_reserved_memory() was subtly broken). I reviewed all callers of strlcpy() and strlcat() and fixed them according to my understanding of the intended function. This reverts commit d3358ecc54be0bc3b4dd11f7a63eab0a2842f772 and adds related fixes. Fixes: d3358ecc54be ("lib: string: Fix strlcpy return value") Signed-off-by: Matthias Schiffer <matthias.schiffer@ew.tq-group.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Sean Anderson <sean.anderson@seco.com>
2023-08-05usb: gadget: ether: Handle gadget driver registration in probe and removeMarek Vasut
Move the ethernet gadget driver registration and removal from ethernet bind and unbind callbacks into driver DM probe and remove callbacks. This way, when the driver is bound, which is triggered deliberately using 'bind' command, the USB ethernet gadget driver is instantiated and bound to the matching UDC. In reverse, when the driver is unbound, which is again triggered deliberately using 'unbind' command, the USB ethernet gadget driver instance is removed. Effectively, this now behaves like running either 'ums' or 'dfu' or any other commands utilizing USB gadget functionality. This also drops use of usb_gadget_release() and moves the use of usb_gadget_initialize() into usb_ether_init() used only by legacy platforms that do not use 'bind' command properly yet. Those have no place in drivers. Signed-off-by: Marek Vasut <marex@denx.de> Tested-by: Tom Rini <trini@konsulko.com> Reviewed-by: Tom Rini <trini@konsulko.com>
2023-08-05usb: gadget: ether: Move probe function above driver structureMarek Vasut
Move the driver probe function above the driver structure, so it can be placed alongside other related functions, like upcoming remove function. No functional change. Signed-off-by: Marek Vasut <marex@denx.de> Tested-by: Tom Rini <trini@konsulko.com> Tested-by: Miquel Raynal <miquel.raynal@bootlin.com> Tested-by: Miquel Raynal <miquel.raynal@bootlin.com> Reviewed-by: Tom Rini <trini@konsulko.com>
2023-08-05usb: gadget: ether: Inline functions used onceMarek Vasut
These functions here are only ever called once since drop of non-DM networking code. Inline them. No functional change. Signed-off-by: Marek Vasut <marex@denx.de> Tested-by: Tom Rini <trini@konsulko.com> Tested-by: Miquel Raynal <miquel.raynal@bootlin.com> Reviewed-by: Tom Rini <trini@konsulko.com>
2023-08-03virtio: provide driver name in debug messageHeinrich Schuchardt
If a driver cannot be bound, provide the driver name in the debug message. Now the debug message may look like this: (virtio-pci.l#0): virtio-rng driver not configured Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-08-03net: mediatek: add support for MediaTek MT7988 SoCWeijie Gao
This patch adds support for MediaTek MT7988. MT7988 features MediaTek NETSYS v3, including three GMACs, and two of them supports 10Gbps USXGMII. MT7988 embeds a MT7531 switch (not MCM) which supports accessing internal registers through MMIO instead of MDIO. Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
2023-08-03net: mediatek: add support for NETSYS v3Weijie Gao
This patch adds support for NETSYS v3 hardware. Comparing to NETSYS v2, NETSYS v3 has three GMACs. Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
2023-08-03net: mediatek: add USXGMII supportWeijie Gao
This patch adds support for USXGMII of SoC. Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
2023-08-03net: mediatek: add support for GMAC/USB3 PHY mux mode for MT7981Weijie Gao
MT7981 has its GMAC2 PHY shared with USB3. To enable GMAC2, mux register must be set to connect the SGMII phy to GMAC2. Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
2023-08-03net: mediatek: add support for SGMII 1Gbps auto-negotiation modeWeijie Gao
Existing SGMII support of mtk-eth is actually a MediaTek-specific 2.5Gbps high-speed SGMII (HSGMII) which does not support auto-negotiation mode. This patch adds SGMII 1Gbps auto-negotiation mode and rename the existing HSGMII to 2500basex. Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
2023-08-03net: mediatek: add missing static qualifierWeijie Gao
mt7531_mmd_ind_read and mt753x_switch_init are defined without static. Since they're not used outside this file, we should add them back. Signed-off-by: Weijie Gao <weijie.gao@mediatek.com> fixup to add static qualifier
2023-08-03net: mediatek: fix direct MDIO clause 45 access via SoCWeijie Gao
The original direct MDIO clause 45 access via SoC is missing the data output. This patch adds it back to ensure MDIO clause 45 can work properly for external PHYs. Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
2023-08-03net: mediatek: optimize the switch reset delay wait timeWeijie Gao
Not all switches requires 1 second delay after deasserting reset. MT7531 requires only maximum 200ms. This patch defines dedicated reset wait time for each switch chip, and will significantly improve the boot time for boards using MT7531. Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
2023-08-03net: mediatek: connect switch to PSE only when starting eth is requestedWeijie Gao
So far the switch is initialized in probe stage and is connected to PSE unconditionally. This will cause all packets being flooded to PSE and may cause PSE hang before entering linux. This patch changes the connection between switch and PSE: - Still initialize switch in probe stage, but disconnect it with PSE - Connect switch with PSE on eth start - Disconnect on eth stop Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
2023-08-03pinctrl: mediatek: add pinctrl driver for MT7988 SoCWeijie Gao
This patch adds pinctrl and gpio support for MT7988 SoC Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
2023-08-03pinctrl: mediatek: add pinmux_set ops supportWeijie Gao
This patch adds pinmux_set ops for mediatek pinctrl framework Signed-off-by: Sam Shih <sam.shih@mediatek.com> Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
2023-08-03pinctrl: mediatek: fix the return value in driving configuration functionsWeijie Gao
The original mediatek pinctrl functions for driving configuration 'mtk_pinconf_drive_set_*' do not return -ENOSUPP even if input parameters are not supported. This patch fixes the return value in those functions. Signed-off-by: Sam Shih <sam.shih@mediatek.com> Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
2023-08-03pinctrl: mediatek: convert most definitions to constWeijie Gao
There exists a situation of the mediatek pinctrl driver that may return wrong pin function value for the pinmux driver: - All pin function arrays are defined without const - Some pin function arrays contain all-zero value, e.g.: static int mt7622_spi_funcs[] = { 0, 0, 0, 0, 0, 0, }; - These arrays will be put into .bss section during compilation - .bss section has no "a" attribute and does not exist in the final binary file after objcopy. - FDT binary blob is appended to the u-boot binary, which occupies the .bss section. - During board_f stage, .bss has not been initialized, and contains the data of FDT, which is not full-zero data. - pinctrl driver is initialized in board_f stage, and it will get wrong data if another driver is going to set default pinctrl. Since pinmux information and soc data are only meant to be read-only, thus should be declared as const. This will force all pinctrl data being put into .rodata section. Since .rodata has "a" attribute, even the all-zero data will be allocated and filled with correct value in to u-boot binary. Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
2023-08-03clk: mediatek: add clock driver support for MediaTek MT7988 SoCWeijie Gao
This patch adds clock driver support for MediaTek MT7988 SoC Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
2023-08-03pwm: mtk: add support for MediaTek MT7988 SoCWeijie Gao
This patch adds PWM support for MediaTek MT7988 SoC. Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
2023-08-03i2c: mediatek: fix I2C usability for MT7981Weijie Gao
MT7981 actually uses MediaTek I2C controller v3 instead of v1. This patch adds support for I2C controller v3 fix fixes the I2C usability for MT7981. Signed-off-by: Sam Shih <sam.shih@mediatek.com> Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
2023-08-03reset: mediatek: check malloc return valaue before useWeijie Gao
This patch add missing return value check for allocating the driver's private data. -ENOMEM will be returned if malloc() fails. Signed-off-by: Sam Shih <sam.shih@mediatek.com> Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
2023-08-03serial: mtk: initial priv data before usingWeijie Gao
This patch ensures driver private data being fully initialized in _debug_uart_init which is not covered by .priv_auto ops. Signed-off-by: Sam Shih <sam.shih@mediatek.com> Signed-off-by: Weijie Gao <weijie.gao@mediatek.com> Reviewed-by: Stefan Roese <sr@denx.de>
2023-08-03spi: mtk_spim: clear IRQ enable bitsWeijie Gao
In u-boot we don't use IRQ. Instead, we poll busy bit in SPI_STATUS. However these IRQ enable bits may be set in previous boot stage (BootROM). If we leave these bits not cleared, although u-boot has disabled IRQ and nothing will happen, the linux kernel may encounter panic during initializing the spim driver due to IRQ event happens before IRQ handler is properly setup. This patch clear IRQ bits to prevent this from happening. Signed-off-by: SkyLake.Huang <skylake.huang@mediatek.com> Signed-off-by: Weijie Gao <weijie.gao@mediatek.com> Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
2023-08-03spi: mtk_spim: get spi clk rate only onceWeijie Gao
We don't really need to switch clk rate during operating SPIM controller. Get clk rate only once at driver probing. Signed-off-by: SkyLake.Huang <skylake.huang@mediatek.com> Signed-off-by: Weijie Gao <weijie.gao@mediatek.com> Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
2023-08-03board: mediatek: update config headersWeijie Gao
Remove unused information from include/configs/mtxxxx.h Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
2023-08-02net: rtl8169: Add one device ID 0x8161Minda Chen
Add rtl8169 NIC device ID and reorder the device ID. Signed-off-by: Minda Chen <minda.chen@starfivetech.com> Reviewed-by: Ramon Fried <rfried.dev@gmail.com> Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
2023-08-02net: rtl8169: Fix DMA minimal aligned compile warning in RISC-VMinda Chen
For RISC-V architeture, hardware maintain the dcache coherency. Software do not flush the cache. So even cache-line size larger than descriptor size, driver can work. Signed-off-by: Minda Chen <minda.chen@starfivetech.com> Reviewed-by: Ramon Fried <rfried.dev@gmail.com> Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
2023-08-02net: rtl8169: Fix compile warning in rtl8169Minda Chen
While compiling rtl8169.c, There are many "make pointer from integer without a cast" compile warnings. fix them with adding cast. Signed-off-by: Minda Chen <minda.chen@starfivetech.com> Reviewed-by: Ramon Fried <rfried.dev@gmail.com> Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
2023-08-02starfive: pci: Add StarFive JH7110 pcie driverMason Huo
Add pcie driver for StarFive JH7110, Also add PLDA PCIe controller common driver functions. Several devices are tested: a) M.2 NVMe SSD b) Realtek 8169 Ethernet adapter. Signed-off-by: Mason Huo <mason.huo@starfivetech.com> Signed-off-by: Minda Chen <minda.chen@starfivetech.com> Acked-by: Pali Rohár <pali@kernel.org> Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
2023-08-02i2c: designware: Add Kconfig for designware_i2c_pci.cMinda Chen
As the Designware_i2c_pci.c uses ACPI APIs, If some SoCs (StarFive JH7110) contain Designware i2c and PCI but do not use ACPI, This file cannot be compiled. So add a new Kconfig for designware_i2c_pci.c, which depends on ACPIGEN Signed-off-by: Minda Chen <minda.chen@starfivetech.com> Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
2023-08-01Merge tag 'x86-pull-20230801' of ↵Tom Rini
https://source.denx.de/u-boot/custodians/u-boot-x86 - MTRR fixes for x86 boards - Add a little more info to 'cbsysinfo' command
2023-08-01Merge tag 'video-20230801' of ↵Tom Rini
https://source.denx.de/u-boot/custodians/u-boot-video - dm video cosmetic style fix - bochs: remove the x86 limitation - correct kconfig text for PCI default FB size - kconfig: drop the superfluous PCI dependency - set up default FB size for Bochs
2023-08-01Merge https://source.denx.de/u-boot/custodians/u-boot-marvellTom Rini
- i2c-gpio: Correctly handle new {sda, scl}-gpios bindings (Chris) - mvebu: x240: Use i2c-gpio instead of built in controller (Chris)
2023-08-01drivers: video: tidss: tidss_drv: Use kconfig VIDEO_REMOVE to remove videoNikhil M Jain
Perform removal of DSS if kconfigs VIDEO_REMOVE or SPL_VIDEO_REMOVE is set by user. Otherwise if above Kconfigs are not selected, it is assumed that user wants splash screen to be displayed until linux kernel boots up. In such scenario, leave the power domain of DSS as "on" so that splash screen stays intact until kernel boots up. Signed-off-by: Nikhil M Jain <n-jain1@ti.com> Reviewed-by: Devarsh Thakkar <devarsht@ti.com>
2023-08-01drivers: video: tidss: tidss_drv: Change remove methodNikhil M Jain
Change remove method of DSS video driver to disable video port instead of performing a soft reset, as soft reset takes longer duration. Video port is disabled by setting enable bit of video port to 0. Signed-off-by: Nikhil M Jain <n-jain1@ti.com> Reviewed-by: Devarsh Thakkar <devarsht@ti.com>
2023-08-01video: bochs: Set the frame buffer size per configurationBin Meng
At present the uclass stored frame buffer size is set to a hard coded value, but we can calculate the correct value based on what is configured. Signed-off-by: Bin Meng <bmeng@tinylab.org> Reviewed-by: Simon Glass <sjg@chromium.org> Tested-by: Simon Glass <sjg@chromium.org> # qemu-x86_64
2023-08-01video: kconfig: Set default FB size for BochsBin Meng
Set up a default frame buffer size of 8MiB for Bochs for non-x86 architecturs as PCI is normally not enumerated before relocation on these architectures. Signed-off-by: Bin Meng <bmeng@tinylab.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-08-01video: kconfig: Drop the superfluous dependencyBin Meng
PCI is always selected by X86 architecture hence "X86 && PCI" does not make it better. Signed-off-by: Bin Meng <bmeng@tinylab.org> Reviewed-by: Simon Glass <sjg@chromium.org> Tested-by: Simon Glass <sjg@chromium.org> # qemu-x86_64
2023-08-01video: kconfig: Fix wrong text for the PCI default FB sizeBin Meng
There is an example in the VIDEO_PCI_DEFAULT_FB_SIZE help text to tell people how to calculate its value but the resolution given does not match the value. Fix it. Signed-off-by: Bin Meng <bmeng@tinylab.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-08-01video: bochs: Remove the x86 dependencyBin Meng
Now that the driver is legacy free, remove the x86 dependency so that it can be used on non-x86 architectures. Signed-off-by: Bin Meng <bmeng@tinylab.org> Reviewed-by: Simon Glass <sjg@chromium.org> Tested-by: Simon Glass <sjg@chromium.org> # qemu-x86_64
2023-08-01video: bochs: Avoid using IO instructions to access VGA IO portBin Meng
At present the driver uses IO instructions to access the legacy VGA IO ports, which unfortunately limits the driver to work only on x86. It turns out the IO instruction is not necessary as Bochs VGA card remaps the legacy VGA IO ports (0x3c0 -> 0x3df) to its memory mapped register space from offset 0x400. Update the driver to use MMIO access for VGA IO port. Signed-off-by: Bin Meng <bmeng@tinylab.org> Reviewed-by: Simon Glass <sjg@chromium.org> Tested-by: Simon Glass <sjg@chromium.org> # qemu-x86_64
2023-08-01video: bochs: Drop the useless argument of bochs_vga_write()Bin Meng
bochs_vga_write() takes 'index' as one argument, but never uses it. While we are here, use macros instead of magic numbers for the VGA IO port register name and value. Signed-off-by: Bin Meng <bmeng@tinylab.org> Reviewed-by: Simon Glass <sjg@chromium.org> Tested-by: Simon Glass <sjg@chromium.org> # qemu-x86_64
2023-08-01video: bochs: Drop inclusion of <asm/mtrr.h>Bin Meng
The driver does not call any MTRR APIs. Signed-off-by: Bin Meng <bmeng@tinylab.org> Reviewed-by: Simon Glass <sjg@chromium.org> Tested-by: Simon Glass <sjg@chromium.org> # qemu-x86_64