summaryrefslogtreecommitdiff
path: root/drivers/serial
Commit message (Collapse)AuthorAgeFilesLines
* dm: core: Create a new header file for 'compat' featuresSimon Glass2020-02-058-0/+8
| | | | | | | | | | | | At present dm/device.h includes the linux-compatible features. This requires including linux/compat.h which in turn includes a lot of headers. One of these is malloc.h which we thus end up including in every file in U-Boot. Apart from the inefficiency of this, it is problematic for sandbox which needs to use the system malloc() in some files. Move the compatibility features into a separate header file. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: core: Require users of devres to include the headerSimon Glass2020-02-055-1/+6
| | | | | | | | | | At present devres.h is included in all files that include dm.h but few make use of it. Also this pulls in linux/compat which adds several more headers. Drop the automatic inclusion and require files to include devres themselves. This provides a good indication of which files use devres. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Anatolij Gustschin <agust@denx.de>
* x86: serial: Add a coreboot serial driverSimon Glass2020-02-043-0/+58
| | | | | | | | | Coreboot can provide information about the serial device in use on a platform. Add a driver that uses this information to produce a working UART. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* serial: ns16550: Support run-time configurationSimon Glass2020-02-042-8/+92
| | | | | | | | | | | | | | | | At present this driver uses an assortment of CONFIG options to control how it accesses the hardware. This is painful for platforms that are supposed to be controlled by a device tree or a previous-stage bootloader. Add a new CONFIG option to enable fully dynamic configuration. This controls register spacing, size, offset and endianness. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Aiden Park <aiden.park@intel.com> Tested-by: Aiden Park <aiden.park@intel.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> [bmeng: squashed in http://patchwork.ozlabs.org/patch/1232929/] Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
* serial: ns16550: Use old baud rate divisor for flushing if not givenPatrik Dahlström2020-01-241-0/+7
| | | | | | | | If baud_divisor is not set (i.e. == -1), we should use the baud divisor already in use for flushing the xmit register. If we don't flush the xmit register, then SPL will hang. Signed-off-by: Patrik Dahlström <risca@dalakolonin.se>
* common: Move hang() to the same header as panic()Simon Glass2020-01-172-0/+2
| | | | | | | | | | At present panic() is in the vsprintf.h header file. That does not seem like an obvious choice for hang(), even though it relates to panic(). So let's put hang() in its own header. Signed-off-by: Simon Glass <sjg@chromium.org> [trini: Migrate a few more files] Signed-off-by: Tom Rini <trini@konsulko.com>
* common: Move clock functions into a new fileSimon Glass2020-01-174-0/+4
| | | | | | | These three clock functions don't use driver model and should be migrated. In the meantime, create a new file to hold them. Signed-off-by: Simon Glass <sjg@chromium.org>
* common: Drop floppy disk supportSimon Glass2020-01-171-6/+1
| | | | | | | | | This seems pretty old now. It has not been converted to driver model and is not used by any boards. Drop it. Signed-off-by: Simon Glass <sjg@chromium.org>
* Add dependencies for MALLOC_F and OF_LIBFDTSean Anderson2020-01-151-0/+3
| | | | | | | Some features implicitly depended on MALLOC_F and OF_LIBFDT and would fail at link-time if these features were not enabled. Signed-off-by: Sean Anderson <seanga2@gmail.com>
* serial_lpuart: add support for i.MXRTGiulio Benetti2020-01-141-4/+11
| | | | | | | | | | | Add i.MXRT compatible string and cpu type support to lpuart driver, to use little endian 32 bits configurations. Also according to RM, the Receive RX FIFO Enable (RXFE) field in LPUART FIFO register is bit 3, so this definition should change to 0x08 as done for i.MX8. It needs also to set baudrate the same way as i.MX8 does. Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
* serial_lpuart: add clock enable if CONFIG_CLK is definedGiulio Benetti2020-01-141-0/+16
| | | | | | | | | | | This driver assumes that lpuart clock is already enabled before probing but using DM only lpuart won't be automatically enabled so add clk_enable() when probing if CONFIG_CLK is defined. If clock is not found, because DM is not used, let's emit a warning and proceed, because serial clock could also be already enabled by non DM code. If clock is found but cna't be enabled then return with error. Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
* serial: sandbox: support UnicodeHeinrich Schuchardt2019-12-101-1/+1
| | | | | | | | | | | Due to a conversion error the sandbox does not accept byte values 0x80-0xff from the keyboard. The UEFI extended text input unit test requires Unicode support. Use unsigned char for the serial buffer. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
* Merge tag 'dm-pull-3dec19' of https://gitlab.denx.de/u-boot/custodians/u-boot-dmTom Rini2019-12-031-17/+19
|\ | | | | | | Fix stdout-path handling
| * dm: serial: Handle "stdout-path" with ":options" correctlyBin Meng2019-12-021-17/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With commit f0921f5098d8 ("fdt: Sync up to the latest libfdt"), SiFive Unleashed board does not boot any more. This was due to the U-Boot local changes commit 77d7fff8cec2 ("fdt: Fix handling of paths with options in them") to libfdt/fdt_ro.c was dropped during the libfdt upgrade. >From the history [1] it was mentioned that the U-Boot changes commit 77d7fff8cec2 ("fdt: Fix handling of paths with options in them") was rejected by libfdt upstream, hence we need find another way to fix the things. This commit uses another method, by updating serial_check_stdout() directly to handle the situation of "stdout-path" with ":options". A simpler way is to change the logic in fdtdec_get_chosen_node() to do similar thing, but I feel that not every property in chosen node may have the option in them, hence it would make more sense to do the special handling in serial_check_stdout() directly. [1]: http://patchwork.ozlabs.org/patch/462756/ Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* | Kconfig: make TPL_DM_SERIAL depend on TPL_DMThomas Hebb2019-12-031-1/+1
| | | | | | | | | | | | | | This missing dependency seems like an oversight, since all other TPL_DM_* options have it. Signed-off-by: Thomas Hebb <tommyhebb@gmail.com>
* | serial: usb: Correct the usbtty_...() prototypesSimon Glass2019-12-021-0/+1
|/ | | | | | | | | The function declarations in serial.h are not in sync with what is currently used in usbtty. Fix this by updating the header and including it, to help catch future such problems. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
* drivers: bcm283x: Set pre-location flag for OF_BOARDMatthias Brugger2019-11-242-2/+2
| | | | | | | | | | | | | U-Boot support on Raspberry Pi 4 relies on the device-tree provided by the firmware. The blob does not contain the U-Boot specific pre-loc-rel properties. The result is, that the U-Boot banner is not printed. We fix this by setting the DM_FLAG_PRE_RELOC flag in the driver, if we rely on a device-tree provided by the firmware. Reported-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Matthias Brugger <mbrugger@suse.com>
* serial: serial_mtk: add non-DM version for SPLWeijie Gao2019-10-252-17/+187
| | | | | | | | This patch adds non-DM version for mtk hsuart driver and makes it compatible with ns16550a driver in configuration. This is needed in SPL with CONFIG_SPL_DM disabled for reducing size. Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
* serial: serial_mtk: enable FIFO and disable flow controlWeijie Gao2019-10-251-0/+21
| | | | | | | This patch adds codes to enable FIFO and disable flow control taken from ns16550 driver. Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
* Merge tag 'u-boot-imx-20191009' of ↵Tom Rini2019-10-091-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | https://gitlab.denx.de/u-boot/custodians/u-boot-imx u-boot-imx-20191009 ------------------- Travis : https://travis-ci.org/sbabic/u-boot-imx/builds/595148532 - MX6UL / ULZ - Toradex board - Allow to set OCRAM for MX6Q/D - MX7ULP - MX8: (container image, imx8mq_mek), SCU API - fix several board booting from SD/EMMC (cubox-i for example) - pico boards [trini: display5 merged manually] Signed-off-by: Tom Rini <trini@konsulko.com>
| * serial: Kconfig: make MXC_UART usable for MX7 and IMX8MPeng Fan2019-10-081-1/+1
| | | | | | | | | | | | | | | | i.MX7 and i.MX8M use mxc uart driver, so let's make the SoC could use MXC_UART kconfig. Signed-off-by: Peng Fan <peng.fan@nxp.com> Reviewed-by: Ye Li <ye.li@nxp.com>
* | dm: pci: Add a function to read a PCI BARSimon Glass2019-10-081-30/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | At present PCI address transaction is not supported so drivers must manually read the correct BAR after reading the device tree info. The ns16550 has a suitable implementation, so move this code into the core DM support. Note that there is no live-tree equivalent at present. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Tested-by: Bin Meng <bmeng.cn@gmail.com> [bmeng: correct the unclear comments in test.dts] Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
* | dm: core: Call ofdata_to_platdata() with of-platdataSimon Glass2019-10-081-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | At present this function is never called when of-platdata is enabled since we never have a device tree. However, this function is responsible for copying over the of-platdata, so we must call it. Otherwise the probe() method would have to be used. Correct this and fix the sandbox serial driver to not read from the device tree and try to write to what is read-only platdata on some platforms. Fixes: 396e343b3d (dm: core: Allow binding a device from a live tree) Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* | serial: ns16550: Allow serial to enabled/disabled in SPLSimon Glass2019-10-081-3/+3
|/ | | | | | | | | At present this driver uses the wrong condition for including the code and drivers in SPL/TPL. Update it so that the code is only included if DM_SERIAL is enabled for SPL/TPL. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* serial: stm32: add Framing error supportPatrick Delaunay2019-08-272-2/+5
| | | | | | | | | Add management of Bit 1 of USART_ISR = FE: Framing error This bit is set by hardware when a de-synchronization, excessive noise or a break character is detected. It is cleared by software, writing 1 to the FECF bit in the USART_ICR register (for stm32 after f4). Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
* Kconfig: Varios: Fix more SPL, TPL dependenciesAdam Ford2019-08-261-2/+2
| | | | | | | | | | | | | | | Several options are presenting themselves on a various boards where the options are clearly not used. (ie, SPL/TPL options when SPL or TPL are not defined) This patch is not attempting to be a complete list of items, but more like low hanging fruit. In some instances, I wasn't sure of DM was required, so I simply made them SPL or TPL. This patch attempts to reduce some of the menuconfig noise by defining dependencies so they don't appear when not used. Signed-off-by: Adam Ford <aford173@gmail.com>
* riscv : serial: use rx watermark to indicate rx data is presentSagar Shrikant Kadam2019-08-151-16/+7
| | | | | | | | | | | | | | | | | | In y-modem transfer mode, tstc/getc fail to check if there is any data available / received in RX FIFO, and so y-modem transfer never succeeds. Using receive watermark bit within ip register fixes the issue. This patch is based on commit c7392b7bc4e1 ("Use the RX watermark interrupt pending bit for TSTC") available at[1] [1] https://github.com/sifive/HiFive_U-Boot/tree/regression Signed-off-by: Sagar Shrikant Kadam <sagar.kadam@sifive.com> Reviewed-by: Anup Patel <anup.patel@wdc.com> Tested-by: Anup Patel <anup.patel@wdc.com> Reviewed-by: Padmarao Begari <padmarao.begari@microchip.com> Tested-by: Padmarao Begari <padmarao.begari@microchip.com>
* env: Rename environment.h to env_internal.hSimon Glass2019-08-112-2/+2
| | | | | | | | | | | | | | This file contains lots of internal details about the environment. Most code can include env.h instead, calling the functions there as needed. Rename this file and add a comment at the top to indicate its internal nature. Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Joe Hershberger <joe.hershberger@ni.com> Reviewed-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com> [trini: Fixup apalis-tk1.c] Signed-off-by: Tom Rini <trini@konsulko.com>
* env: Move env_get() to env.hSimon Glass2019-08-111-0/+1
| | | | | | | Move env_get() over to the new header file. Acked-by: Joe Hershberger <joe.hershberger@ni.com> Signed-off-by: Simon Glass <sjg@chromium.org>
* serial_lpuart: Fix config check issue when using clk driver in SPLYe Li2019-08-111-4/+4
| | | | | | | | Should use CONFIG_IS_ENABLED not IS_ENABLED for CLK driver, so it will check the CONFIG_SPL_CLK when building SPL Signed-off-by: Ye Li <ye.li@nxp.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* serial: mxc: Add compatibles to NXP's serial driver (for imx21 and imx53)Lukasz Majewski2019-07-191-0/+2
| | | | | | | | | | | | | | | | | | | | | | This patch fixes not enabled uart2 (and hence serial console) on i.MX53 devices. After following commit 1d255904c306 ("ARM: dts: imx: imx53: Synchronize iMX53 DT with Linux") from the uart2 compatible the 'fsl,imx7d-uart' has been removed (which was correct). However, the root cause of the problem was the commit 98d62e618bb9 ("arm: imx: add i.MX53 Beckhoff CX9020 Embedded PC") which introduced this compatible. Moreover, without this patch all i.MX53 UARTs are not usable as neither 'fsl,imx53-uart' nor 'fsl,imx21-uart' are in compatible IDs in drivers/serial/serial_mxc.c file. The fix is to add 'fsl,imx53-uart' and 'fsl,imx21-uart' as compatibles for the aforementioned serial driver (those are also defined in the Linux kernel). Signed-off-by: Lukasz Majewski <lukma@denx.de> Acked-by: Marek Vasut <marex@denx.de>
* IMX: serial: dm: Set DM_FLAG_PRE_RELOC in the IMX uart driverLukasz Majewski2019-07-191-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | The DM_FLAG_PRE_RELOC shall be set unconditionally as this driver is going to be re-used in both early SPL and U-Boot proper's pre-reloc. For i.MX based devices it is crucial to have available the serial console before relocation (otherwise the board may hand). The device definition may be provided either via device tree description or with U_BOOT_DEVICE(mxc_serial) definition. In the latter case the device will not bind in U-Boot proper when DM_FLAG_PRE_RELOC is not set. The !CONFIG_IS_ENABLED(OF_CONTROL) #if check was set as a "workaround" for DM problem described in following commit 4687919684e0 ("serial: Remove DM_FLAG_PRE_RELOC flag in various drivers"). Let's look on this check more thoroughly - we add this flag if the board doesn't support OF_CONTROL. This is a bit strange as the serial_mxc.c can be used with CONFIG_DM_SERIAL but without corresponding device tree description (OF_CONTROL). In such case the aforementioned U_BOOT_DEVICE(mxc_serial) definition is used. Other boards/SoCs have this flag set unconditionally for serial driver. Signed-off-by: Lukasz Majewski <lukma@denx.de>
* Merge tag 'u-boot-stm32-20190712' of ↵Tom Rini2019-07-141-2/+2
|\ | | | | | | | | | | | | | | | | | | | | https://gitlab.denx.de/u-boot/custodians/u-boot-stm - syscon: add support for power off - stm32mp1: add op-tee config - stm32mp1: add specific commands: stboard and stm32key - add stm32 mailbox driver - solve many stm32 warnings when building with W=1 - update stm32 gpio driver
| * serial: stm32: Fix warnings when compiling with W=1Patrick Delaunay2019-07-121-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | This patch solves the following warnings: drivers/serial/serial_stm32.c: In function 'stm32_serial_probe': warning: comparison of unsigned expression < 0 is always false [-Wtype-limits] if (plat->clock_rate < 0) { ^ Signed-off-by: Patrice Chotard <patrice.chotard@st.com> Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
* | drivers: serial: lpuart: Enable Little Endian SupportVabhav Sharma2019-07-101-0/+4
|/ | | | | | | | | | By default LPUART driver with compatible string "fsl,ls1021a-lpuart" support big-endian mode.On NXP SoC like LS1028A LPUART IP is little-endian,Added support to Fetch LPUART IP Endianness from lpuart device-tree node. Signed-off-by: Vabhav Sharma <vabhav.sharma@nxp.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* serial: mxc: Add iMX6SX compatible stringMarek Vasut2019-06-111-0/+1
| | | | | | | | | Add compatible string for iMX6SX. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Fabio Estevam <fabio.estevam@nxp.com> Cc: Silvio Fricke <silvio.fricke@softing.com> Cc: Stefano Babic <sbabic@denx.de>
* Merge tag 'u-boot-stm32-20190523' of https://github.com/pchotard/u-bootTom Rini2019-05-241-2/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Add various STM32MP1 fixes for serial, env, clk, board, i2c ... - Add STM32MP1 DDR driver update: These update introduce the DDR interactive mode described in: https://wiki.st.com/stm32mpu/index.php/U-Boot_SPL:_DDR_interactive_mode This mode is used by the CubeMX: DDR tuning tool. https://wiki.st.com/stm32mpu/index.php/STM32CubeMX The DDR interactive mode is NOT activated by default because it increase the SPL size and slow down the boot time (200ms wait added).
| * serial: stm32: remove watchog reset in debug putcPatrick Delaunay2019-05-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For STM32MP, the watchdog is based on DM and the function watchod_reset call the function uclass_get_device(UCLASS_WDT) to found the driver associated IWDG2. As this reset is not mandatory in debug putc (the uart fifo will be empty after some us), we can simplify the code by removing this call. And this patch avoid issue when putc is called before initialization of DM core, before the parsing of the device tree parsing and each node bound to driver; that also avoid memory leak. Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
| * serial: stm32: remove unnecessary tracePatrick Delaunay2019-05-231-1/+0
| | | | | | | | | | | | Remove the trace indicating the end of the DEBUG initialization Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
* | drivers: serial: mcfuart: add DT supportAngelo Dureghello2019-05-242-78/+36
|/ | | | | | | | This patch adds devicetree support to the mcfuart.c driver and removes non DM code. Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Angelo Dureghello <angelo@sysam.it>
* Merge branch 'master' of git://git.denx.de/u-boot-socfpgaTom Rini2019-05-131-4/+1
|\ | | | | | | - A10 FPGA programming support, Gen5 livetree conversion
| * serial: altera_uart: convert to livetreeSimon Goldschmidt2019-05-101-4/+1
| | | | | | | | | | | | | | Convert 'altera_uart_ofdata_to_platdata' to use 'dev_read_u32_default' instead of 'fdtdec_get_int' and get rid of DECLARE_GLOBAL_DATA_PTR. Signed-off-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
* | sh: sh3: Remove CPU supportMarek Vasut2019-05-101-67/+8
| | | | | | | | | | | | | | | | | | | | | | This CPU core is old, no boards using the CPU are left in mainline, it has no prospects of ever being converted to DM, drop it. Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com> Cc: Chris Brandt <chris.brandt@renesas.com> Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org> Cc: Vladimir Zapolskiy <vz@mleia.com> Cc: Yoshihiro Shimoda <shimoda.yoshihiro.uh@renesas.com>
* | sh: sh2: Remove CPU supportMarek Vasut2019-05-101-8/+1
| | | | | | | | | | | | | | | | | | | | | | This CPU core is old, no boards using the CPU are left in mainline, it has no prospects of ever being converted to DM, drop it. Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com> Cc: Chris Brandt <chris.brandt@renesas.com> Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org> Cc: Vladimir Zapolskiy <vz@mleia.com> Cc: Yoshihiro Shimoda <shimoda.yoshihiro.uh@renesas.com>
* | serial: sh: Drop assorted SH3, SH4, SH5 macrosMarek Vasut2019-05-102-115/+8
| | | | | | | | | | | | | | | | | | | | Drop unused macros from the header to clean it up. Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com> Cc: Chris Brandt <chris.brandt@renesas.com> Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org> Cc: Vladimir Zapolskiy <vz@mleia.com> Cc: Yoshihiro Shimoda <shimoda.yoshihiro.uh@renesas.com>
* | serial: sh: Drop RTS7751R2D supportMarek Vasut2019-05-101-5/+0
| | | | | | | | | | | | | | | | | | | | There is no RTS7751R2D support in U-Boot, drop all the RTS7751R2D macros. Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com> Cc: Chris Brandt <chris.brandt@renesas.com> Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org> Cc: Vladimir Zapolskiy <vz@mleia.com> Cc: Yoshihiro Shimoda <shimoda.yoshihiro.uh@renesas.com>
* | serial: sh: Drop SH2007 supportMarek Vasut2019-05-101-8/+2
| | | | | | | | | | | | | | | | | | | | There is no SH2007 support in U-Boot, drop all the SH2007 macros. Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com> Cc: Chris Brandt <chris.brandt@renesas.com> Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org> Cc: Vladimir Zapolskiy <vz@mleia.com> Cc: Yoshihiro Shimoda <shimoda.yoshihiro.uh@renesas.com>
* | serial: sh: Drop H8 supportMarek Vasut2019-05-101-84/+0
|/ | | | | | | | | | There is no H8 support in U-Boot, drop all the H8 macros. Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com> Cc: Chris Brandt <chris.brandt@renesas.com> Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org> Cc: Vladimir Zapolskiy <vz@mleia.com> Cc: Yoshihiro Shimoda <shimoda.yoshihiro.uh@renesas.com>
* Merge branch 'master' of git://git.denx.de/u-boot-sunxiTom Rini2019-05-081-1/+1
|\ | | | | | | | | | | | | | | | | - H6 Beelink GS1 board (Clément) - Olimex A64-Teres-I board (Jonas) - sunxi build fix for CONFIG_CMD_PXE|DHCP (Ondrej) - Change include order (Jagan) - EPHY clock changes (Jagan) - EMAC enablement on Cubietruck Plus, BPI-M3 (Chen-Yu Tsai)
| * serial: sifive: Change include orderJagan Teki2019-05-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Like clk_get_by_index, there is requirement for clk_get_by_index_nodev. In this case to make common code functionalities for dev and nodev, clk_get_by_index is trying to get the index of clock by passing ofnode instead of actual dev like current gpio uclass does. In these scenarios with current order of include files the serial_sifive driver is unable to find CONFIG_ENV_SIZE. In file included from arch/riscv/include/asm/u-boot.h:23:0, from include/dm/of.h:10, from include/dm/ofnode.h:12, from include/clk.h:11, from drivers/serial/serial_sifive.c:6: include/environment.h:145:19: error: 'CONFIG_ENV_SIZE' undeclared here (not in a function); did you mean 'CONFIG_CMD_XIMG'? #define ENV_SIZE (CONFIG_ENV_SIZE - ENV_HEADER_SIZE) So, fix consists of changing the order of include files in serial_sifive.c to include first common.h file. Cc: Anup Patel <Anup.Patel@wdc.com> Cc: Rick Chen <rick@andestech.com> Cc: Paul Walmsley <paul.walmsley@sifive.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>