Re: [U-Boot] [PATCH] rsa: read out public_exponent value based on 32-bit alignment
On 12/28/18 8:30 AM, Ooi, Joyce wrote: > Hi Marek, Hi, > Any comments about this? Use get_unaligned() ? > Thanks, > Joyce Ooi > >> -Original Message- >> From: Ooi, Joyce >> Sent: Saturday, December 8, 2018 4:18 PM >> To: Marek Vasut ; Michal Simek ; >> Siva Durga Prasad Paladugu >> Cc: u-boot@lists.denx.de; Ooi, Joyce ; See, Chin Liang >> ; Chee, Tien Fong ; Tan, >> Ley Foon >> Subject: [PATCH] rsa: read out public_exponent value based on 32-bit >> alignment >> >> Public_exponent is a 64-bit data, which is stored in the device tree blob in >> a 32- >> bit alignment address. This causes a problem for ARM64 when public_exponent >> is read out one shot as a 64-bit data from an unaligned address. Hence, to >> solve >> this problem, public_exponent is read out as two 32-bit datas, and then >> concatenating them. >> >> Signed-off-by: Ooi, Joyce >> --- >> lib/rsa/rsa-mod-exp.c |6 -- >> 1 files changed, 4 insertions(+), 2 deletions(-) >> >> diff --git a/lib/rsa/rsa-mod-exp.c b/lib/rsa/rsa-mod-exp.c index >> 9d78aa1..3eace38 100644 >> --- a/lib/rsa/rsa-mod-exp.c >> +++ b/lib/rsa/rsa-mod-exp.c >> @@ -252,6 +252,9 @@ int rsa_mod_exp_sw(const uint8_t *sig, uint32_t >> sig_len, { >> struct rsa_public_key key; >> int ret; >> +uint64_t exponent = >> +(uint64_t)(*((uint32_t *)(prop->public_exponent + 4))) << 32 | >> +*((uint32_t *)(prop->public_exponent)); >> >> if (!prop) { >> debug("%s: Skipping invalid prop", __func__); @@ -263,8 >> +266,7 @@ int rsa_mod_exp_sw(const uint8_t *sig, uint32_t sig_len, >> if (!prop->public_exponent) >> key.exponent = RSA_DEFAULT_PUBEXP; >> else >> -key.exponent = >> -fdt64_to_cpu(*((uint64_t *)(prop->public_exponent))); >> +key.exponent = fdt64_to_cpu(exponent); >> >> if (!key.len || !prop->modulus || !prop->rr) { >> debug("%s: Missing RSA key info", __func__); >> -- >> 1.7.1 > -- Best regards, Marek Vasut ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
Re: [U-Boot] [PATCH v3] net: phy: add TSE PCS support to dwmac-socfpga
On 12/28/18 7:57 AM, Ooi, Joyce wrote: >> -Original Message- >> From: Marek Vasut [mailto:ma...@denx.de] >> Sent: Thursday, December 27, 2018 4:21 PM >> To: Ooi, Joyce ; Joe Hershberger >> >> Cc: See, Chin Liang ; Ong, Hean Loong >> ; Priyanka Jain ; u- >> b...@lists.denx.de >> Subject: Re: [U-Boot] [PATCH v3] net: phy: add TSE PCS support to dwmac- >> socfpga >> >> On 12/27/18 7:16 AM, Ooi, Joyce wrote: -Original Message- From: Marek Vasut [mailto:ma...@denx.de] Sent: Thursday, December 27, 2018 2:55 AM To: Ooi, Joyce ; Joe Hershberger Cc: See, Chin Liang ; Ong, Hean Loong ; Priyanka Jain ; u- b...@lists.denx.de Subject: Re: [U-Boot] [PATCH v3] net: phy: add TSE PCS support to dwmac- socfpga On 12/26/18 8:47 AM, Ooi, Joyce wrote: > Adding Marek. > >> -Original Message- >> From: U-Boot [mailto:u-boot-boun...@lists.denx.de] On Behalf Of >> Ooi, Joyce >> Sent: Tuesday, November 27, 2018 5:40 PM >> To: Joe Hershberger >> Cc: Ong, Hean Loong ; Priyanka Jain >> ; See, Chin Liang >> ; >> u- b...@lists.denx.de >> Subject: Re: [U-Boot] [PATCH v3] net: phy: add TSE PCS support to >> dwmac- socfpga >> >> Hi Joe, >> >> Any comments/feedback on this v3 patch? I thought we already had TSE support in drivers/net/altera_tse.c , is this related ? >>> drivers/net/altera_tse.c is a different IP, which contains of MAC >>> driver from Intel FPGA and PCS driver from Intel FPGA using MDIO PMA. >>> >>> This net/phy/altr_tse_pcs.c is the Physical Coding Sublayer for DWMAC SGMII >> IP. >>> The DWMAC SGMII IP contains of MAC driver from DWMAC (Synopsis) and >>> PCS driver from Intel FPGA controlling Marvell PHY. >> >> Does this patch need to be split into two (three) patches then ? > This patch adds TSE PCS support to existing dwmac-socfpga.c and designware.c, > which adds a new file net/phy/altr_tse_pcs.c, while dwmac-socfpga.c and > designware.c call its functions. Hence, I didn't split this implementation > into several > patches because I didn't want net/phy/altr_tse_pcs.c to appear like a dead > code. > > If it's confusing, I could rename altr_tse_pcs.c to altr_dwmac_pcs.c, since > it is > under DWMAC SGMII. Is it a separate block which could be used by both Altera TSE and DWMAC or not ? -- Best regards, Marek Vasut ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
Re: [U-Boot] [PATCH v3] net: phy: add TSE PCS support to dwmac-socfpga
On 12/28/18 8:28 AM, Ooi, Joyce wrote: >> -Original Message- >> From: Marek Vasut [mailto:ma...@denx.de] >> Sent: Thursday, December 27, 2018 2:55 AM >> To: Ooi, Joyce ; Joe Hershberger >> >> Cc: See, Chin Liang ; Ong, Hean Loong >> ; Priyanka Jain ; u- >> b...@lists.denx.de >> Subject: Re: [U-Boot] [PATCH v3] net: phy: add TSE PCS support to dwmac- >> socfpga >> >> On 12/26/18 8:47 AM, Ooi, Joyce wrote: >>> Adding Marek. >>> -Original Message- From: U-Boot [mailto:u-boot-boun...@lists.denx.de] On Behalf Of Ooi, Joyce Sent: Tuesday, November 27, 2018 5:40 PM To: Joe Hershberger Cc: Ong, Hean Loong ; Priyanka Jain ; See, Chin Liang ; u- b...@lists.denx.de Subject: Re: [U-Boot] [PATCH v3] net: phy: add TSE PCS support to dwmac- socfpga Hi Joe, Any comments/feedback on this v3 patch? >> >> I thought we already had TSE support in drivers/net/altera_tse.c , is this >> related >> ? >> Thanks. Regards, Joyce Ooi > -Original Message- > From: Ooi, Joyce > Sent: Friday, November 9, 2018 6:16 PM > To: Joe Hershberger > Cc: Grygorii Strashko ; Neil Armstrong > ; Mario Six ; Florian > Fainelli ; Priyanka Jain > ; Ooi, Joyce ; See, Chin > Liang ; Ong, Hean Loong > ; u-boot@lists.denx.de > Subject: [PATCH v3] net: phy: add TSE PCS support to dwmac-socfpga > > This adds support for TSE PCS (Triple Speed Ethernet Physical Coding > Sublayer) that uses SGMII adapter when the phy-mode in device tree > is set to sgmii. > > Signed-off-by: Ooi, Joyce > --- > arch/arm/mach-socfpga/include/mach/misc.h |3 + > arch/arm/mach-socfpga/misc_s10.c |6 + > drivers/net/Makefile |3 +- > drivers/net/designware.c |5 + > drivers/net/designware.h |1 + > drivers/net/dwmac_socfpga.c | 122 +++ > drivers/net/phy/altr_tse_pcs.c| 184 + > drivers/net/phy/altr_tse_pcs.h| 56 + > 8 files changed, 379 insertions(+), 1 deletions(-) create mode > 100644 drivers/net/phy/altr_tse_pcs.c create mode 100644 > drivers/net/phy/altr_tse_pcs.h > --- > v2: add a __weak function to make it compatible for all socfpga > platforms > v3: remove __weak function and use board-specific implementation > instead > > diff --git a/arch/arm/mach-socfpga/include/mach/misc.h > b/arch/arm/mach- socfpga/include/mach/misc.h index 4fc9570..751705e > 100644 > --- a/arch/arm/mach-socfpga/include/mach/misc.h > +++ b/arch/arm/mach-socfpga/include/mach/misc.h > @@ -30,6 +30,9 @@ void socfpga_init_security_policies(void); > void socfpga_sdram_remap_zero(void); #endif > > +#ifdef CONFIG_TARGET_SOCFPGA_STRATIX10 int > +socfpga_test_fpga_ready(void); #endif > void do_bridge_reset(int enable); > > #endif /* _MISC_H_ */ > diff --git a/arch/arm/mach-socfpga/misc_s10.c b/arch/arm/mach- > socfpga/misc_s10.c index e599362..3cd9c30 100644 > --- a/arch/arm/mach-socfpga/misc_s10.c > +++ b/arch/arm/mach-socfpga/misc_s10.c > @@ -11,6 +11,7 @@ > #include > #include > #include > +#include > #include #include > #include @@ -91,6 > +92,11 @@ static int socfpga_set_phymode(void) > > return 0; > } > + > +int socfpga_test_fpga_ready(void) > +{ > + return mbox_get_fpga_config_status(MBOX_CONFIG_STATUS); > +} > #else > static int socfpga_set_phymode(void) { diff --git > a/drivers/net/Makefile b/drivers/net/Makefile index > 48a2878..c2333b5 > 100644 > --- a/drivers/net/Makefile > +++ b/drivers/net/Makefile > @@ -14,7 +14,7 @@ obj-$(CONFIG_CALXEDA_XGMAC) += calxedaxgmac.o > obj-$(CONFIG_CS8900) += cs8900.o > obj-$(CONFIG_TULIP) += dc2114x.o > obj-$(CONFIG_ETH_DESIGNWARE) += designware.o > -obj-$(CONFIG_ETH_DESIGNWARE_SOCFPGA) += dwmac_socfpga.o > +obj-$(CONFIG_ETH_DESIGNWARE_SOCFPGA) += dwmac-socfpga.o > obj-$(CONFIG_DRIVER_DM9000) += dm9000x.o > obj-$(CONFIG_DNET) += dnet.o > obj-$(CONFIG_E1000) += e1000.o > @@ -73,3 +73,4 @@ obj-$(CONFIG_PIC32_ETH) += pic32_mdio.o > pic32_eth.o > obj-$(CONFIG_DWC_ETH_QOS) += dwc_eth_qos.o > obj-$(CONFIG_FSL_PFE) += pfe_eth/ > obj-$(CONFIG_SNI_AVE) += sni_ave.o > +dwmac-socfpga-objs := phy/altr_tse_pcs.o dwmac_socfpga.o > diff --git a/drivers/net/designware.c b/drivers/net/designware.c > index > 19db0a8..666cf41 100644 > --- a/drivers/net/designware.c > +++ b/drivers/net/designware.c > @@ -235,6 +235,8 @@ static int dw_adjust_link(struct dw_eth_dev > *priv, struct eth_mac_regs *mac_p, > struct phy_device *phydev) > { > u32 c
Re: [U-Boot] [PATCH 3/3] video: rockchip: Use TrueType fonts with jerry
> On 27.12.2018, at 23:25, Simon Glass wrote: > > As an example of how to enable TrueType fonts, move chromebook_jerry over > to use these. > > Signed-off-by: Simon Glass Reviewed-by: Philipp Tomsich ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
Re: [U-Boot] [PATCH 2/3] video: Add a default TrueType font
> On 27.12.2018, at 23:25, Simon Glass wrote: > > At present it is possible to enable TrueType support but not include any > fonts. This results in a blank display. Select Nimbus as the default font > to avoid this. > > Signed-off-by: Simon Glass Reviewed-by: Philipp Tomsich ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
Re: [U-Boot] [PATCH 1/3] video: Add information about using TrueType fonts
On 27.12.2018, at 23:25, Simon Glass wrote: > > U-Boot supports using TrueType fonts on the console, which is useful for > presenting a nice UI to users, e.g. for system recovery. > > Add information about how to compile this on ARM platforms, since this is > not obvious. > > Signed-off-by: Simon Glass Reviewed-by: Philipp Tomsich ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH 2/2 (RFT)] am335x: igep003x: Add Device Tree Support and DM_MMC driver
This adds device tree and the DM_MMC driver for the AM335x IGEP based boards. Signed-off-by: Enric Balletbo i Serra --- arch/arm/dts/Makefile | 3 +- arch/arm/dts/am335x-base0033.dts | 95 + arch/arm/dts/am335x-igep0033.dtsi | 323 ++ configs/am335x_igep003x_defconfig | 3 + 4 files changed, 423 insertions(+), 1 deletion(-) create mode 100644 arch/arm/dts/am335x-base0033.dts create mode 100644 arch/arm/dts/am335x-igep0033.dtsi diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile index b506daf9b0..1d44eb3c94 100644 --- a/arch/arm/dts/Makefile +++ b/arch/arm/dts/Makefile @@ -194,7 +194,8 @@ dtb-$(CONFIG_AM33XX) += am335x-boneblack.dtb am335x-bone.dtb \ am335x-rut.dtb \ am335x-pdu001.dtb \ am335x-chiliboard.dtb \ - am335x-sl50.dtb + am335x-sl50.dtb \ + am335x-base0033.dtb dtb-$(CONFIG_AM43XX) += am437x-gp-evm.dtb am437x-sk-evm.dtb\ am43x-epos-evm.dtb \ am437x-idk-evm.dtb \ diff --git a/arch/arm/dts/am335x-base0033.dts b/arch/arm/dts/am335x-base0033.dts new file mode 100644 index 00..29782be076 --- /dev/null +++ b/arch/arm/dts/am335x-base0033.dts @@ -0,0 +1,95 @@ +/* + * am335x-base0033.dts - Device Tree file for IGEP AQUILA EXPANSION + * + * Copyright (C) 2013 ISEE 2007 SL - http://www.isee.biz + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ + +#include "am335x-igep0033.dtsi" + +/ { + model = "IGEP COM AM335x on AQUILA Expansion"; + compatible = "isee,am335x-base0033", "isee,am335x-igep0033", "ti,am33xx"; + + hdmi { + compatible = "ti,tilcdc,slave"; + i2c = <&i2c0>; + pinctrl-names = "default", "off"; + pinctrl-0 = <&nxp_hdmi_pins>; + pinctrl-1 = <&nxp_hdmi_off_pins>; + status = "okay"; + }; + + leds_base { + pinctrl-names = "default"; + pinctrl-0 = <&leds_base_pins>; + + compatible = "gpio-leds"; + + led0 { + label = "base:red:user"; + gpios = <&gpio1 21 GPIO_ACTIVE_HIGH>; /* gpio1_21 */ + default-state = "off"; + }; + + led1 { + label = "base:green:user"; + gpios = <&gpio2 0 GPIO_ACTIVE_HIGH>;/* gpio2_0 */ + default-state = "off"; + }; + }; +}; + +&am33xx_pinmux { + nxp_hdmi_pins: pinmux_nxp_hdmi_pins { + pinctrl-single,pins = < + AM33XX_IOPAD(0x9b0, PIN_OUTPUT | MUX_MODE3) /* xdma_event_intr0.clkout1 */ + AM33XX_IOPAD(0x8a0, PIN_OUTPUT | MUX_MODE0) /* lcd_data0 */ + AM33XX_IOPAD(0x8a4, PIN_OUTPUT | MUX_MODE0) /* lcd_data1 */ + AM33XX_IOPAD(0x8a8, PIN_OUTPUT | MUX_MODE0) /* lcd_data2 */ + AM33XX_IOPAD(0x8ac, PIN_OUTPUT | MUX_MODE0) /* lcd_data3 */ + AM33XX_IOPAD(0x8b0, PIN_OUTPUT | MUX_MODE0) /* lcd_data4 */ + AM33XX_IOPAD(0x8b4, PIN_OUTPUT | MUX_MODE0) /* lcd_data5 */ + AM33XX_IOPAD(0x8b8, PIN_OUTPUT | MUX_MODE0) /* lcd_data6 */ + AM33XX_IOPAD(0x8bc, PIN_OUTPUT | MUX_MODE0) /* lcd_data7 */ + AM33XX_IOPAD(0x8c0, PIN_OUTPUT | MUX_MODE0) /* lcd_data8 */ + AM33XX_IOPAD(0x8c4, PIN_OUTPUT | MUX_MODE0) /* lcd_data9 */ + AM33XX_IOPAD(0x8c8, PIN_OUTPUT | MUX_MODE0) /* lcd_data10 */ + AM33XX_IOPAD(0x8cc, PIN_OUTPUT | MUX_MODE0) /* lcd_data11 */ + AM33XX_IOPAD(0x8d0, PIN_OUTPUT | MUX_MODE0) /* lcd_data12 */ + AM33XX_IOPAD(0x8d4, PIN_OUTPUT | MUX_MODE0) /* lcd_data13 */ + AM33XX_IOPAD(0x8d8, PIN_OUTPUT | MUX_MODE0) /* lcd_data14 */ + AM33XX_IOPAD(0x8dc, PIN_OUTPUT | MUX_MODE0) /* lcd_data15 */ + AM33XX_IOPAD(0x8e0, PIN_OUTPUT | MUX_MODE0) /* lcd_vsync */ + AM33XX_IOPAD(0x8e4, PIN_OUTPUT | MUX_MODE0) /* lcd_hsync */ + AM33XX_IOPAD(0x8e8, PIN_OUTPUT | MUX_MODE0) /* lcd_pclk */ + AM33XX_IOPAD(0x8ec, PIN_OUTPUT | MUX_MODE0) /* lcd_ac_bias_en */ + >; + }; + nxp_hdmi_off_pins: pinmux_nxp_hdmi_off_pins { + pinctrl-single,pins = < + AM33XX_IOPAD(0x9b0, PIN_OUTPUT | MUX_MODE3) /* xdma_event_intr0.clkout1 */ + >; + }; + + leds_base_pins: pinmux_leds_base_pins { + pinctrl-single,pins = < + AM3
[U-Boot] [PATCH 1/2] igep003x: MAINTAINER: Remove myself as maintainer and add Javier
I can't continue maintaining the board because I don't have access to the hardware anymore, so remove myself from the entry and add Javier who has volunteered to help and maintain the board. Signed-off-by: Enric Balletbo i Serra Signed-off-by: Javier Martínez Canillas --- board/isee/igep003x/MAINTAINERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/board/isee/igep003x/MAINTAINERS b/board/isee/igep003x/MAINTAINERS index a74938a7d2..ba92e64e2a 100644 --- a/board/isee/igep003x/MAINTAINERS +++ b/board/isee/igep003x/MAINTAINERS @@ -1,5 +1,5 @@ IGEP003X BOARD -M: Enric Balletbo i Serra +M: Javier Martínez Canillas S: Maintained F: board/isee/igep003x/ F: include/configs/am335x_igep003x.h -- 2.19.2 ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH 1/1] efi_loader: LoadImage: always allocate new pages
If we want to properly unload images in Exit() the memory should always be allocated in the same way. As we allocate memory when reading from file we should do the same when the original image is in memory. Further patches will be needed: - use LoadImage() in bootefi and bootmgr - implement correct unloading of images in Exit() Signed-off-by: Heinrich Schuchardt --- include/efi_loader.h | 2 +- lib/efi_loader/efi_bootmgr.c | 2 +- lib/efi_loader/efi_boottime.c | 56 --- 3 files changed, 40 insertions(+), 20 deletions(-) diff --git a/include/efi_loader.h b/include/efi_loader.h index d4412d30bf..3525b65f49 100644 --- a/include/efi_loader.h +++ b/include/efi_loader.h @@ -391,7 +391,7 @@ efi_status_t efi_setup_loaded_image(struct efi_device_path *device_path, struct efi_loaded_image_obj **handle_ptr, struct efi_loaded_image **info_ptr); efi_status_t efi_load_image_from_path(struct efi_device_path *file_path, - void **buffer); + void **buffer, efi_uintn_t *size); /* Print information about all loaded images */ void efi_print_image_infos(void *pc); diff --git a/lib/efi_loader/efi_bootmgr.c b/lib/efi_loader/efi_bootmgr.c index a095df3f54..196116b547 100644 --- a/lib/efi_loader/efi_bootmgr.c +++ b/lib/efi_loader/efi_bootmgr.c @@ -150,7 +150,7 @@ static void *try_load_entry(uint16_t n, struct efi_device_path **device_path, debug("%s: trying to load \"%ls\" from %pD\n", __func__, lo.label, lo.file_path); - ret = efi_load_image_from_path(lo.file_path, &image); + ret = efi_load_image_from_path(lo.file_path, &image, &size); if (ret != EFI_SUCCESS) goto error; diff --git a/lib/efi_loader/efi_boottime.c b/lib/efi_loader/efi_boottime.c index de746a2d48..37f0f0e338 100644 --- a/lib/efi_loader/efi_boottime.c +++ b/lib/efi_loader/efi_boottime.c @@ -1578,17 +1578,19 @@ failure: /** * efi_load_image_from_path() - load an image using a file path - * @file_path: the path of the image to load - * @buffer:buffer containing the loaded image + * @file_path: the path of the image to load + * @buffer:buffer containing the loaded image + * @size: size of the loaded image * * Return: status code */ efi_status_t efi_load_image_from_path(struct efi_device_path *file_path, - void **buffer) + void **buffer, efi_uintn_t *size) { struct efi_file_info *info = NULL; struct efi_file_handle *f; static efi_status_t ret; + u64 addr; efi_uintn_t bs; f = efi_file_from_path(file_path); @@ -1606,22 +1608,21 @@ efi_status_t efi_load_image_from_path(struct efi_device_path *file_path, if (ret != EFI_SUCCESS) goto error; - ret = efi_allocate_pool(EFI_LOADER_DATA, info->file_size, buffer); - if (ret) + ret = efi_allocate_pages(EFI_ALLOCATE_ANY_PAGES, +EFI_RUNTIME_SERVICES_CODE, +efi_size_in_pages(), &addr); + if (ret != EFI_SUCCESS) { + ret = EFI_OUT_OF_RESOURCES; goto error; + } + *buffer = (void *)(uintptr_t)addr; bs = info->file_size; EFI_CALL(ret = f->read(f, &bs, *buffer)); error: - free(info); EFI_CALL(f->close(f)); - if (ret != EFI_SUCCESS) { - efi_free_pool(*buffer); - *buffer = NULL; - } - return ret; } @@ -1648,6 +1649,7 @@ static efi_status_t EFIAPI efi_load_image(bool boot_policy, efi_uintn_t source_size, efi_handle_t *image_handle) { + struct efi_device_path *dp, *fp; struct efi_loaded_image *info = NULL; struct efi_loaded_image_obj **image_obj = (struct efi_loaded_image_obj **)image_handle; @@ -1667,9 +1669,10 @@ static efi_status_t EFIAPI efi_load_image(bool boot_policy, } if (!source_buffer) { - struct efi_device_path *dp, *fp; - - ret = efi_load_image_from_path(file_path, &source_buffer); + ret = efi_load_image_from_path(file_path, &source_buffer, + &source_size); + if (ret == EFI_OUT_OF_RESOURCES) + goto error; if (ret != EFI_SUCCESS) goto failure; /* @@ -1677,26 +1680,43 @@ static efi_status_t EFIAPI efi_load_image(bool boot_policy, * file parts: */ efi_dp_split_file_path(file_path, &dp, &fp); - ret = efi_setup_loaded_image(dp, fp, image_obj, &info); - if (r
[U-Boot] [PATCH 4/5] efi_loader: signature of StartImage and Exit
We use u16* for Unicode strings and efi_uintn_t for UINTN. Correct the signature of efi_exit() and efi_start_image(). Signed-off-by: Heinrich Schuchardt --- include/efi_api.h | 6 +++--- lib/efi_loader/efi_boottime.c | 10 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/include/efi_api.h b/include/efi_api.h index 0e5c6e92d0..4389dbeddc 100644 --- a/include/efi_api.h +++ b/include/efi_api.h @@ -115,11 +115,11 @@ struct efi_boot_services { struct efi_device_path *file_path, void *source_buffer, efi_uintn_t source_size, efi_handle_t *image); efi_status_t (EFIAPI *start_image)(efi_handle_t handle, - unsigned long *exitdata_size, - s16 **exitdata); + efi_uintn_t *exitdata_size, + u16 **exitdata); efi_status_t (EFIAPI *exit)(efi_handle_t handle, efi_status_t exit_status, - unsigned long exitdata_size, s16 *exitdata); + efi_uintn_t exitdata_size, u16 *exitdata); efi_status_t (EFIAPI *unload_image)(efi_handle_t image_handle); efi_status_t (EFIAPI *exit_boot_services)(efi_handle_t, unsigned long); diff --git a/lib/efi_loader/efi_boottime.c b/lib/efi_loader/efi_boottime.c index 4231e8e02f..590e6f11a5 100644 --- a/lib/efi_loader/efi_boottime.c +++ b/lib/efi_loader/efi_boottime.c @@ -1724,8 +1724,8 @@ error: * Return: status code */ static efi_status_t EFIAPI efi_start_image(efi_handle_t image_handle, - unsigned long *exit_data_size, - s16 **exit_data) + efi_uintn_t *exit_data_size, + u16 **exit_data) { struct efi_loaded_image_obj *image_obj = (struct efi_loaded_image_obj *)image_handle; @@ -1791,8 +1791,8 @@ static efi_status_t EFIAPI efi_start_image(efi_handle_t image_handle, */ static efi_status_t EFIAPI efi_exit(efi_handle_t image_handle, efi_status_t exit_status, - unsigned long exit_data_size, - int16_t *exit_data) + efi_uintn_t exit_data_size, + u16 *exit_data) { /* * TODO: We should call the unload procedure of the loaded @@ -1801,7 +1801,7 @@ static efi_status_t EFIAPI efi_exit(efi_handle_t image_handle, struct efi_loaded_image_obj *image_obj = (struct efi_loaded_image_obj *)image_handle; - EFI_ENTRY("%p, %ld, %ld, %p", image_handle, exit_status, + EFI_ENTRY("%p, %ld, %zu, %p", image_handle, exit_status, exit_data_size, exit_data); /* Make sure entry/exit counts for EFI world cross-overs match */ -- 2.19.2 ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH 0/5] efi_loader: rework loading and starting of images
This patch series starts the necessary changes needed to correctly implement the unloading of images in Exit(). If we want to properly unload images in Exit() the memory should always be allocated in the same way. As we allocate memory when reading from file we should do the same when the original image is in memory. Up to now efi_load_pe() returns the entry point or NULL in case of an error. This does not allow to return correct error codes from LoadImage(). Let efi_load_pe() return a status code and fill in the entry point in the corresponding field of the image object. We use u16* for Unicode strings and efi_uintn_t for UINTN. Correct the signature of efi_exit() and efi_start_image(). Remove the duplicate code in efi_do_enter() and use efi_start_image() to start the image invoked by the bootefi command. Adjust a debug message. Further patches will be needed: - use LoadImage() in bootefi and bootmgr - implement correct unloading of images in Exit() Heinrich Schuchardt (5): efi_loader: LoadImage: always allocate new pages efi_loader: set entry point in efi_load_pe() efi_loader: avoid unnecessary pointer to long conversion efi_loader: signature of StartImage and Exit efi_loader: use efi_start_image() for bootefi cmd/bootefi.c | 33 ++ include/efi_api.h | 6 +-- include/efi_loader.h | 10 +++-- lib/efi_loader/efi_bootmgr.c | 2 +- lib/efi_loader/efi_boottime.c | 74 +++ lib/efi_loader/efi_image_loader.c | 34 -- 6 files changed, 81 insertions(+), 78 deletions(-) -- 2.19.2 ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH 1/5] efi_loader: LoadImage: always allocate new pages
If we want to properly unload images in Exit() the memory should always be allocated in the same way. As we allocate memory when reading from file we should do the same when the original image is in memory. Further patches will be needed: - use LoadImage() in bootefi and bootmgr - implement correct unloading of images in Exit() Signed-off-by: Heinrich Schuchardt --- include/efi_loader.h | 2 +- lib/efi_loader/efi_bootmgr.c | 2 +- lib/efi_loader/efi_boottime.c | 56 --- 3 files changed, 40 insertions(+), 20 deletions(-) diff --git a/include/efi_loader.h b/include/efi_loader.h index 53f08161ab..a4c869b623 100644 --- a/include/efi_loader.h +++ b/include/efi_loader.h @@ -387,7 +387,7 @@ efi_status_t efi_setup_loaded_image(struct efi_device_path *device_path, struct efi_loaded_image_obj **handle_ptr, struct efi_loaded_image **info_ptr); efi_status_t efi_load_image_from_path(struct efi_device_path *file_path, - void **buffer); + void **buffer, efi_uintn_t *size); /* Print information about all loaded images */ void efi_print_image_infos(void *pc); diff --git a/lib/efi_loader/efi_bootmgr.c b/lib/efi_loader/efi_bootmgr.c index a095df3f54..196116b547 100644 --- a/lib/efi_loader/efi_bootmgr.c +++ b/lib/efi_loader/efi_bootmgr.c @@ -150,7 +150,7 @@ static void *try_load_entry(uint16_t n, struct efi_device_path **device_path, debug("%s: trying to load \"%ls\" from %pD\n", __func__, lo.label, lo.file_path); - ret = efi_load_image_from_path(lo.file_path, &image); + ret = efi_load_image_from_path(lo.file_path, &image, &size); if (ret != EFI_SUCCESS) goto error; diff --git a/lib/efi_loader/efi_boottime.c b/lib/efi_loader/efi_boottime.c index f592e4083f..ba76f7ff50 100644 --- a/lib/efi_loader/efi_boottime.c +++ b/lib/efi_loader/efi_boottime.c @@ -1566,17 +1566,19 @@ failure: /** * efi_load_image_from_path() - load an image using a file path - * @file_path: the path of the image to load - * @buffer:buffer containing the loaded image + * @file_path: the path of the image to load + * @buffer:buffer containing the loaded image + * @size: size of the loaded image * * Return: status code */ efi_status_t efi_load_image_from_path(struct efi_device_path *file_path, - void **buffer) + void **buffer, efi_uintn_t *size) { struct efi_file_info *info = NULL; struct efi_file_handle *f; static efi_status_t ret; + u64 addr; efi_uintn_t bs; f = efi_file_from_path(file_path); @@ -1594,22 +1596,21 @@ efi_status_t efi_load_image_from_path(struct efi_device_path *file_path, if (ret != EFI_SUCCESS) goto error; - ret = efi_allocate_pool(EFI_LOADER_DATA, info->file_size, buffer); - if (ret) + ret = efi_allocate_pages(EFI_ALLOCATE_ANY_PAGES, +EFI_RUNTIME_SERVICES_CODE, +efi_size_in_pages(), &addr); + if (ret != EFI_SUCCESS) { + ret = EFI_OUT_OF_RESOURCES; goto error; + } + *buffer = (void *)(uintptr_t)addr; bs = info->file_size; EFI_CALL(ret = f->read(f, &bs, *buffer)); error: - free(info); EFI_CALL(f->close(f)); - if (ret != EFI_SUCCESS) { - efi_free_pool(*buffer); - *buffer = NULL; - } - return ret; } @@ -1636,6 +1637,7 @@ static efi_status_t EFIAPI efi_load_image(bool boot_policy, efi_uintn_t source_size, efi_handle_t *image_handle) { + struct efi_device_path *dp, *fp; struct efi_loaded_image *info = NULL; struct efi_loaded_image_obj **image_obj = (struct efi_loaded_image_obj **)image_handle; @@ -1655,9 +1657,10 @@ static efi_status_t EFIAPI efi_load_image(bool boot_policy, } if (!source_buffer) { - struct efi_device_path *dp, *fp; - - ret = efi_load_image_from_path(file_path, &source_buffer); + ret = efi_load_image_from_path(file_path, &source_buffer, + &source_size); + if (ret == EFI_OUT_OF_RESOURCES) + goto error; if (ret != EFI_SUCCESS) goto failure; /* @@ -1665,26 +1668,43 @@ static efi_status_t EFIAPI efi_load_image(bool boot_policy, * file parts: */ efi_dp_split_file_path(file_path, &dp, &fp); - ret = efi_setup_loaded_image(dp, fp, image_obj, &info); - if (r
[U-Boot] [PATCH 2/5] efi_loader: set entry point in efi_load_pe()
Up to now efi_load_pe() returns the entry point or NULL in case of an error. This does not allow to return correct error codes from LoadImage(). Let efi_load_pe() return a status code and fill in the entry point in the corresponding field of the image object. Signed-off-by: Heinrich Schuchardt --- cmd/bootefi.c | 14 + include/efi_loader.h | 4 ++-- lib/efi_loader/efi_boottime.c | 6 ++ lib/efi_loader/efi_image_loader.c | 34 ++- 4 files changed, 29 insertions(+), 29 deletions(-) diff --git a/cmd/bootefi.c b/cmd/bootefi.c index cc34fe880c..cb4d797e90 100644 --- a/cmd/bootefi.c +++ b/cmd/bootefi.c @@ -342,9 +342,6 @@ static efi_status_t do_bootefi_exec(void *efi, struct efi_loaded_image_obj *image_obj = NULL; struct efi_loaded_image *loaded_image_info = NULL; - EFIAPI efi_status_t (*entry)(efi_handle_t image_handle, -struct efi_system_table *st); - /* * Special case for efi payload not loaded from disk, such as * 'bootefi hello' or for example payload loaded directly into @@ -376,11 +373,9 @@ static efi_status_t do_bootefi_exec(void *efi, goto err_prepare; /* Load the EFI payload */ - entry = efi_load_pe(image_obj, efi, loaded_image_info); - if (!entry) { - ret = EFI_LOAD_ERROR; + ret = efi_load_pe(image_obj, efi, loaded_image_info); + if (ret != EFI_SUCCESS) goto err_prepare; - } if (memdp) { struct efi_device_path_memory *mdp = (void *)memdp; @@ -395,14 +390,15 @@ static efi_status_t do_bootefi_exec(void *efi, "{ro,boot}(blob)"); /* Call our payload! */ - debug("%s:%d Jumping to 0x%lx\n", __func__, __LINE__, (long)entry); + debug("%s:%d Jumping to 0x%lx\n", __func__, __LINE__, + (long)image_obj->entry); if (setjmp(&image_obj->exit_jmp)) { ret = image_obj->exit_status; goto err_prepare; } - ret = efi_do_enter(&image_obj->header, &systab, entry); + ret = efi_do_enter(&image_obj->header, &systab, image_obj->entry); err_prepare: /* image has returned, loaded-image obj goes *poof*: */ diff --git a/include/efi_loader.h b/include/efi_loader.h index a4c869b623..ab6dc9b2d7 100644 --- a/include/efi_loader.h +++ b/include/efi_loader.h @@ -291,8 +291,8 @@ efi_status_t efi_set_watchdog(unsigned long timeout); /* Called from places to check whether a timer expired */ void efi_timer_check(void); /* PE loader implementation */ -void *efi_load_pe(struct efi_loaded_image_obj *handle, void *efi, - struct efi_loaded_image *loaded_image_info); +efi_status_t efi_load_pe(struct efi_loaded_image_obj *handle, void *efi, +struct efi_loaded_image *loaded_image_info); /* Called once to store the pristine gd pointer */ void efi_save_gd(void); /* Special case handler for error/abort that just tries to dtrt to get diff --git a/lib/efi_loader/efi_boottime.c b/lib/efi_loader/efi_boottime.c index ba76f7ff50..4231e8e02f 100644 --- a/lib/efi_loader/efi_boottime.c +++ b/lib/efi_loader/efi_boottime.c @@ -1690,11 +1690,9 @@ static efi_status_t EFIAPI efi_load_image(bool boot_policy, ret = efi_setup_loaded_image(dp, fp, image_obj, &info); if (ret != EFI_SUCCESS) goto failure; - (*image_obj)->entry = efi_load_pe(*image_obj, source_buffer, info); - if (!(*image_obj)->entry) { - ret = EFI_UNSUPPORTED; + ret = efi_load_pe(*image_obj, source_buffer, info); + if (ret != EFI_SUCCESS) goto failure; - } /* Update the type of the allocated memory */ efi_add_memory_map((uintptr_t)source_buffer, efi_size_in_pages(source_size), diff --git a/lib/efi_loader/efi_image_loader.c b/lib/efi_loader/efi_image_loader.c index a18ce0a570..f5ac6e22e6 100644 --- a/lib/efi_loader/efi_image_loader.c +++ b/lib/efi_loader/efi_image_loader.c @@ -193,13 +193,20 @@ static void efi_set_code_and_data_type( } } -/* +/** + * efi_load_pe() - relocate EFI binary + * * This function loads all sections from a PE binary into a newly reserved * piece of memory. On successful load it then returns the entry point for * the binary. Otherwise NULL. + * + * @handle:loaded image handle + * @efi: pointer to the EFI binary + * @loaded_image_info: loaded image protocol + * Return: status code */ -void *efi_load_pe(struct efi_loaded_image_obj *handle, void *efi, - struct efi_loaded_image *loaded_image_info) +efi_status_t efi_load_pe(struct efi_loaded_image_obj *handle, void *efi, +struct efi_loaded_image *loaded_image_info) { IMAGE_NT_HEADERS32 *nt; IMAGE_DOS_HEADER *dos; @@ -210,7 +217,
[U-Boot] [PATCH 5/5] efi_loader: use efi_start_image() for bootefi
Remove the duplicate code in efi_do_enter() and use efi_start_image() to start the image invoked by the bootefi command. Signed-off-by: Heinrich Schuchardt --- cmd/bootefi.c | 22 +- include/efi_loader.h | 4 lib/efi_loader/efi_boottime.c | 6 +++--- 3 files changed, 8 insertions(+), 24 deletions(-) diff --git a/cmd/bootefi.c b/cmd/bootefi.c index 6931643066..9aff186615 100644 --- a/cmd/bootefi.c +++ b/cmd/bootefi.c @@ -209,20 +209,6 @@ done: return ret; } -static efi_status_t efi_do_enter( - efi_handle_t image_handle, struct efi_system_table *st, - EFIAPI efi_status_t (*entry)( - efi_handle_t image_handle, - struct efi_system_table *st)) -{ - efi_status_t ret = EFI_LOAD_ERROR; - - if (entry) - ret = entry(image_handle, st); - st->boottime->exit(image_handle, ret, 0, NULL); - return ret; -} - /* * efi_carve_out_dt_rsv() - Carve out DT reserved memory ranges * @@ -391,13 +377,7 @@ static efi_status_t do_bootefi_exec(void *efi, /* Call our payload! */ debug("%s: Jumping to 0x%p\n", __func__, image_obj->entry); - - if (setjmp(&image_obj->exit_jmp)) { - ret = image_obj->exit_status; - goto err_prepare; - } - - ret = efi_do_enter(&image_obj->header, &systab, image_obj->entry); + ret = efi_start_image(&image_obj->header, NULL, NULL); err_prepare: /* image has returned, loaded-image obj goes *poof*: */ diff --git a/include/efi_loader.h b/include/efi_loader.h index ab6dc9b2d7..83e3c3e985 100644 --- a/include/efi_loader.h +++ b/include/efi_loader.h @@ -310,6 +310,10 @@ efi_status_t efi_create_handle(efi_handle_t *handle); void efi_delete_handle(efi_handle_t obj); /* Call this to validate a handle and find the EFI object for it */ struct efi_object *efi_search_obj(const efi_handle_t handle); +/* Start image */ +efi_status_t EFIAPI efi_start_image(efi_handle_t image_handle, + efi_uintn_t *exit_data_size, + u16 **exit_data); /* Find a protocol on a handle */ efi_status_t efi_search_protocol(const efi_handle_t handle, const efi_guid_t *protocol_guid, diff --git a/lib/efi_loader/efi_boottime.c b/lib/efi_loader/efi_boottime.c index 590e6f11a5..fe0c02296a 100644 --- a/lib/efi_loader/efi_boottime.c +++ b/lib/efi_loader/efi_boottime.c @@ -1723,9 +1723,9 @@ error: * * Return: status code */ -static efi_status_t EFIAPI efi_start_image(efi_handle_t image_handle, - efi_uintn_t *exit_data_size, - u16 **exit_data) +efi_status_t EFIAPI efi_start_image(efi_handle_t image_handle, + efi_uintn_t *exit_data_size, + u16 **exit_data) { struct efi_loaded_image_obj *image_obj = (struct efi_loaded_image_obj *)image_handle; -- 2.19.2 ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH 3/5] efi_loader: avoid unnecessary pointer to long conversion
debug() support supports %p to print pointers. The debug message is unique. So there is not need to write a possibly distracting line number. Signed-off-by: Heinrich Schuchardt --- cmd/bootefi.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/cmd/bootefi.c b/cmd/bootefi.c index cb4d797e90..6931643066 100644 --- a/cmd/bootefi.c +++ b/cmd/bootefi.c @@ -390,8 +390,7 @@ static efi_status_t do_bootefi_exec(void *efi, "{ro,boot}(blob)"); /* Call our payload! */ - debug("%s:%d Jumping to 0x%lx\n", __func__, __LINE__, - (long)image_obj->entry); + debug("%s: Jumping to 0x%p\n", __func__, image_obj->entry); if (setjmp(&image_obj->exit_jmp)) { ret = image_obj->exit_status; -- 2.19.2 ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
Re: [U-Boot] [PATCH v2 1/1] arm64: mvebu: defconfig: enable CONFIG_CMD_NVME
On 26.12.18 10:37, Heinrich Schuchardt wrote: An NVME drive may be installed on the MACCHIATObin board using the PCIe slot or on the Clearfog Pro using mini a PCI-e slot. With the configuration change it becomes usable. Signed-off-by: Heinrich Schuchardt --- configs/clearfog_gt_8k_defconfig | 2 ++ configs/mvebu_db_armada8k_defconfig | 2 ++ configs/mvebu_mcbin-88f8040_defconfig | 2 ++ 3 files changed, 6 insertions(+) Please add a revision history next time (not necessary to resend). Reviewed-by: Stefan Roese Thanks, Stefan ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
Re: [U-Boot] [PATCH v3 5/8] rockchip: rk3399: Add improved pinctrl driver.
Hi Christoph, This patch seems is less of code about drive strength, for some modules, like LCD, Ethernet is still needed. 在 2018/12/27 下午9:13, Christoph Müllner 写道: Hi David, On 12/27/18 1:49 PM, David Wu wrote: Hi Christoph, I once submitted a series of patches that they can support all Socs' Pinctrl and how do you feel about using them. Thank's for pointing to that. Your driver looks good, but I don't like the huge amount of duplication in it (you have a function rk_calc_pull_reg_and_bit() for each SoC variant, which more or less do all the same). Also I prefer to have a generic core driver and SoC specific parts in their own C files (to have a slim driver for each SoC, but a maximum of code reuse). Also Kconfig entries like PINCTRL_ROCKCHIP_RK3188 don't seem to do anything in your driver. Since this is from Feb 2018: May I ask, why you did not continue to bring that mainline? It seems i have lost them in my mailbox. I'm going to update a new version in the near future. My plan is to get the driver in for RK3399 asap and enable it only for the RK3399-Q7 board for now (to not mess with other boards). During the next merge window I want to move the generic parts into their own C files. Other SoC-specific drivers can follow then with their own mini-drivers (no code just configuration). Thanks, Christoph http://patchwork.ozlabs.org/patch/868849/ 在 2018/12/27 上午9:11, Kever Yang 写道: Add David to review the pinctrl driver. Thanks, - Kever On 12/17/2018 09:30 PM, Christoph Muellner wrote: The current pinctrl driver for the RK3399 has a range of qulity issues. E.g. it only implements the .set_state_simple() callback, it does not parse the available pinctrl information from the DTS (instead uses hardcoded values), is not flexible enough to cover devices without 'interrupt' field in the DTS (e.g. PWM), is not written generic enough to make code reusable among other rockchip SoCs... This patch addresses these issues by reimplementing the whole driver from scratch using the .set_state() callback. The new implementation covers all featurese of the old code (i.e. it supports pinmuxing and pullup/pulldown configuration). This patch has been tested on a RK3399-Q7 SoM (Puma). Signed-off-by: Christoph Muellner --- Changes in v3: None Changes in v2: None drivers/pinctrl/rockchip/pinctrl_rk3399.c | 226 ++ 1 file changed, 226 insertions(+) diff --git a/drivers/pinctrl/rockchip/pinctrl_rk3399.c b/drivers/pinctrl/rockchip/pinctrl_rk3399.c index bc92dd7c06..ed9828989f 100644 --- a/drivers/pinctrl/rockchip/pinctrl_rk3399.c +++ b/drivers/pinctrl/rockchip/pinctrl_rk3399.c @@ -1,6 +1,7 @@ // SPDX-License-Identifier: GPL-2.0+ /* * (C) Copyright 2016 Rockchip Electronics Co., Ltd + * (C) 2018 Theobroma Systems Design und Consulting GmbH */ #include @@ -14,11 +15,234 @@ #include #include +static const u32 RK_GRF_P_PULLUP = 1; +static const u32 RK_GRF_P_PULLDOWN = 2; + struct rk3399_pinctrl_priv { struct rk3399_grf_regs *grf; struct rk3399_pmugrf_regs *pmugrf; + struct rockchip_pin_bank *banks; +}; + +/** + * Location of pinctrl/pinconf registers. + */ +enum rk_grf_location { + RK_GRF, + RK_PMUGRF, +}; + +/** + * @nr_pins: number of pins in this bank + * @bank_num: number of the bank, to account for holes + * @iomux: array describing the 4 iomux sources of the bank + */ +struct rockchip_pin_bank { + u8 nr_pins; + enum rk_grf_location grf_location; + size_t iomux_offset; + size_t pupd_offset; }; +#define PIN_BANK(pins, grf, iomux, pupd) \ + { \ + .nr_pins = pins, \ + .grf_location = grf, \ + .iomux_offset = iomux, \ + .pupd_offset = pupd, \ + } + +static struct rockchip_pin_bank rk3399_pin_banks[] = { + PIN_BANK(16, RK_PMUGRF, + offsetof(struct rk3399_pmugrf_regs, gpio0a_iomux), + offsetof(struct rk3399_pmugrf_regs, gpio0_p)), + PIN_BANK(32, RK_PMUGRF, + offsetof(struct rk3399_pmugrf_regs, gpio1a_iomux), + offsetof(struct rk3399_pmugrf_regs, gpio1_p)), + PIN_BANK(32, RK_GRF, + offsetof(struct rk3399_grf_regs, gpio2a_iomux), + offsetof(struct rk3399_grf_regs, gpio2_p)), + PIN_BANK(32, RK_GRF, + offsetof(struct rk3399_grf_regs, gpio3a_iomux), + offsetof(struct rk3399_grf_regs, gpio3_p)), + PIN_BANK(32, RK_GRF, + offsetof(struct rk3399_grf_regs, gpio4a_iomux), + offsetof(struct rk3399_grf_regs, gpio4_p)), +}; + +static void rk_pinctrl_get_info(uintptr_t base, u32 index, uintptr_t *addr, + u32 *shift, u32 *mask) +{ + /* + * In general we four subsequent 32-bit configuration registers + * per bank (e.g. GPIO2A_P, GPIO2B_P, GPIO2C_P, GPIO2D_P). + * The configuration for each pin has two bits. + * + * @base...contains the address to the first register. + *
Re: [U-Boot] [PATCH v3 5/8] rockchip: rk3399: Add improved pinctrl driver.
Hi Philipp, 在 2018/12/27 下午10:31, Philipp Tomsich 写道: David, On 27.12.2018, at 13:49, David Wu wrote: Hi Christoph, I once submitted a series of patches that they can support all Socs' Pinctrl and how do you feel about using them. http://patchwork.ozlabs.org/patch/868849/ Which reminds me that I am still waiting for a newer revision that addresses the various comments (e.g. breaking up into a driver and mini-drivers/driver-data, not including support for yet-unsupported SoCs, etc.)... Are you planning to do an updatted and rebased version in the near future? Yes, i will pick them up, and update. Thanks, Philipp. ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
Re: [U-Boot] [PATCH] imx6q_logic: Enable MMC booting from SPL
On Thu, Dec 27, 2018 at 10:53 AM Adam Ford wrote: > > The MMC booting wasn't previously fitting into the codespace. > This patch enables MMC booting from the baseboard by reducing > some DM overhead during SPL. > I'm going to NAK my own work because I found some bugs after I re-based on master, so I'm going to rework a few things. Sorry for the noise. adam > Signed-off-by: Adam Ford > > diff --git a/board/logicpd/imx6/imx6logic.c b/board/logicpd/imx6/imx6logic.c > index ce1c8a5d6b..696f5c4183 100644 > --- a/board/logicpd/imx6/imx6logic.c > +++ b/board/logicpd/imx6/imx6logic.c > @@ -60,6 +60,7 @@ static iomux_v3_cfg_t const uart3_pads[] = { > MX6_PAD_EIM_EB3__UART3_RTS_B | MUX_PAD_CTRL(UART_PAD_CTRL), > }; > > +#ifndef CONFIG_SPL_BUILD > static void fixup_enet_clock(void) > { > struct iomuxc *iomuxc_regs = (struct iomuxc *)IOMUXC_BASE_ADDR; > @@ -108,6 +109,7 @@ static void fixup_enet_clock(void) > dm_gpio_set_value(&reset, 1); > mdelay(50); > } > +#endif > > static void setup_iomux_uart(void) > { > @@ -158,7 +160,9 @@ int overwrite_console(void) > > int board_early_init_f(void) > { > +#ifndef CONFIG_SPL_BUILD > fixup_enet_clock(); > +#endif > setup_iomux_uart(); > setup_nand_pins(); > return 0; > @@ -200,6 +204,74 @@ int spl_start_uboot(void) > } > #endif > > +/* SD interface */ > +#define USDHC_PAD_CTRL \ > + (PAD_CTL_PUS_47K_UP | PAD_CTL_SPEED_LOW | PAD_CTL_DSE_80ohm | \ > +PAD_CTL_SRE_FAST | PAD_CTL_HYS) > + > +static iomux_v3_cfg_t const usdhc1_pads[] = { > + MX6_PAD_SD1_CLK__SD1_CLK | MUX_PAD_CTRL(USDHC_PAD_CTRL), > + MX6_PAD_SD1_CMD__SD1_CMD | MUX_PAD_CTRL(USDHC_PAD_CTRL), > + MX6_PAD_SD1_DAT0__SD1_DATA0 | MUX_PAD_CTRL(USDHC_PAD_CTRL), > + MX6_PAD_SD1_DAT1__SD1_DATA1 | MUX_PAD_CTRL(USDHC_PAD_CTRL), > + MX6_PAD_SD1_DAT2__SD1_DATA2 | MUX_PAD_CTRL(USDHC_PAD_CTRL), > + MX6_PAD_SD1_DAT3__SD1_DATA3 | MUX_PAD_CTRL(USDHC_PAD_CTRL), > +}; > + > +static iomux_v3_cfg_t const usdhc2_pads[] = { > + MX6_PAD_SD2_DAT0__SD2_DATA0 | MUX_PAD_CTRL(USDHC_PAD_CTRL), > + MX6_PAD_SD2_DAT1__SD2_DATA1 | MUX_PAD_CTRL(USDHC_PAD_CTRL), > + MX6_PAD_SD2_DAT2__SD2_DATA2 | MUX_PAD_CTRL(USDHC_PAD_CTRL), > + MX6_PAD_SD2_DAT3__SD2_DATA3 | MUX_PAD_CTRL(USDHC_PAD_CTRL), > + MX6_PAD_SD2_CLK__SD2_CLK| MUX_PAD_CTRL(USDHC_PAD_CTRL), > + MX6_PAD_SD2_CMD__SD2_CMD| MUX_PAD_CTRL(USDHC_PAD_CTRL), > + MX6_PAD_GPIO_4__GPIO1_IO04 | MUX_PAD_CTRL(NO_PAD_CTRL), /* CD */ > +}; > + > +#ifdef CONFIG_FSL_ESDHC > +struct fsl_esdhc_cfg usdhc_cfg[] = { > + {USDHC1_BASE_ADDR}, /* SOM */ > + {USDHC2_BASE_ADDR} /* Baseboard */ > +}; > + > +int board_mmc_init(bd_t *bis) > +{ > + struct src *psrc = (struct src *)SRC_BASE_ADDR; > + unsigned int reg = readl(&psrc->sbmr1) >> 11; > + /* > +* Upon reading BOOT_CFG register the following map is done: > +* Bit 11 and 12 of BOOT_CFG register can determine the current > +* mmc port > +* 0x1 SD1-SOM > +* 0x2 SD2-Baseboard > +*/ > + > + reg &= 0x3; /* Only care about bottom 2 bits */ > + > + switch (reg - 1) { > + case 0: > + SETUP_IOMUX_PADS(usdhc1_pads); > + usdhc_cfg[0].esdhc_base = USDHC1_BASE_ADDR; > + usdhc_cfg[0].sdhc_clk = mxc_get_clock(MXC_ESDHC_CLK); > + gd->arch.sdhc_clk = usdhc_cfg[0].sdhc_clk; > + break; > + case 1: > + SETUP_IOMUX_PADS(usdhc2_pads); > + usdhc_cfg[1].esdhc_base = USDHC2_BASE_ADDR; > + usdhc_cfg[1].sdhc_clk = mxc_get_clock(MXC_ESDHC2_CLK); > + gd->arch.sdhc_clk = usdhc_cfg[1].sdhc_clk; > + break; > + } > + > + return fsl_esdhc_initialize(bis, &usdhc_cfg[reg - 1]); > +} > + > +int board_mmc_getcd(struct mmc *mmc) > +{ > + return 1; > +} > +#endif > + > static void ccgr_init(void) > { > struct mxc_ccm_reg *ccm = (struct mxc_ccm_reg *)CCM_BASE_ADDR; > diff --git a/configs/imx6q_logic_defconfig b/configs/imx6q_logic_defconfig > index 036069a437..d0362665bb 100644 > --- a/configs/imx6q_logic_defconfig > +++ b/configs/imx6q_logic_defconfig > @@ -4,25 +4,25 @@ CONFIG_SYS_TEXT_BASE=0x1780 > CONFIG_SPL_GPIO_SUPPORT=y > CONFIG_SPL_LIBCOMMON_SUPPORT=y > CONFIG_SPL_LIBGENERIC_SUPPORT=y > -CONFIG_SYS_MALLOC_F_LEN=0x2000 > CONFIG_TARGET_MX6LOGICPD=y > +CONFIG_SPL_MMC_SUPPORT=y > CONFIG_SPL_SERIAL_SUPPORT=y > -CONFIG_SPL_SYS_MALLOC_F_LEN=0x400 > CONFIG_SPL=y > +CONFIG_SPL_FAT_SUPPORT=y > CONFIG_DISTRO_DEFAULTS=y > CONFIG_NR_DRAM_BANKS=1 > -CONFIG_TPL_SYS_MALLOC_F_LEN=0x400 > CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=arch/arm/mach-imx/spl_sd.cfg" > CONFIG_BOOTDELAY=3 > # CONFIG_USE_BOOTCOMMAND is not set > CONFIG_SYS_CONSOLE_IS_IN_ENV=y > CONFIG
Re: [U-Boot] [PATCH] rsa: read out public_exponent value based on 32-bit alignment
> -Original Message- > From: Marek Vasut [mailto:ma...@denx.de] > Sent: Friday, December 28, 2018 6:05 PM > To: Ooi, Joyce ; Michal Simek > ; Siva Durga Prasad Paladugu > > Cc: u-boot@lists.denx.de; See, Chin Liang ; Chee, > Tien Fong ; Tan, Ley Foon > > Subject: Re: [PATCH] rsa: read out public_exponent value based on 32-bit > alignment > > On 12/28/18 8:30 AM, Ooi, Joyce wrote: > > Hi Marek, > > Hi, > > > Any comments about this? > > Use get_unaligned() ? It seems that if USE_HOSTCC is enabled, get_unaligned_* can't be used. In lib/rsa/rsa-mod-exp.c, #ifndef USE_HOSTCC .. #include #else #include "fdt_host.h" #include "mkimage.h" #include #endif So, to make it more generic (with or without USE_HOSTCC enabled), I read out the public_exponent as two 32-bit datas and then concatenating them into a 64-bit data. > > > Thanks, > > Joyce Ooi > > > >> -Original Message- > >> From: Ooi, Joyce > >> Sent: Saturday, December 8, 2018 4:18 PM > >> To: Marek Vasut ; Michal Simek > >> ; Siva Durga Prasad Paladugu > >> > >> Cc: u-boot@lists.denx.de; Ooi, Joyce ; See, Chin > >> Liang ; Chee, Tien Fong > >> ; Tan, Ley Foon > >> Subject: [PATCH] rsa: read out public_exponent value based on 32-bit > >> alignment > >> > >> Public_exponent is a 64-bit data, which is stored in the device tree > >> blob in a 32- bit alignment address. This causes a problem for ARM64 > >> when public_exponent is read out one shot as a 64-bit data from an > >> unaligned address. Hence, to solve this problem, public_exponent is > >> read out as two 32-bit datas, and then concatenating them. > >> > >> Signed-off-by: Ooi, Joyce > >> --- > >> lib/rsa/rsa-mod-exp.c |6 -- > >> 1 files changed, 4 insertions(+), 2 deletions(-) > >> > >> diff --git a/lib/rsa/rsa-mod-exp.c b/lib/rsa/rsa-mod-exp.c index > >> 9d78aa1..3eace38 100644 > >> --- a/lib/rsa/rsa-mod-exp.c > >> +++ b/lib/rsa/rsa-mod-exp.c > >> @@ -252,6 +252,9 @@ int rsa_mod_exp_sw(const uint8_t *sig, uint32_t > >> sig_len, { > >>struct rsa_public_key key; > >>int ret; > >> + uint64_t exponent = > >> + (uint64_t)(*((uint32_t *)(prop->public_exponent + 4))) << 32 | > >> + *((uint32_t *)(prop->public_exponent)); > >> > >>if (!prop) { > >>debug("%s: Skipping invalid prop", __func__); @@ -263,8 > >> +266,7 @@ int rsa_mod_exp_sw(const uint8_t *sig, uint32_t sig_len, > >>if (!prop->public_exponent) > >>key.exponent = RSA_DEFAULT_PUBEXP; > >>else > >> - key.exponent = > >> - fdt64_to_cpu(*((uint64_t *)(prop->public_exponent))); > >> + key.exponent = fdt64_to_cpu(exponent); > >> > >>if (!key.len || !prop->modulus || !prop->rr) { > >>debug("%s: Missing RSA key info", __func__); > >> -- > >> 1.7.1 > > > > > -- > Best regards, > Marek Vasut ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
Re: [U-Boot] [PATCH v3] net: phy: add TSE PCS support to dwmac-socfpga
> -Original Message- > From: Marek Vasut [mailto:ma...@denx.de] > Sent: Friday, December 28, 2018 6:06 PM > To: Ooi, Joyce ; Joe Hershberger > > Cc: See, Chin Liang ; Ong, Hean Loong > ; Priyanka Jain ; u- > b...@lists.denx.de > Subject: Re: [U-Boot] [PATCH v3] net: phy: add TSE PCS support to dwmac- > socfpga > > On 12/28/18 7:57 AM, Ooi, Joyce wrote: > >> -Original Message- > >> From: Marek Vasut [mailto:ma...@denx.de] > >> Sent: Thursday, December 27, 2018 4:21 PM > >> To: Ooi, Joyce ; Joe Hershberger > >> > >> Cc: See, Chin Liang ; Ong, Hean Loong > >> ; Priyanka Jain ; u- > >> b...@lists.denx.de > >> Subject: Re: [U-Boot] [PATCH v3] net: phy: add TSE PCS support to > >> dwmac- socfpga > >> > >> On 12/27/18 7:16 AM, Ooi, Joyce wrote: > -Original Message- > From: Marek Vasut [mailto:ma...@denx.de] > Sent: Thursday, December 27, 2018 2:55 AM > To: Ooi, Joyce ; Joe Hershberger > > Cc: See, Chin Liang ; Ong, Hean Loong > ; Priyanka Jain ; > u- b...@lists.denx.de > Subject: Re: [U-Boot] [PATCH v3] net: phy: add TSE PCS support to > dwmac- socfpga > > On 12/26/18 8:47 AM, Ooi, Joyce wrote: > > Adding Marek. > > > >> -Original Message- > >> From: U-Boot [mailto:u-boot-boun...@lists.denx.de] On Behalf Of > >> Ooi, Joyce > >> Sent: Tuesday, November 27, 2018 5:40 PM > >> To: Joe Hershberger > >> Cc: Ong, Hean Loong ; Priyanka Jain > >> ; See, Chin Liang > >> ; > >> u- b...@lists.denx.de > >> Subject: Re: [U-Boot] [PATCH v3] net: phy: add TSE PCS support to > >> dwmac- socfpga > >> > >> Hi Joe, > >> > >> Any comments/feedback on this v3 patch? > > I thought we already had TSE support in drivers/net/altera_tse.c , > is this related ? > >>> drivers/net/altera_tse.c is a different IP, which contains of MAC > >>> driver from Intel FPGA and PCS driver from Intel FPGA using MDIO PMA. > >>> > >>> This net/phy/altr_tse_pcs.c is the Physical Coding Sublayer for > >>> DWMAC SGMII > >> IP. > >>> The DWMAC SGMII IP contains of MAC driver from DWMAC (Synopsis) and > >>> PCS driver from Intel FPGA controlling Marvell PHY. > >> > >> Does this patch need to be split into two (three) patches then ? > > This patch adds TSE PCS support to existing dwmac-socfpga.c and > > designware.c, which adds a new file net/phy/altr_tse_pcs.c, while > > dwmac-socfpga.c and designware.c call its functions. Hence, I didn't > > split this implementation into several patches because I didn't want > net/phy/altr_tse_pcs.c to appear like a dead code. > > > > If it's confusing, I could rename altr_tse_pcs.c to altr_dwmac_pcs.c, > > since it is under DWMAC SGMII. > > Is it a separate block which could be used by both Altera TSE and DWMAC or not > ? Yes, both Altera TSE and DWMAC can use it. Now that you mention it, I guess I'll remain with altr_tse_pcs.c in case Altera TSE needs to enable SGMII in the future. > > -- > Best regards, > Marek Vasut ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH V2] imx6q_logic: Enable MMC booting from SPL
The MMC booting wasn't previously fitting into the codespace. This patch enables MMC booting from the baseboard by reducing some DM overhead during SPL. Signed-off-by: Adam Ford --- V2: Recalculate MMC index so it can boot from either internal SOM or baseboard micro SD socket. diff --git a/board/logicpd/imx6/imx6logic.c b/board/logicpd/imx6/imx6logic.c index ce1c8a5d6b..89cf53c24d 100644 --- a/board/logicpd/imx6/imx6logic.c +++ b/board/logicpd/imx6/imx6logic.c @@ -60,6 +60,7 @@ static iomux_v3_cfg_t const uart3_pads[] = { MX6_PAD_EIM_EB3__UART3_RTS_B | MUX_PAD_CTRL(UART_PAD_CTRL), }; +#ifndef CONFIG_SPL_BUILD static void fixup_enet_clock(void) { struct iomuxc *iomuxc_regs = (struct iomuxc *)IOMUXC_BASE_ADDR; @@ -108,6 +109,7 @@ static void fixup_enet_clock(void) dm_gpio_set_value(&reset, 1); mdelay(50); } +#endif static void setup_iomux_uart(void) { @@ -158,7 +160,9 @@ int overwrite_console(void) int board_early_init_f(void) { +#ifndef CONFIG_SPL_BUILD fixup_enet_clock(); +#endif setup_iomux_uart(); setup_nand_pins(); return 0; @@ -200,6 +204,74 @@ int spl_start_uboot(void) } #endif +/* SD interface */ +#define USDHC_PAD_CTRL \ + (PAD_CTL_PUS_47K_UP | PAD_CTL_SPEED_LOW | PAD_CTL_DSE_80ohm | \ +PAD_CTL_SRE_FAST | PAD_CTL_HYS) + +static iomux_v3_cfg_t const usdhc1_pads[] = { + MX6_PAD_SD1_CLK__SD1_CLK | MUX_PAD_CTRL(USDHC_PAD_CTRL), + MX6_PAD_SD1_CMD__SD1_CMD | MUX_PAD_CTRL(USDHC_PAD_CTRL), + MX6_PAD_SD1_DAT0__SD1_DATA0 | MUX_PAD_CTRL(USDHC_PAD_CTRL), + MX6_PAD_SD1_DAT1__SD1_DATA1 | MUX_PAD_CTRL(USDHC_PAD_CTRL), + MX6_PAD_SD1_DAT2__SD1_DATA2 | MUX_PAD_CTRL(USDHC_PAD_CTRL), + MX6_PAD_SD1_DAT3__SD1_DATA3 | MUX_PAD_CTRL(USDHC_PAD_CTRL), +}; + +static iomux_v3_cfg_t const usdhc2_pads[] = { + MX6_PAD_SD2_DAT0__SD2_DATA0 | MUX_PAD_CTRL(USDHC_PAD_CTRL), + MX6_PAD_SD2_DAT1__SD2_DATA1 | MUX_PAD_CTRL(USDHC_PAD_CTRL), + MX6_PAD_SD2_DAT2__SD2_DATA2 | MUX_PAD_CTRL(USDHC_PAD_CTRL), + MX6_PAD_SD2_DAT3__SD2_DATA3 | MUX_PAD_CTRL(USDHC_PAD_CTRL), + MX6_PAD_SD2_CLK__SD2_CLK| MUX_PAD_CTRL(USDHC_PAD_CTRL), + MX6_PAD_SD2_CMD__SD2_CMD| MUX_PAD_CTRL(USDHC_PAD_CTRL), + MX6_PAD_GPIO_4__GPIO1_IO04 | MUX_PAD_CTRL(NO_PAD_CTRL), /* CD */ +}; + +#ifdef CONFIG_FSL_ESDHC +struct fsl_esdhc_cfg usdhc_cfg[] = { + {USDHC1_BASE_ADDR}, /* SOM */ + {USDHC2_BASE_ADDR} /* Baseboard */ +}; + +int board_mmc_init(bd_t *bis) +{ + struct src *psrc = (struct src *)SRC_BASE_ADDR; + unsigned int reg = readl(&psrc->sbmr1) >> 11; + /* +* Upon reading BOOT_CFG register the following map is done: +* Bit 11 and 12 of BOOT_CFG register can determine the current +* mmc port +* 0x1 SD1-SOM +* 0x2 SD2-Baseboard +*/ + + reg &= 0x3; /* Only care about bottom 2 bits */ + + switch (reg) { + case 0: + SETUP_IOMUX_PADS(usdhc1_pads); + usdhc_cfg[0].esdhc_base = USDHC1_BASE_ADDR; + usdhc_cfg[0].sdhc_clk = mxc_get_clock(MXC_ESDHC_CLK); + gd->arch.sdhc_clk = usdhc_cfg[0].sdhc_clk; + break; + case 1: + SETUP_IOMUX_PADS(usdhc2_pads); + usdhc_cfg[1].esdhc_base = USDHC2_BASE_ADDR; + usdhc_cfg[1].sdhc_clk = mxc_get_clock(MXC_ESDHC2_CLK); + gd->arch.sdhc_clk = usdhc_cfg[1].sdhc_clk; + break; + } + + return fsl_esdhc_initialize(bis, &usdhc_cfg[reg]); +} + +int board_mmc_getcd(struct mmc *mmc) +{ + return 1; +} +#endif + static void ccgr_init(void) { struct mxc_ccm_reg *ccm = (struct mxc_ccm_reg *)CCM_BASE_ADDR; diff --git a/configs/imx6q_logic_defconfig b/configs/imx6q_logic_defconfig index 036069a437..d0362665bb 100644 --- a/configs/imx6q_logic_defconfig +++ b/configs/imx6q_logic_defconfig @@ -4,25 +4,25 @@ CONFIG_SYS_TEXT_BASE=0x1780 CONFIG_SPL_GPIO_SUPPORT=y CONFIG_SPL_LIBCOMMON_SUPPORT=y CONFIG_SPL_LIBGENERIC_SUPPORT=y -CONFIG_SYS_MALLOC_F_LEN=0x2000 CONFIG_TARGET_MX6LOGICPD=y +CONFIG_SPL_MMC_SUPPORT=y CONFIG_SPL_SERIAL_SUPPORT=y -CONFIG_SPL_SYS_MALLOC_F_LEN=0x400 CONFIG_SPL=y +CONFIG_SPL_FAT_SUPPORT=y CONFIG_DISTRO_DEFAULTS=y CONFIG_NR_DRAM_BANKS=1 -CONFIG_TPL_SYS_MALLOC_F_LEN=0x400 CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=arch/arm/mach-imx/spl_sd.cfg" CONFIG_BOOTDELAY=3 # CONFIG_USE_BOOTCOMMAND is not set CONFIG_SYS_CONSOLE_IS_IN_ENV=y CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE=y -# CONFIG_SPL_RAW_IMAGE_SUPPORT is not set CONFIG_SPL_SEPARATE_BSS=y +# CONFIG_TPL_BANNER_PRINT is not set +# CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR is not set CONFIG_SPL_DMA_SUPPORT=y CONFIG_SPL_I2C_SUPPORT=y CONFIG_SPL_NAND_SUPPORT=y -CONFIG_SPL_OS_BOOT=y +CONFIG_SPL_PAYLOAD="u-boot.img" CONFIG_SPL_USB_HOST_SUPPORT
[U-Boot] [PATCH 2/2] ARM: DTS: imx6q-logicpd: Update DTS/DTSI files
The i.MX6 SOM and development kits have undergone significant updates and changes over the past few months. This re-sync's the U-Boot with Logic PD's BSP. Signed-off-by: Adam Ford diff --git a/arch/arm/dts/imx6-logicpd-baseboard.dtsi b/arch/arm/dts/imx6-logicpd-baseboard.dtsi new file mode 100644 index 00..303c09334b --- /dev/null +++ b/arch/arm/dts/imx6-logicpd-baseboard.dtsi @@ -0,0 +1,596 @@ +/* + * Copyright 2018 Logic PD, Inc. + * Based on SabreSD, Copyright 2016 Freescale Semiconductor, Inc. + * + * This file is dual-licensed: you can use it either under the terms + * of the GPL or the X11 license, at your option. Note that this dual + * licensing only applies to this file, and not this project as a + * whole. + * + * a) This file is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * This file is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * Or, alternatively, + * + * b) Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +/ { + keyboard { + compatible = "gpio-keys"; + + btn0 { + gpios = <&pcf8575 0 GPIO_ACTIVE_LOW>; + label = "btn0"; + linux,code = ; + debounce-interval = <10>; + wakeup-source; + }; + + btn1 { + gpios = <&pcf8575 1 GPIO_ACTIVE_LOW>; + label = "btn1"; + linux,code = ; + debounce-interval = <10>; + wakeup-source; + }; + + btn2 { + gpios = <&pcf8575 2 GPIO_ACTIVE_LOW>; + label = "btn2"; + linux,code = ; + debounce-interval = <10>; + wakeup-source; + }; + btn3 { + gpios = <&pcf8575 3 GPIO_ACTIVE_LOW>; + label = "btn3"; + linux,code = ; + debounce-interval = <10>; + wakeup-source; + }; + + }; + + leds { + compatible = "gpio-leds"; + + gen_led0 { + label = "led0"; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_led0>; + gpios = <&gpio1 30 GPIO_ACTIVE_HIGH>; + linux,default-trigger = "cpu0"; + }; + + gen_led1 { + label = "led1"; + gpios = <&pcf8575 8 GPIO_ACTIVE_HIGH>; + }; + + gen_led2 { + label = "led2"; + gpios = <&pcf8575 9 GPIO_ACTIVE_HIGH>; + linux,default-trigger = "heartbeat"; + }; + + gen_led3 { + label = "led3"; + gpios = <&pcf8575 10 GPIO_ACTIVE_HIGH>; + linux,default-trigger = "default-on"; + }; + }; + + reg_usb_otg_vbus: regulator-otg-vbus@0 { + compatible = "regulator-fixed"; + regulator-name = "usb_otg_vbus"; + regulator-min-microvolt = <500>; + regulator-max-microvolt = <500>; + gpio = <&gpio4 15 GPIO_ACTIVE_HIGH>; + enable-active-high; + }; + + reg_usb_h1_vbus
[U-Boot] [PATCH] ARM: imx6q_logic: Enable DM_USB and dependent regulators
With the updated device trees in place, this patch enables DM_USB which uses several regulators also enabled with this patch. Signed-off-by: Adam Ford diff --git a/configs/imx6q_logic_defconfig b/configs/imx6q_logic_defconfig index d0362665bb..3358c08cb6 100644 --- a/configs/imx6q_logic_defconfig +++ b/configs/imx6q_logic_defconfig @@ -64,8 +64,13 @@ CONFIG_MII=y CONFIG_PINCTRL=y CONFIG_PINCTRL_IMX6=y CONFIG_DM_PMIC_PFUZE100=y +CONFIG_DM_REGULATOR=y +CONFIG_DM_REGULATOR_PFUZE100=y +CONFIG_DM_REGULATOR_FIXED=y +CONFIG_DM_REGULATOR_GPIO=y CONFIG_MXC_UART=y CONFIG_USB=y +CONFIG_DM_USB=y CONFIG_USB_GADGET=y CONFIG_USB_GADGET_MANUFACTURER="FSL" CONFIG_USB_GADGET_VENDOR_NUM=0x0525 -- 2.17.1 ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH] ARM: imx6q_logic: Enable Falcon Mode and fatwrite
This patch enables Falcon Mode by default and updates the README file to show instructions on how to run from the micro SD card or eMMC. This patch also enables fatwrite to help assist with writing the 'args' to the microSD card. Signed-off-by: Adam Ford diff --git a/board/logicpd/imx6/README b/board/logicpd/imx6/README index df43b55d6b..26d053a32c 100644 --- a/board/logicpd/imx6/README +++ b/board/logicpd/imx6/README @@ -22,8 +22,17 @@ To build U-Boot for the Dual and Quad variants: Flashing U-Boot into the SD card +U-Boot is now building with SPL enabled which means there are two files to +load into the SD card. Make sure the card is formatted with at least two +partitions with the first partition being FAT32. First copy u-boot-dtb.img +to the first partition then burn SPL to the SD card with dd. +The SPL portion is programmed into a certain location for use by the internal +bootROM and it cannot be changed. The following instructions assume the SD +card is located as /dev/sdb. + + cp u-boot-dtb.img /dev/media/logic/boot + sudo dd if=SPL of=/dev/sdb bs=1k seek=1 oflag=sync status=none && sync -See README.imximage for details on booting from SD Flashing U-Boot into NAND - @@ -32,6 +41,43 @@ with: kobs-ng init -v -x u-boot-dtb.imx + +Using Falcon Mode +- +With Falcon Mode enabled, U-Boot can be bypassed by having SPL directly load +the kernel. The device tree, Kernel and boot args must first be configured, +and stored to a file on the micro SD card called 'args' +The kernel uImage is built with LOAD_ADDR=0x1200 and the device tree is +assummed to be imx6q-logicpd.dtb. + +By default the mmcroot is set to the baseboard. + + # Establish bootargs + run mmcargs + + # Load Linux Kernel uImage + fatload mmc 1 $loadaddr uImage + + # Load Device Tree + run loadfdt + + # Setup the blob that will get passed to the kernel + spl export fdt ${loadaddr} - ${fdt_addr_r} + + # Note the starting and ending address of the updated device tree. + # for this example: + # Loading Device Tree to 1ffdf000, end 1fff038b ... OK + # Notice that 0x1fff038b - 1ffdf000 = 0x1138b + # now Add 1, so the length is 0x1138c. + + fatwrite mmc 1 0x1ffdf000 args 0x1138c + + # Reset the board and it will bypass U-Boot and SPL will directly boot + # the uImage + +To interrupt the boot sequence and force U-Boot to load, hold the 'c' button +while starting. + Additional Support Documentation can be found at: https://support.logicpd.com/ diff --git a/configs/imx6q_logic_defconfig b/configs/imx6q_logic_defconfig index 3358c08cb6..457366a664 100644 --- a/configs/imx6q_logic_defconfig +++ b/configs/imx6q_logic_defconfig @@ -22,6 +22,7 @@ CONFIG_SPL_SEPARATE_BSS=y CONFIG_SPL_DMA_SUPPORT=y CONFIG_SPL_I2C_SUPPORT=y CONFIG_SPL_NAND_SUPPORT=y +CONFIG_SPL_OS_BOOT=y CONFIG_SPL_PAYLOAD="u-boot.img" CONFIG_SPL_USB_HOST_SUPPORT=y CONFIG_SPL_USB_GADGET_SUPPORT=y @@ -77,3 +78,4 @@ CONFIG_USB_GADGET_VENDOR_NUM=0x0525 CONFIG_USB_GADGET_PRODUCT_NUM=0xa4a5 CONFIG_CI_UDC=y CONFIG_USB_GADGET_DOWNLOAD=y +CONFIG_FAT_WRITE=y -- 2.17.1 ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH] imx8m: clock: Fix oscilattor values
OSC_27M_CLK should return 27MHz and OSC_32K_CLK should return 32768Hz to reflect the reality. This also keeps the values in sync with the Linux clock tree. Signed-off-by: Fabio Estevam --- arch/arm/mach-imx/imx8m/clock.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm/mach-imx/imx8m/clock.c b/arch/arm/mach-imx/imx8m/clock.c index 3766d988ba..289b9417aa 100644 --- a/arch/arm/mach-imx/imx8m/clock.c +++ b/arch/arm/mach-imx/imx8m/clock.c @@ -250,9 +250,9 @@ static u32 get_root_src_clk(enum clk_root_src root_src) case OSC_25M_CLK: return 2500; case OSC_27M_CLK: - return 2500; + return 2700; case OSC_32K_CLK: - return 32000; + return 32768; case ARM_PLL_CLK: return decode_frac_pll(root_src); case SYSTEM_PLL1_800M_CLK: -- 2.17.1 ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH v2] imx8m: clock: Fix oscillator values
OSC_27M_CLK should return 27MHz and OSC_32K_CLK should return 32768Hz to reflect the reality. This also keeps the values in sync with the Linux clock tree. Signed-off-by: Fabio Estevam --- Changes since v1: - Fixed typo in the Subject line (oscillator) arch/arm/mach-imx/imx8m/clock.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm/mach-imx/imx8m/clock.c b/arch/arm/mach-imx/imx8m/clock.c index 3766d988ba..289b9417aa 100644 --- a/arch/arm/mach-imx/imx8m/clock.c +++ b/arch/arm/mach-imx/imx8m/clock.c @@ -250,9 +250,9 @@ static u32 get_root_src_clk(enum clk_root_src root_src) case OSC_25M_CLK: return 2500; case OSC_27M_CLK: - return 2500; + return 2700; case OSC_32K_CLK: - return 32000; + return 32768; case ARM_PLL_CLK: return decode_frac_pll(root_src); case SYSTEM_PLL1_800M_CLK: -- 2.17.1 ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
Re: [U-Boot] [PATCH] rsa: read out public_exponent value based on 32-bit alignment
On 12/28/18 2:32 PM, Ooi, Joyce wrote: >> -Original Message- >> From: Marek Vasut [mailto:ma...@denx.de] >> Sent: Friday, December 28, 2018 6:05 PM >> To: Ooi, Joyce ; Michal Simek >> ; Siva Durga Prasad Paladugu >> >> Cc: u-boot@lists.denx.de; See, Chin Liang ; Chee, >> Tien Fong ; Tan, Ley Foon >> >> Subject: Re: [PATCH] rsa: read out public_exponent value based on 32-bit >> alignment >> >> On 12/28/18 8:30 AM, Ooi, Joyce wrote: >>> Hi Marek, >> >> Hi, >> >>> Any comments about this? >> >> Use get_unaligned() ? > It seems that if USE_HOSTCC is enabled, get_unaligned_* can't be used. Can this be fixed ? > In lib/rsa/rsa-mod-exp.c, > #ifndef USE_HOSTCC > .. > #include > #else > #include "fdt_host.h" > #include "mkimage.h" > #include > #endif > > So, to make it more generic (with or without USE_HOSTCC enabled), I read out > the public_exponent as two 32-bit datas and then concatenating them into a > 64-bit data. See above -- I'd much rather see the get_unaligned() fixed and used. -- Best regards, Marek Vasut ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
Re: [U-Boot] [PATCH v3] net: phy: add TSE PCS support to dwmac-socfpga
On 12/28/18 2:38 PM, Ooi, Joyce wrote: >> -Original Message- >> From: Marek Vasut [mailto:ma...@denx.de] >> Sent: Friday, December 28, 2018 6:06 PM >> To: Ooi, Joyce ; Joe Hershberger >> >> Cc: See, Chin Liang ; Ong, Hean Loong >> ; Priyanka Jain ; u- >> b...@lists.denx.de >> Subject: Re: [U-Boot] [PATCH v3] net: phy: add TSE PCS support to dwmac- >> socfpga >> >> On 12/28/18 7:57 AM, Ooi, Joyce wrote: -Original Message- From: Marek Vasut [mailto:ma...@denx.de] Sent: Thursday, December 27, 2018 4:21 PM To: Ooi, Joyce ; Joe Hershberger Cc: See, Chin Liang ; Ong, Hean Loong ; Priyanka Jain ; u- b...@lists.denx.de Subject: Re: [U-Boot] [PATCH v3] net: phy: add TSE PCS support to dwmac- socfpga On 12/27/18 7:16 AM, Ooi, Joyce wrote: >> -Original Message- >> From: Marek Vasut [mailto:ma...@denx.de] >> Sent: Thursday, December 27, 2018 2:55 AM >> To: Ooi, Joyce ; Joe Hershberger >> >> Cc: See, Chin Liang ; Ong, Hean Loong >> ; Priyanka Jain ; >> u- b...@lists.denx.de >> Subject: Re: [U-Boot] [PATCH v3] net: phy: add TSE PCS support to >> dwmac- socfpga >> >> On 12/26/18 8:47 AM, Ooi, Joyce wrote: >>> Adding Marek. >>> -Original Message- From: U-Boot [mailto:u-boot-boun...@lists.denx.de] On Behalf Of Ooi, Joyce Sent: Tuesday, November 27, 2018 5:40 PM To: Joe Hershberger Cc: Ong, Hean Loong ; Priyanka Jain ; See, Chin Liang ; u- b...@lists.denx.de Subject: Re: [U-Boot] [PATCH v3] net: phy: add TSE PCS support to dwmac- socfpga Hi Joe, Any comments/feedback on this v3 patch? >> >> I thought we already had TSE support in drivers/net/altera_tse.c , >> is this related ? > drivers/net/altera_tse.c is a different IP, which contains of MAC > driver from Intel FPGA and PCS driver from Intel FPGA using MDIO PMA. > > This net/phy/altr_tse_pcs.c is the Physical Coding Sublayer for > DWMAC SGMII IP. > The DWMAC SGMII IP contains of MAC driver from DWMAC (Synopsis) and > PCS driver from Intel FPGA controlling Marvell PHY. Does this patch need to be split into two (three) patches then ? >>> This patch adds TSE PCS support to existing dwmac-socfpga.c and >>> designware.c, which adds a new file net/phy/altr_tse_pcs.c, while >>> dwmac-socfpga.c and designware.c call its functions. Hence, I didn't >>> split this implementation into several patches because I didn't want >> net/phy/altr_tse_pcs.c to appear like a dead code. >>> >>> If it's confusing, I could rename altr_tse_pcs.c to altr_dwmac_pcs.c, >>> since it is under DWMAC SGMII. >> >> Is it a separate block which could be used by both Altera TSE and DWMAC or >> not >> ? > Yes, both Altera TSE and DWMAC can use it. Now that you mention it, I guess > I'll > remain with altr_tse_pcs.c in case Altera TSE needs to enable SGMII in the > future. Right, and it should be split accordingly. -- Best regards, Marek Vasut ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
Re: [U-Boot] [PATCH 0/4] rockchip: sound: Add support for sound on chromebook_jerry
> On 28.12.2018, at 04:15, Simon Glass wrote: > > Sound support for jerry was never included in the initial port. Now that > sound has been converted to driver model it seems like a good opportunity > to fill this gap. Jerry uses an audio codec that is already supported by > U-Boot. > > Add the required drivers and enable the config so that > 'sound play 500 400' can be used to play a beep. Also enable logging for > this board. I hope to find time to add support for the RK3399 (which has a sufficiently closely related I2S controller)—and possibly even the RK3368—and for the SGTL5000 codec that we have on the Haikou reference baseboard. If you don’t hear anything by mid-January, feel free to poke me. Philipp. ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
Re: [U-Boot] [PATCH] test: dm: regmap: Fix the long test delay
Hi Neil, On Tue, 11 Dec 2018 at 01:27, Neil Armstrong wrote: > > On 10/12/2018 01:11, Simon Glass wrote: > > At present one of the regmap tests takes 5 seconds to run since it waits > > for a timeout. This should be handled using sandbox_timer_add_offset() > > which advances time for test purposes. > > > > This requires a little change to make the regmap_read_poll_timeout() > > testable. > > > > Update the macro and the test. > > > > Fixes: ebe3497c9c ("test: regmap: add regmap_read_poll_timeout test") > > > > Signed-off-by: Simon Glass > > --- > > > > include/regmap.h | 14 +- > > test/dm/regmap.c | 7 --- > > 2 files changed, 17 insertions(+), 4 deletions(-) > > Applied to u-boot-dm/master, thanks! ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
Re: [U-Boot] [PATCH] dm: Tidy up 'dm tree' output when there are many devices
On Wed, Dec 05, 2018 at 06:42:52PM -0700, Simon Glass wrote: > At present the 'Index' column assumes there is only one digit. But on some > devices (e.g. snow) there are a lot of regulators and GPIO banks. Adjust > the output to allow for two digits without messing up the display. > > Also capatalise the heading to match. > > Fixes: 5197dafc42 (dm: core: Widen the dump tree to show more of the > driver's name.) > > Signed-off-by: Simon Glass Reviewed-by: Liviu Dudau Best regards, Liviu > --- > > drivers/core/dump.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > Applied to u-boot-dm/master, thanks! ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
Re: [U-Boot] [PATCH v2] common: fdt_support: print hexadecimal numbers in debug
On Thu, Dec 06, 2018 at 03:20:47PM +0530, Sekhar Nori wrote: > We usually deal with hexadecimal addresses and sizes in > device-tree. Its much easier if debug logs print hexadecimal > values too. > > Reviewed-by: Simon Glass > Signed-off-by: Sekhar Nori Reviewed-by: Tom Rini -- Tom Applied to u-boot-dm/master, thanks! ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
Re: [U-Boot] [PATCH 18/21] log: Check printf() arguments
At present logging does not check printf() arguments. Now that all users have been corrected, enable this to prevent further problems. Signed-off-by: Simon Glass --- include/log.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) Applied to u-boot-dm/master, thanks! ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
Re: [U-Boot] [PATCH 3/3] travis: Use buildman for building with clang
On Wed, Dec 05, 2018 at 05:35:28AM -0700, Simon Glass wrote: > Now that buildman supports clang, use it. > > Signed-off-by: Simon Glass Reviewed-by: Tom Rini -- Tom Applied to u-boot-dm/master, thanks! ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
Re: [U-Boot] [PATCH] sandbox: add memset_io(..), memcpy_fromio(..) and memcpy_toio(..)
On Tue, 4 Dec 2018 at 12:35, Christian Gmeiner wrote: > > From: Christian GMEINER > > These functions could be used by drivers. > > Signed-off-by: Christian GMEINER > --- > arch/sandbox/include/asm/io.h | 12 > 1 file changed, 12 insertions(+) > Reviewed-by: Simon Glass Applied to u-boot-dm/master, thanks! ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
Re: [U-Boot] [PATCH 1/3] buildman: Drop comment about Ctrl-C problem
This bug is now fixed, so drop this comment. Signed-off-by: Simon Glass --- tools/buildman/README | 2 -- 1 file changed, 2 deletions(-) Applied to u-boot-dm/master, thanks! ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
Re: [U-Boot] [PATCH 2/3] buildman: Add support for building with clang
On Wed, Dec 05, 2018 at 05:35:27AM -0700, Simon Glass wrote: > Add a -O option which allows building with clang. > > Signed-off-by: Simon Glass Reviewed-by: Tom Rini -- Tom Applied to u-boot-dm/master, thanks! ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH v2 2/2] dm: video: lcd: MIGRATION: Add migration plan for video
Add a migration plan for video which is an important subsystem in U-Boot. Signed-off-by: Simon Glass --- Changes in v2: - Change 'PCI' to 'video' (typo) Makefile | 10 ++ doc/driver-model/MIGRATION.txt | 8 2 files changed, 18 insertions(+) diff --git a/Makefile b/Makefile index af086fa30d4..01fe6114d2a 100644 --- a/Makefile +++ b/Makefile @@ -956,6 +956,16 @@ ifneq ($(CONFIG_DM_PCI),y) @echo >&2 "" endif endif +ifneq ($(CONFIG_LCD)$(CONFIG_VIDEO),) +ifneq ($(CONFIG_DM_VIDEO),y) + @echo >&2 "= WARNING ==" + @echo >&2 "This board does not use CONFIG_DM_VIDEO Please update" + @echo >&2 "the board to use CONFIG_DM_VIDEO before the v2019.07 release." + @echo >&2 "Failure to update by the deadline may result in board removal." + @echo >&2 "See doc/driver-model/MIGRATION.txt for more info." + @echo >&2 "" +endif +endif ifeq ($(CONFIG_OF_EMBED),y) @echo >&2 "= WARNING ==" @echo >&2 "CONFIG_OF_EMBED is enabled. This option should only" diff --git a/doc/driver-model/MIGRATION.txt b/doc/driver-model/MIGRATION.txt index 03a2cae7976..dba3f9fe307 100644 --- a/doc/driver-model/MIGRATION.txt +++ b/doc/driver-model/MIGRATION.txt @@ -92,3 +92,11 @@ The PCI subsystem has supported driver model since mid 2015. Maintainers should submit patches switching over to using CONFIG_DM_PCI and other base driver model options in time for inclusion in the 2019.04 rerelease. + +CONFIG_DM_VIDEO +--- +Deadline: 2019.07 + +The PCI subsystem has supported driver model since early 2016. Maintainers +should submit patches switching over to using CONFIG_DM_VIDEO and other base +driver model options in time for inclusion in the 2019.04 release. -- 2.20.1.415.g653613c723-goog ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH v2 1/2] dm: pci: MIGRATION: Add migration plan for PCI
Add a migration plan for PCI which is an important subsystem in U-Boot. Signed-off-by: Simon Glass --- Changes in v2: None Makefile | 10 ++ doc/driver-model/MIGRATION.txt | 10 ++ 2 files changed, 20 insertions(+) diff --git a/Makefile b/Makefile index a8461dd611d..af086fa30d4 100644 --- a/Makefile +++ b/Makefile @@ -946,6 +946,16 @@ ifeq ($(CONFIG_LIBATA)$(CONFIG_DM_SCSI)$(CONFIG_MVSATA_IDE),y) @echo >&2 "See doc/driver-model/MIGRATION.txt for more info." @echo >&2 "" endif +ifeq ($(CONFIG_PCI),y) +ifneq ($(CONFIG_DM_PCI),y) + @echo >&2 "= WARNING ==" + @echo >&2 "This board does not use CONFIG_DM_PCI Please update" + @echo >&2 "the board to use CONFIG_DM_PCI before the v2019.07 release." + @echo >&2 "Failure to update by the deadline may result in board removal." + @echo >&2 "See doc/driver-model/MIGRATION.txt for more info." + @echo >&2 "" +endif +endif ifeq ($(CONFIG_OF_EMBED),y) @echo >&2 "= WARNING ==" @echo >&2 "CONFIG_OF_EMBED is enabled. This option should only" diff --git a/doc/driver-model/MIGRATION.txt b/doc/driver-model/MIGRATION.txt index dce4aa3e1dc..03a2cae7976 100644 --- a/doc/driver-model/MIGRATION.txt +++ b/doc/driver-model/MIGRATION.txt @@ -82,3 +82,13 @@ Partially converted: -- Jagan Teki 03/14/2018 + + +CONFIG_DM_PCI +- +Deadline: 2019.07 + +The PCI subsystem has supported driver model since mid 2015. Maintainers should +submit patches switching over to using CONFIG_DM_PCI and other base driver +model options in time for inclusion in the 2019.04 rerelease. + -- 2.20.1.415.g653613c723-goog ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
Re: [U-Boot] [PATCH v2 2/2] dm: video: lcd: MIGRATION: Add migration plan for video
Hi, On Fri, 28 Dec 2018 at 13:57, Simon Glass wrote: > > Add a migration plan for video which is an important subsystem in U-Boot. > > Signed-off-by: Simon Glass > --- > > Changes in v2: > - Change 'PCI' to 'video' (typo) > > Makefile | 10 ++ > doc/driver-model/MIGRATION.txt | 8 > 2 files changed, 18 insertions(+) Re the comment about having too many migrations in the same release, I'm happy to change this if people feel this is too aggressive. But hopefully BLK will be done pretty soon, and by the time this rolls around driver model will have been in U-Boot for 5 years. Seems long enough ;-) Regards, Simon ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH v3 1/2] dm: pci: MIGRATION: Add migration plan for PCI
Add a migration plan for PCI which is an important subsystem in U-Boot. Signed-off-by: Simon Glass --- Changes in v3: - Fix the rerelease typo Changes in v2: None Makefile | 10 ++ doc/driver-model/MIGRATION.txt | 10 ++ 2 files changed, 20 insertions(+) diff --git a/Makefile b/Makefile index a8461dd611d..af086fa30d4 100644 --- a/Makefile +++ b/Makefile @@ -946,6 +946,16 @@ ifeq ($(CONFIG_LIBATA)$(CONFIG_DM_SCSI)$(CONFIG_MVSATA_IDE),y) @echo >&2 "See doc/driver-model/MIGRATION.txt for more info." @echo >&2 "" endif +ifeq ($(CONFIG_PCI),y) +ifneq ($(CONFIG_DM_PCI),y) + @echo >&2 "= WARNING ==" + @echo >&2 "This board does not use CONFIG_DM_PCI Please update" + @echo >&2 "the board to use CONFIG_DM_PCI before the v2019.07 release." + @echo >&2 "Failure to update by the deadline may result in board removal." + @echo >&2 "See doc/driver-model/MIGRATION.txt for more info." + @echo >&2 "" +endif +endif ifeq ($(CONFIG_OF_EMBED),y) @echo >&2 "= WARNING ==" @echo >&2 "CONFIG_OF_EMBED is enabled. This option should only" diff --git a/doc/driver-model/MIGRATION.txt b/doc/driver-model/MIGRATION.txt index dce4aa3e1dc..5c91bd1df69 100644 --- a/doc/driver-model/MIGRATION.txt +++ b/doc/driver-model/MIGRATION.txt @@ -82,3 +82,13 @@ Partially converted: -- Jagan Teki 03/14/2018 + + +CONFIG_DM_PCI +- +Deadline: 2019.07 + +The PCI subsystem has supported driver model since mid 2015. Maintainers should +submit patches switching over to using CONFIG_DM_PCI and other base driver +model options in time for inclusion in the 2019.07 release. + -- 2.20.1.415.g653613c723-goog ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH v3 2/2] dm: video: lcd: MIGRATION: Add migration plan for video
Add a migration plan for video which is an important subsystem in U-Boot. Signed-off-by: Simon Glass --- Changes in v3: - Really change 'PCI' to 'video' (typo) Changes in v2: - Change 'PCI' to 'video' (typo) Makefile | 10 ++ doc/driver-model/MIGRATION.txt | 8 2 files changed, 18 insertions(+) diff --git a/Makefile b/Makefile index af086fa30d4..01fe6114d2a 100644 --- a/Makefile +++ b/Makefile @@ -956,6 +956,16 @@ ifneq ($(CONFIG_DM_PCI),y) @echo >&2 "" endif endif +ifneq ($(CONFIG_LCD)$(CONFIG_VIDEO),) +ifneq ($(CONFIG_DM_VIDEO),y) + @echo >&2 "= WARNING ==" + @echo >&2 "This board does not use CONFIG_DM_VIDEO Please update" + @echo >&2 "the board to use CONFIG_DM_VIDEO before the v2019.07 release." + @echo >&2 "Failure to update by the deadline may result in board removal." + @echo >&2 "See doc/driver-model/MIGRATION.txt for more info." + @echo >&2 "" +endif +endif ifeq ($(CONFIG_OF_EMBED),y) @echo >&2 "= WARNING ==" @echo >&2 "CONFIG_OF_EMBED is enabled. This option should only" diff --git a/doc/driver-model/MIGRATION.txt b/doc/driver-model/MIGRATION.txt index 5c91bd1df69..a204b9bb28a 100644 --- a/doc/driver-model/MIGRATION.txt +++ b/doc/driver-model/MIGRATION.txt @@ -92,3 +92,11 @@ The PCI subsystem has supported driver model since mid 2015. Maintainers should submit patches switching over to using CONFIG_DM_PCI and other base driver model options in time for inclusion in the 2019.07 release. + +CONFIG_DM_VIDEO +--- +Deadline: 2019.07 + +The video subsystem has supported driver model since early 2016. Maintainers +should submit patches switching over to using CONFIG_DM_VIDEO and other base +driver model options in time for inclusion in the 2019.07 release. -- 2.20.1.415.g653613c723-goog ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
Re: [U-Boot] [PATCH] rsa: read out public_exponent value based on 32-bit alignment
Am 28.12.2018 um 19:44 schrieb Marek Vasut: On 12/28/18 2:32 PM, Ooi, Joyce wrote: -Original Message- From: Marek Vasut [mailto:ma...@denx.de] Sent: Friday, December 28, 2018 6:05 PM To: Ooi, Joyce ; Michal Simek ; Siva Durga Prasad Paladugu Cc: u-boot@lists.denx.de; See, Chin Liang ; Chee, Tien Fong ; Tan, Ley Foon Subject: Re: [PATCH] rsa: read out public_exponent value based on 32-bit alignment On 12/28/18 8:30 AM, Ooi, Joyce wrote: Hi Marek, Hi, Any comments about this? Use get_unaligned() ? It seems that if USE_HOSTCC is enabled, get_unaligned_* can't be used. Can this be fixed ? I was working on a patch (or series?) to make USE_HOSTCC more generic (i.e. concentrate the HOSTCC specific things in some header files, hopefully) as I have stumbled accross this when adding compression/uncompression to mkimage, but I haven't found the time to complete this, yet. Nevertheless, I think this is where we should go, rather then add yet more #ifdef USE_HOSTCC to C files... Regards, Simon In lib/rsa/rsa-mod-exp.c, #ifndef USE_HOSTCC .. #include #else #include "fdt_host.h" #include "mkimage.h" #include #endif So, to make it more generic (with or without USE_HOSTCC enabled), I read out the public_exponent as two 32-bit datas and then concatenating them into a 64-bit data. See above -- I'd much rather see the get_unaligned() fixed and used. ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
Re: [U-Boot] re-use dm data for pre-relocate and post-relocate
Hi Kever, On Tue, 21 Nov 2017 at 03:24, Kever Yang wrote: > > Hi Simon, > There are a lot of points in here, so I will spread my comments throughout your email. > In order to make people easier to maintain a U-Boot for product, > > we want to re-use the dtb from kernel. Some peripheral like power/pmic > > and display panel, key, charger which need work in U-Boot and may different > > in different product, we want to make people only maintain kernel dts, > but not > > one more U-Boot project for all these devices. That sounds like a good idea. The U-Boot and kernel .dts should be the same. But in some cases we may need changes made to the kernel version to support U-Boot. Unfortunately this has proven quite tricky and I'm not aware of any U-Boot change that has been accepted. Admittedly I have not tried for a number of years, so perhaps the reviewers are more amenable now. > > I want to do this just around the > > relocate, need to read dtb from storage like emmc/nand/spi, and then use > > a new dtb for initr_dm after relocate. This seems OK, but why? Do you mean that U-Boot should read the kernel's DTB and use that after relocation? The problem is that it needs to be loaded from somewhere, and you need the DT for U-Boot to work. So you add a pre-reloc DT with just enough drivers for loading the post-reloc DT. But why bother? You may as well just load the full thing. > > Here are issues I have met: > > - The kernel dts may not have a stdout in chosen, we may use earlycon, > earlyprintk instead; I suppose U-Boot could support this, but IMO it would be better to upstream the change for stdout. > > this lead to U-Boot can not find a serial driver after relocate; > > - no alias for mmc device which is need by U-Boot but not used in kernel; Again, we could upstream a change. > > - not able to init mmc driver twice with current driver; > > mmc driver not able to work before relocate, no bss for (static int > initialized), and hang even Well you cannot access BSS before relocation. If you use DM then it should not need to access BSS. You should be able to use the uclass-private data instead. > > if I skip this; > > mmc driver can init and read dtb before initr_dm, but not able to > init again after initr_dm. Why not? That seems like a bug. > > > In fact, I don't think we have to re-init serial driver and mmc driver, > and most other driver which > > need pre-relocate like clock, the only driver I have seem have different > use in pre-relocate and post-relocate Yes that's true, but the idea has never been implemented. > > is video driver(no idea why it have to be pre-relocate, we always have > display very late), The video driver is only inited before relocation to find out the amount of memory it needs to be allocated. It does not actually probe it fully. > > can we add a tag for re-use the dm driver data for those with pre-relocate ? Yes I think it could work like this: - initr_dm() remembers the old dm_root pointer - post-reloc drivers can request access to the priv/platdata/uc_priv from before relocation, e.g. using: int dm_get_pre_reloc_dev(struct udevice *dev, struct udevice *pre_reloc_devp); this returns the pre-reloc device associated with the post-reloc device 'dev', if available. Regards, Simon ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH v2 0/5] dm: serial: Fix up some serial API errors
New serial functions should use a driver pointer as the first argument. The old functions are only there for backwards compatibilty, and can be adjusted soon. For now, adjust the new functions to work correctly. Changes in v2: - Add a comment about reusing the device pointer - Fix @return comment on getinfo() method Simon Glass (5): serial: Move new functions to serial.h dm: serial: Adjust serial_getconfig() to use proper API dm: serial: Adjust serial_setconfig() to use proper API dm: serial: Adjust serial_getinfo() to use proper API dm: serial: Tidy up header file comments arch/x86/lib/acpi_table.c | 12 +++ drivers/serial/serial-uclass.c | 27 include/common.h | 5 - include/serial.h | 38 +++--- test/dm/serial.c | 19 ++--- 5 files changed, 63 insertions(+), 38 deletions(-) -- 2.20.1.415.g653613c723-goog ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH v2 1/5] serial: Move new functions to serial.h
We should not be adding new functions to common.h. Move these recently added functions to serial.h. Signed-off-by: Simon Glass Reviewed-by: Andy Shevchenko --- Changes in v2: None include/common.h | 5 - include/serial.h | 4 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/include/common.h b/include/common.h index 657cc404cfa..028a735a5c7 100644 --- a/include/common.h +++ b/include/common.h @@ -350,8 +350,6 @@ void smp_set_core_boot_addr(unsigned long addr, int corenr); void smp_kick_all_cpus(void); /* $(CPU)/serial.c */ -struct serial_device_info; - intserial_init (void); void serial_setbrg (void); void serial_putc (const char); @@ -359,9 +357,6 @@ voidserial_putc_raw(const char); void serial_puts (const char *); intserial_getc (void); intserial_tstc (void); -intserial_getconfig(uint *config); -intserial_setconfig(uint config); -intserial_getinfo(struct serial_device_info *info); /* $(CPU)/speed.c */ intget_clocks (void); diff --git a/include/serial.h b/include/serial.h index c1a9fee250e..fa7e0130bd2 100644 --- a/include/serial.h +++ b/include/serial.h @@ -281,6 +281,10 @@ struct serial_dev_priv { /* Access the serial operations for a device */ #define serial_get_ops(dev)((struct dm_serial_ops *)(dev)->driver->ops) +int serial_getconfig(uint *config); +int serial_setconfig(uint config); +int serial_getinfo(struct serial_device_info *info); + void atmel_serial_initialize(void); void mcf_serial_initialize(void); void mpc85xx_serial_initialize(void); -- 2.20.1.415.g653613c723-goog ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH v2 2/5] dm: serial: Adjust serial_getconfig() to use proper API
All driver-model functions should have a device as the first parameter. Update this function accordingly. Signed-off-by: Simon Glass Reviewed-by: Andy Shevchenko --- Changes in v2: None arch/x86/lib/acpi_table.c | 5 - drivers/serial/serial-uclass.c | 9 +++-- include/serial.h | 2 +- test/dm/serial.c | 4 ++-- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/arch/x86/lib/acpi_table.c b/arch/x86/lib/acpi_table.c index 79bc2000bda..bfcf2adbf12 100644 --- a/arch/x86/lib/acpi_table.c +++ b/arch/x86/lib/acpi_table.c @@ -342,6 +342,7 @@ static void acpi_create_spcr(struct acpi_spcr *spcr) struct acpi_table_header *header = &(spcr->header); struct serial_device_info serial_info = {0}; ulong serial_address, serial_offset; + struct udevice *dev; uint serial_config; uint serial_width; int access_size; @@ -431,7 +432,9 @@ static void acpi_create_spcr(struct acpi_spcr *spcr) break; } - ret = serial_getconfig(&serial_config); + ret = uclass_first_device_err(UCLASS_SERIAL, &dev); + if (!ret) + ret = serial_getconfig(dev, &serial_config); if (ret) serial_config = SERIAL_DEFAULT_CONFIG; diff --git a/drivers/serial/serial-uclass.c b/drivers/serial/serial-uclass.c index ffcd6d15af2..81f1067f422 100644 --- a/drivers/serial/serial-uclass.c +++ b/drivers/serial/serial-uclass.c @@ -294,16 +294,13 @@ void serial_setbrg(void) ops->setbrg(gd->cur_serial_dev, gd->baudrate); } -int serial_getconfig(uint *config) +int serial_getconfig(struct udevice *dev, uint *config) { struct dm_serial_ops *ops; - if (!gd->cur_serial_dev) - return 0; - - ops = serial_get_ops(gd->cur_serial_dev); + ops = serial_get_ops(dev); if (ops->getconfig) - return ops->getconfig(gd->cur_serial_dev, config); + return ops->getconfig(dev, config); return 0; } diff --git a/include/serial.h b/include/serial.h index fa7e0130bd2..5ba031ab534 100644 --- a/include/serial.h +++ b/include/serial.h @@ -281,7 +281,7 @@ struct serial_dev_priv { /* Access the serial operations for a device */ #define serial_get_ops(dev)((struct dm_serial_ops *)(dev)->driver->ops) -int serial_getconfig(uint *config); +int serial_getconfig(struct udevice *dev, uint *config); int serial_setconfig(uint config); int serial_getinfo(struct serial_device_info *info); diff --git a/test/dm/serial.c b/test/dm/serial.c index 19a15d5d952..972755face3 100644 --- a/test/dm/serial.c +++ b/test/dm/serial.c @@ -24,7 +24,7 @@ static int dm_test_serial(struct unit_test_state *uts) * sandbox_serial driver */ ut_assertok(serial_setconfig(SERIAL_DEFAULT_CONFIG)); - ut_assertok(serial_getconfig(&value_serial)); + ut_assertok(serial_getconfig(dev_serial, &value_serial)); ut_assert(value_serial == SERIAL_DEFAULT_CONFIG); ut_assertok(serial_getinfo(&info_serial)); ut_assert(info_serial.type == SERIAL_CHIP_UNKNOWN); @@ -32,7 +32,7 @@ static int dm_test_serial(struct unit_test_state *uts) /* * test with a parameter which is NULL pointer */ - ut_asserteq(-EINVAL, serial_getconfig(NULL)); + ut_asserteq(-EINVAL, serial_getconfig(dev_serial, NULL)); ut_asserteq(-EINVAL, serial_getinfo(NULL)); /* * test with a serial config which is not supported by -- 2.20.1.415.g653613c723-goog ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH v2 3/5] dm: serial: Adjust serial_setconfig() to use proper API
All driver-model functions should have a device as the first parameter. Update this function accordingly. Signed-off-by: Simon Glass Reviewed-by: Andy Shevchenko --- Changes in v2: None drivers/serial/serial-uclass.c | 9 +++-- include/serial.h | 2 +- test/dm/serial.c | 11 +++ 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/drivers/serial/serial-uclass.c b/drivers/serial/serial-uclass.c index 81f1067f422..669c82f3793 100644 --- a/drivers/serial/serial-uclass.c +++ b/drivers/serial/serial-uclass.c @@ -305,16 +305,13 @@ int serial_getconfig(struct udevice *dev, uint *config) return 0; } -int serial_setconfig(uint config) +int serial_setconfig(struct udevice *dev, uint config) { struct dm_serial_ops *ops; - if (!gd->cur_serial_dev) - return 0; - - ops = serial_get_ops(gd->cur_serial_dev); + ops = serial_get_ops(dev); if (ops->setconfig) - return ops->setconfig(gd->cur_serial_dev, config); + return ops->setconfig(dev, config); return 0; } diff --git a/include/serial.h b/include/serial.h index 5ba031ab534..8a05a090898 100644 --- a/include/serial.h +++ b/include/serial.h @@ -282,7 +282,7 @@ struct serial_dev_priv { #define serial_get_ops(dev)((struct dm_serial_ops *)(dev)->driver->ops) int serial_getconfig(struct udevice *dev, uint *config); -int serial_setconfig(uint config); +int serial_setconfig(struct udevice *dev, uint config); int serial_getinfo(struct serial_device_info *info); void atmel_serial_initialize(void); diff --git a/test/dm/serial.c b/test/dm/serial.c index 972755face3..f82b4a19e8f 100644 --- a/test/dm/serial.c +++ b/test/dm/serial.c @@ -23,7 +23,7 @@ static int dm_test_serial(struct unit_test_state *uts) * test with default config which is the only one supported by * sandbox_serial driver */ - ut_assertok(serial_setconfig(SERIAL_DEFAULT_CONFIG)); + ut_assertok(serial_setconfig(dev_serial, SERIAL_DEFAULT_CONFIG)); ut_assertok(serial_getconfig(dev_serial, &value_serial)); ut_assert(value_serial == SERIAL_DEFAULT_CONFIG); ut_assertok(serial_getinfo(&info_serial)); @@ -39,7 +39,8 @@ static int dm_test_serial(struct unit_test_state *uts) * sandbox_serial driver: test with wrong parity */ ut_asserteq(-ENOTSUPP, - serial_setconfig(SERIAL_CONFIG(SERIAL_PAR_ODD, + serial_setconfig(dev_serial, +SERIAL_CONFIG(SERIAL_PAR_ODD, SERIAL_8_BITS, SERIAL_ONE_STOP))); /* @@ -47,7 +48,8 @@ static int dm_test_serial(struct unit_test_state *uts) * sandbox_serial driver: test with wrong bits number */ ut_asserteq(-ENOTSUPP, - serial_setconfig(SERIAL_CONFIG(SERIAL_PAR_NONE, + serial_setconfig(dev_serial, +SERIAL_CONFIG(SERIAL_PAR_NONE, SERIAL_6_BITS, SERIAL_ONE_STOP))); @@ -56,7 +58,8 @@ static int dm_test_serial(struct unit_test_state *uts) * sandbox_serial driver: test with wrong stop bits number */ ut_asserteq(-ENOTSUPP, - serial_setconfig(SERIAL_CONFIG(SERIAL_PAR_NONE, + serial_setconfig(dev_serial, +SERIAL_CONFIG(SERIAL_PAR_NONE, SERIAL_8_BITS, SERIAL_TWO_STOP))); -- 2.20.1.415.g653613c723-goog ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH v2 5/5] dm: serial: Tidy up header file comments
The getconfig() comment is out of date. Fix this and add comments for recently added functions. Signed-off-by: Simon Glass Reviewed-by: Andy Shevchenko --- Changes in v2: - Fix @return comment on getinfo() method include/serial.h | 34 +++--- 1 file changed, 31 insertions(+), 3 deletions(-) diff --git a/include/serial.h b/include/serial.h index 8a790ccaaf4..c1368c68b64 100644 --- a/include/serial.h +++ b/include/serial.h @@ -235,9 +235,7 @@ struct dm_serial_ops { * Get a current config for this device. * * @dev: Device pointer -* @parity: parity to use -* @bits: bits number to use -* @stop: stop bits number to use +* @serial_config: Returns config information (see SERIAL_... above) * @return 0 if OK, -ve on error */ int (*getconfig)(struct udevice *dev, uint *serial_config); @@ -257,6 +255,7 @@ struct dm_serial_ops { * * @dev: Device pointer * @info: struct serial_device_info to fill +* @return 0 if OK, -ve on error */ int (*getinfo)(struct udevice *dev, struct serial_device_info *info); }; @@ -281,8 +280,37 @@ struct serial_dev_priv { /* Access the serial operations for a device */ #define serial_get_ops(dev)((struct dm_serial_ops *)(dev)->driver->ops) +/** + * serial_getconfig() - Get the uart configuration + * (parity, 5/6/7/8 bits word length, stop bits) + * + * Get a current config for this device. + * + * @dev: Device pointer + * @serial_config: Returns config information (see SERIAL_... above) + * @return 0 if OK, -ve on error + */ int serial_getconfig(struct udevice *dev, uint *config); + +/** + * serial_setconfig() - Set up the uart configuration + * (parity, 5/6/7/8 bits word length, stop bits) + * + * Set up a new config for this device. + * + * @dev: Device pointer + * @serial_config: number of bits, parity and number of stopbits to use + * @return 0 if OK, -ve on error + */ int serial_setconfig(struct udevice *dev, uint config); + +/** + * serial_getinfo() - Get serial device information + * + * @dev: Device pointer + * @info: struct serial_device_info to fill + * @return 0 if OK, -ve on error + */ int serial_getinfo(struct udevice *dev, struct serial_device_info *info); void atmel_serial_initialize(void); -- 2.20.1.415.g653613c723-goog ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH v2 4/5] dm: serial: Adjust serial_getinfo() to use proper API
All driver-model functions should have a device as the first parameter. Update this function accordingly. Signed-off-by: Simon Glass Reviewed-by: Andy Shevchenko --- Changes in v2: - Add a comment about reusing the device pointer arch/x86/lib/acpi_table.c | 11 ++- drivers/serial/serial-uclass.c | 9 +++-- include/serial.h | 2 +- test/dm/serial.c | 4 ++-- 4 files changed, 12 insertions(+), 14 deletions(-) diff --git a/arch/x86/lib/acpi_table.c b/arch/x86/lib/acpi_table.c index bfcf2adbf12..0a516427ec1 100644 --- a/arch/x86/lib/acpi_table.c +++ b/arch/x86/lib/acpi_table.c @@ -354,7 +354,10 @@ static void acpi_create_spcr(struct acpi_spcr *spcr) header->length = sizeof(struct acpi_spcr); header->revision = 2; - ret = serial_getinfo(&serial_info); + /* Read the device once, here. It is reused below */ + ret = uclass_first_device_err(UCLASS_SERIAL, &dev); + if (!ret) + ret = serial_getinfo(&serial_info); if (ret) serial_info.type = SERIAL_CHIP_UNKNOWN; @@ -432,11 +435,9 @@ static void acpi_create_spcr(struct acpi_spcr *spcr) break; } - ret = uclass_first_device_err(UCLASS_SERIAL, &dev); - if (!ret) + serial_config = SERIAL_DEFAULT_CONFIG; + if (dev) ret = serial_getconfig(dev, &serial_config); - if (ret) - serial_config = SERIAL_DEFAULT_CONFIG; spcr->parity = SERIAL_GET_PARITY(serial_config); spcr->stop_bits = SERIAL_GET_STOP(serial_config); diff --git a/drivers/serial/serial-uclass.c b/drivers/serial/serial-uclass.c index 669c82f3793..d4488a2cc28 100644 --- a/drivers/serial/serial-uclass.c +++ b/drivers/serial/serial-uclass.c @@ -316,21 +316,18 @@ int serial_setconfig(struct udevice *dev, uint config) return 0; } -int serial_getinfo(struct serial_device_info *info) +int serial_getinfo(struct udevice *dev, struct serial_device_info *info) { struct dm_serial_ops *ops; - if (!gd->cur_serial_dev) - return -ENODEV; - if (!info) return -EINVAL; info->baudrate = gd->baudrate; - ops = serial_get_ops(gd->cur_serial_dev); + ops = serial_get_ops(dev); if (ops->getinfo) - return ops->getinfo(gd->cur_serial_dev, info); + return ops->getinfo(dev, info); return -EINVAL; } diff --git a/include/serial.h b/include/serial.h index 8a05a090898..8a790ccaaf4 100644 --- a/include/serial.h +++ b/include/serial.h @@ -283,7 +283,7 @@ struct serial_dev_priv { int serial_getconfig(struct udevice *dev, uint *config); int serial_setconfig(struct udevice *dev, uint config); -int serial_getinfo(struct serial_device_info *info); +int serial_getinfo(struct udevice *dev, struct serial_device_info *info); void atmel_serial_initialize(void); void mcf_serial_initialize(void); diff --git a/test/dm/serial.c b/test/dm/serial.c index f82b4a19e8f..3d741a8c363 100644 --- a/test/dm/serial.c +++ b/test/dm/serial.c @@ -26,14 +26,14 @@ static int dm_test_serial(struct unit_test_state *uts) ut_assertok(serial_setconfig(dev_serial, SERIAL_DEFAULT_CONFIG)); ut_assertok(serial_getconfig(dev_serial, &value_serial)); ut_assert(value_serial == SERIAL_DEFAULT_CONFIG); - ut_assertok(serial_getinfo(&info_serial)); + ut_assertok(serial_getinfo(dev_serial, &info_serial)); ut_assert(info_serial.type == SERIAL_CHIP_UNKNOWN); ut_assert(info_serial.addr == SERIAL_DEFAULT_ADDRESS); /* * test with a parameter which is NULL pointer */ ut_asserteq(-EINVAL, serial_getconfig(dev_serial, NULL)); - ut_asserteq(-EINVAL, serial_getinfo(NULL)); + ut_asserteq(-EINVAL, serial_getinfo(dev_serial, NULL)); /* * test with a serial config which is not supported by * sandbox_serial driver: test with wrong parity -- 2.20.1.415.g653613c723-goog ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
Re: [U-Boot] [PATCH 1/3] video: Add information about using TrueType fonts
Hi Simon, On Thu, 27 Dec 2018 15:25:17 -0700 Simon Glass s...@chromium.org wrote: > U-Boot supports using TrueType fonts on the console, which is useful for > presenting a nice UI to users, e.g. for system recovery. > > Add information about how to compile this on ARM platforms, since this is > not obvious. > > Signed-off-by: Simon Glass > --- > > doc/README.video | 20 > 1 file changed, 20 insertions(+) Applied to u-boot-video/master, thanks! -- Anatolij ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
Re: [U-Boot] [PATCH 2/3] video: Add a default TrueType font
On Thu, 27 Dec 2018 15:25:18 -0700 Simon Glass s...@chromium.org wrote: > At present it is possible to enable TrueType support but not include any > fonts. This results in a blank display. Select Nimbus as the default font > to avoid this. > > Signed-off-by: Simon Glass > --- > > drivers/video/fonts/Kconfig | 1 + > 1 file changed, 1 insertion(+) Applied to u-boot-video/master, thanks! -- Anatolij ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
Re: [U-Boot] [PATCH 3/3] video: rockchip: Use TrueType fonts with jerry
On Thu, 27 Dec 2018 15:25:19 -0700 Simon Glass s...@chromium.org wrote: > As an example of how to enable TrueType fonts, move chromebook_jerry over > to use these. > > Signed-off-by: Simon Glass > --- > > configs/chromebook_jerry_defconfig | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) Applied to u-boot-video/master, thanks! -- Anatolij ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH] dm: video: fix test failures with enabled default TrueType font
With enabled default Nimbus font dm_test_video_truetype* tests fail. Update expected expressions to fix them. Signed-off-by: Anatolij Gustschin --- test/dm/video.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/dm/video.c b/test/dm/video.c index 5d1faac19c..6be5defc53 100644 --- a/test/dm/video.c +++ b/test/dm/video.c @@ -335,7 +335,7 @@ static int dm_test_video_truetype(struct unit_test_state *uts) ut_assertok(uclass_get_device(UCLASS_VIDEO, 0, &dev)); ut_assertok(uclass_get_device(UCLASS_VIDEO_CONSOLE, 0, &con)); vidconsole_put_string(con, test_string); - ut_asserteq(12619, compress_frame_buffer(dev)); + ut_asserteq(12237, compress_frame_buffer(dev)); return 0; } @@ -356,7 +356,7 @@ static int dm_test_video_truetype_scroll(struct unit_test_state *uts) ut_assertok(uclass_get_device(UCLASS_VIDEO, 0, &dev)); ut_assertok(uclass_get_device(UCLASS_VIDEO_CONSOLE, 0, &con)); vidconsole_put_string(con, test_string); - ut_asserteq(33849, compress_frame_buffer(dev)); + ut_asserteq(35030, compress_frame_buffer(dev)); return 0; } @@ -377,7 +377,7 @@ static int dm_test_video_truetype_bs(struct unit_test_state *uts) ut_assertok(uclass_get_device(UCLASS_VIDEO, 0, &dev)); ut_assertok(uclass_get_device(UCLASS_VIDEO_CONSOLE, 0, &con)); vidconsole_put_string(con, test_string); - ut_asserteq(34871, compress_frame_buffer(dev)); + ut_asserteq(29018, compress_frame_buffer(dev)); return 0; } -- 2.17.1 ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
Re: [U-Boot] [PATCH v2] rockchip: sdram-common: fix wrong size for 4GB in 32bit SoC
On 2018-12-28, Kever Yang wrote: > This is workaround for issue we can't get correct size for 4GB ram > in 32bit system and available before we really need ram space > out of 4GB, eg.enable ARM LAPE(rk3288 supports 8GB ram). > The size of 4GB is '0x1 ', and this value will be truncated > to 0 in 32bit system, and system can not get correct ram size. > Rockchip SoCs reserve a blob of space for peripheral near 4GB, > and we are now setting SDRAM_MAX_SIZE as max available space for > ram in 4GB, so we can use this directly to workaround the issue. U-Boot SPL 2019.01-rc2+dfsg-1~20181228~1 (Dec 28 2018 - 23:14:06 +) Returning to boot ROM... U-Boot 2019.01-rc2+dfsg-1~20181228~1 (Dec 28 2018 - 23:14:06 +) Model: Firefly-RK3288 DRAM: 4 GiB MMC: dwmmc@ff0c: 1, dwmmc@ff0f: 0 Loading Environment from MMC... *** Warning - bad CRC, using default environment In:serial Out: serial Err: serial Model: Firefly-RK3288 Net: Warning: ethernet@ff29 (eth0) using random MAC address - 92:d3:c4:69:51:2c eth0: ethernet@ff29 Hit any key to stop autoboot: 0 And it boots! First time I've seen u-boot working on the firefly-rk3288 since ... v2018.01 Thanks for all the fixes everyone! Tested-By: Vagrant Cascadian live well, vagrant > Signed-off-by: Kever Yang > > --- > > Changes in v2: > - update the commit message and comment to show this is a workaround. > > arch/arm/mach-rockchip/sdram_common.c | 18 ++ > 1 file changed, 18 insertions(+) > > diff --git a/arch/arm/mach-rockchip/sdram_common.c > b/arch/arm/mach-rockchip/sdram_common.c > index 650d53e4d9..a27138083a 100644 > --- a/arch/arm/mach-rockchip/sdram_common.c > +++ b/arch/arm/mach-rockchip/sdram_common.c > @@ -48,6 +48,24 @@ size_t rockchip_sdram_size(phys_addr_t reg) > rank, col, bk, cs0_row, bw, row_3_4); > } > > + /* > + * This is workaround for issue we can't get correct size for 4GB ram > + * in 32bit system and available before we really need ram space > + * out of 4GB, eg.enable ARM LAPE(rk3288 supports 8GB ram). > + * The size of 4GB is '0x1 ', and this value will be truncated > + * to 0 in 32bit system, and system can not get correct ram size. > + * Rockchip SoCs reserve a blob of space for peripheral near 4GB, > + * and we are now setting SDRAM_MAX_SIZE as max available space for > + * ram in 4GB, so we can use this directly to workaround the issue. > + * TODO: > + * 1. update correct value for SDRAM_MAX_SIZE as what dram > + * controller sees. > + * 2. update board_get_usable_ram_top() and dram_init_banksize() > + * to reserve memory for peripheral space after previous update. > + */ > + if (size_mb > (SDRAM_MAX_SIZE >> 20)) > + size_mb = (SDRAM_MAX_SIZE >> 20); > + > return (size_t)size_mb << 20; > } > > -- > 2.20.1 signature.asc Description: PGP signature ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
Re: [U-Boot] [PATCH v2] rockchip: sdram-common: fix wrong size for 4GB in 32bit SoC
> On 28.12.2018, at 02:56, Kever Yang wrote: > > This is workaround for issue we can't get correct size for 4GB ram > in 32bit system and available before we really need ram space > out of 4GB, eg.enable ARM LAPE(rk3288 supports 8GB ram). > The size of 4GB is '0x1 ', and this value will be truncated > to 0 in 32bit system, and system can not get correct ram size. > Rockchip SoCs reserve a blob of space for peripheral near 4GB, > and we are now setting SDRAM_MAX_SIZE as max available space for > ram in 4GB, so we can use this directly to workaround the issue. > > Signed-off-by: Kever Yang Reviewed-by: Philipp Tomsich Currently running on Travis … let’s see whether I need to remove the ‘TODO’ to get it to pass ;-) ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
Re: [U-Boot] [PATCH] dm: video: fix test failures with enabled default TrueType font
On Fri, 28 Dec 2018 at 17:09, Anatolij Gustschin wrote: > > With enabled default Nimbus font dm_test_video_truetype* tests fail. > Update expected expressions to fix them. > > Signed-off-by: Anatolij Gustschin > --- > test/dm/video.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) Reviewed-by: Simon Glass Thanks, I didn't even think of that as I thought it was a choice! Perhaps I shold have used the existing default. Regards, Simon ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
Re: [U-Boot] [PATCH v2] rockchip: sdram-common: fix wrong size for 4GB in 32bit SoC
Kever, I agree that getting LPAE enabled on the RK3288 (in one of the next releases) would be great. We could then turn on PHYS64_BIT, never worry about this again (and not need a workaround at all) and have the hardware’s capabilities accurately modelled. Let me know if I can do anything to help towards that goal. Thanks, Philipp. > On 28.12.2018, at 02:56, Kever Yang wrote: > > This is workaround for issue we can't get correct size for 4GB ram > in 32bit system and available before we really need ram space > out of 4GB, eg.enable ARM LAPE(rk3288 supports 8GB ram). > The size of 4GB is '0x1 ', and this value will be truncated > to 0 in 32bit system, and system can not get correct ram size. > Rockchip SoCs reserve a blob of space for peripheral near 4GB, > and we are now setting SDRAM_MAX_SIZE as max available space for > ram in 4GB, so we can use this directly to workaround the issue. > > Signed-off-by: Kever Yang > --- > > Changes in v2: > - update the commit message and comment to show this is a workaround. > > arch/arm/mach-rockchip/sdram_common.c | 18 ++ > 1 file changed, 18 insertions(+) > > diff --git a/arch/arm/mach-rockchip/sdram_common.c > b/arch/arm/mach-rockchip/sdram_common.c > index 650d53e4d9..a27138083a 100644 > --- a/arch/arm/mach-rockchip/sdram_common.c > +++ b/arch/arm/mach-rockchip/sdram_common.c > @@ -48,6 +48,24 @@ size_t rockchip_sdram_size(phys_addr_t reg) > rank, col, bk, cs0_row, bw, row_3_4); > } > > + /* > + * This is workaround for issue we can't get correct size for 4GB ram > + * in 32bit system and available before we really need ram space > + * out of 4GB, eg.enable ARM LAPE(rk3288 supports 8GB ram). > + * The size of 4GB is '0x1 ', and this value will be truncated > + * to 0 in 32bit system, and system can not get correct ram size. > + * Rockchip SoCs reserve a blob of space for peripheral near 4GB, > + * and we are now setting SDRAM_MAX_SIZE as max available space for > + * ram in 4GB, so we can use this directly to workaround the issue. > + * TODO: > + * 1. update correct value for SDRAM_MAX_SIZE as what dram > + * controller sees. > + * 2. update board_get_usable_ram_top() and dram_init_banksize() > + * to reserve memory for peripheral space after previous update. > + */ > + if (size_mb > (SDRAM_MAX_SIZE >> 20)) > + size_mb = (SDRAM_MAX_SIZE >> 20); > + > return (size_t)size_mb << 20; > } > > -- > 2.20.1 > ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [GIT PULL] UniPhier updates for v2019.01
Hi Tom, Please pull UniPhier updates v2019.01 - import DIV_ROUND_CLOSEST_ULL macro from Linux - import improvement and fix of Denali NAND driver from Linux - add NAND 200MHz clock to clk driver - allow CONFIG_BOOTCOMMAND to run custom boot command/script - sync DT with Linux 4.20 The following changes since commit bea3d826203f90507ff32ed24bd0a3c53479e55c: Merge tag 'signed-efi-2019.01' of git://github.com/agraf/u-boot (2018-12-27 12:59:01 -0500) are available in the git repository at: git://git.denx.de/u-boot-uniphier.git master for you to fetch changes up to 2001a81cba9554ee8b7f6d2ecd53510640ce4f35: ARM: uniphier: dts: sync with Linux 4.20 (2018-12-29 11:50:30 +0900) Masahiro Yamada (9): ARM: uniphier: do not modify bootcmd environment variable at run-time ARM: uniphier: allow to source boot script before distro-boot ARM: uniphier: add CONFIG_PREBOOT linux/kernel.h: import DIV_ROUND_CLOSEST_ULL from Linux mtd: rawnand: denali_dt: add more clocks based on IP datasheet mtd: rawnand: denali: optimize timing parameters for data interface mtd: rawnand: denali: fix a race condition when DMA is kicked clk: uniphier: add NAND 200MHz clock ARM: uniphier: dts: sync with Linux 4.20 arch/arm/dts/uniphier-ld11.dtsi | 52 ++- arch/arm/dts/uniphier-ld20-global.dts| 4 + arch/arm/dts/uniphier-ld20-ref.dts | 4 + arch/arm/dts/uniphier-ld20.dtsi | 242 - arch/arm/dts/uniphier-ld4.dtsi | 14 +- arch/arm/dts/uniphier-pinctrl.dtsi | 20 +++ arch/arm/dts/uniphier-pro4-ace.dts | 8 +- arch/arm/dts/uniphier-pro4-sanji.dts | 8 +- arch/arm/dts/uniphier-pro4.dtsi | 143 - arch/arm/dts/uniphier-pro5.dtsi | 25 ++- arch/arm/dts/uniphier-pxs2.dtsi | 207 - arch/arm/dts/uniphier-pxs3.dtsi | 267 +++- arch/arm/dts/uniphier-sld8.dtsi | 14 +- arch/arm/mach-uniphier/board_late_init.c | 8 +- configs/uniphier_ld4_sld8_defconfig | 1 + configs/uniphier_v7_defconfig| 1 + configs/uniphier_v8_defconfig| 1 + drivers/clk/uniphier/clk-uniphier-sys.c | 8 +- drivers/mtd/nand/raw/denali.c| 53 --- drivers/mtd/nand/raw/denali.h| 1 + drivers/mtd/nand/raw/denali_dt.c | 40 - include/configs/uniphier.h | 26 include/linux/kernel.h | 12 ++ 23 files changed, 1109 insertions(+), 50 deletions(-) -- Best Regards Masahiro Yamada ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
Re: [U-Boot] [PATCH] imx8mq_evk_defconfig: Move file system options to Kconfig
> -Original Message- > From: Fabio Estevam [mailto:feste...@gmail.com] > Sent: 2018年12月28日 3:14 > To: sba...@denx.de > Cc: dl-uboot-imx ; u-boot@lists.denx.de; > spence...@gmail.com; Fabio Estevam > Subject: [PATCH] imx8mq_evk_defconfig: Move file system options to Kconfig > > Chris Spencer reports that when enabling ext4 read support without also > enabling write support the following error is seen: > > fs/fs.c:198:12: error: 'ext4_write_file' undeclared here (not in a function); > did > you mean 'ext4_read_file'? >.write = ext4_write_file, > ^~~ > Fix this problem by moving these options to Kconfig. > > Reported-by: Chris Spencer > Signed-off-by: Fabio Estevam Acked-by: Peng Fan > --- > configs/imx8mq_evk_defconfig | 5 + > include/configs/imx8mq_evk.h | 6 -- > 2 files changed, 5 insertions(+), 6 deletions(-) > > diff --git a/configs/imx8mq_evk_defconfig b/configs/imx8mq_evk_defconfig > index f216d46a8f..b473fcd61b 100644 > --- a/configs/imx8mq_evk_defconfig > +++ b/configs/imx8mq_evk_defconfig > @@ -15,6 +15,11 @@ CONFIG_SPL_LOAD_FIT=y CONFIG_SPL=y > CONFIG_SPL_BOARD_INIT=y CONFIG_HUSH_PARSER=y > +CONFIG_DOS_PARTITION=y > +CONFIG_CMD_EXT2=y > +CONFIG_CMD_EXT4=y > +CONFIG_CMD_EXT4_WRITE=y > +CONFIG_CMD_FAT= > CONFIG_CMD_GPIO=y > CONFIG_CMD_I2C=y > CONFIG_CMD_CACHE=y > diff --git a/include/configs/imx8mq_evk.h b/include/configs/imx8mq_evk.h > index 35f81152f2..f0430224cb 100644 > --- a/include/configs/imx8mq_evk.h > +++ b/include/configs/imx8mq_evk.h > @@ -226,12 +226,6 @@ > #define CONFIG_SYS_FSL_USDHC_NUM 2 > #define CONFIG_SYS_FSL_ESDHC_ADDR 0 > > -#define CONFIG_DOS_PARTITION > -#define CONFIG_CMD_EXT2 > -#define CONFIG_CMD_EXT4 > -#define CONFIG_CMD_EXT4_WRITE > -#define CONFIG_CMD_FAT > - > #define CONFIG_SUPPORT_EMMC_BOOT /* eMMC specific */ > #define CONFIG_SYS_MMC_IMG_LOAD_PART 1 > > -- > 2.17.1 ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot