rockchip: convert the RK3368 to OF_LIVE and validate on the RK3368-uQ7
Subsystems (10)
v2 cover rockchip: convert the RK3368 to OF_LIVE and validate on the RK3368-uQ7
This series converts all dependencies for the RK3368-uQ7 to support a live tree and and tests w/ BOOTSTAGE enabled (thus introducing a few additional changes to the Rockchip DM timer driver).
Note that updating the RK3399 support (which will have us look at video) for a live tree will be next: I plan to keep the RK3399 changes as a separate series (to be applied on top of this one).
Changes in v2:
- implements the dev_read_addr_ptr() function
- use the new dev_read_addr_ptr() function
- improve error handling, in case dev_read_addr_ptr returns NULL
Philipp Tomsich (19):
bootstage: adjust Makefile to allow including bootstage in SPL, but
not in TPL
dm: timer: Convert to livetree
dm: timer: handle being called before dm_root is ready
dm: core: add dev_read_addr_ptr()
net: designware: Convert to livetree
net: phy: micrel: Convert to livetree
rockchip: mmc: convert to livetree
rockchip: timer: implement timer_get_boot_us
rockchip: timer: Convert to livetree
rockchip: clk: rk3368: Convert to livetree
rockchip: pinctrl: rk3368: Convert to livetree
rockchip: spi: Convert to livetree
rockchip: sdhci: Convert to livetree
rockchip: rk8xx: remove unused header includes
rockchip: i2c: Convert to livetree
rockchip: gpio: convert to livetree
rockchip: gpio: remove outdated/misleading comment
rockchip: dts: rk3368-lion: add /chosen/tick-timer
rockchip: lion-rk3368: defconfig: resync w/ OF_LIVE and BOOTSTAGE
enabled
arch/arm/dts/rk3368-lion-u-boot.dtsi | 2 + common/Makefile | 2 +- configs/lion-rk3368_defconfig | 7 +++ drivers/clk/rockchip/clk_rk3368.c | 2 +- drivers/core/read.c | 7 +++ drivers/gpio/rk_gpio.c | 3 +- drivers/i2c/rk_i2c.c | 2 +- drivers/mmc/rockchip_dw_mmc.c | 2 +- drivers/mmc/rockchip_sdhci.c | 3 +- drivers/net/designware.c | 11 ++--- drivers/net/phy/micrel_ksz90x1.c | 5 +- drivers/pinctrl/rockchip/pinctrl_rk3368.c | 3 +- drivers/power/pmic/rk8xx.c | 2 - drivers/spi/rk_spi.c | 2 +- drivers/timer/rockchip_timer.c | 76 ++++++++++++++++++++++++++++--- drivers/timer/timer-uclass.c | 52 ++++++++++++--------- include/dm/read.h | 15 ++++++ 17 files changed, 144 insertions(+), 52 deletions(-)
Signature · 1 line
2.1.4
PATCH v2 1/19 bootstage: adjust Makefile to allow including bootstage in SPL, but not in TPL
For timing our bootstages on the RK3368, which has a minimal TPL (and where we consequently don't want to time the bootstages) and a full-featured SPL (where we can bootstage recording), we need to adjust the Makefile.
Use the $(SPL_TPL_) macro in the Makefile for bootstage.o
---
Changes in v2: None
common/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
common/Makefile +1 -1
@@ -63,7 +63,7 @@ obj-$(CONFIG_CMDLINE) += cli_readline.o cli_simple.o endif # !CONFIG_SPL_BUILD -obj-$(CONFIG_$(SPL_)BOOTSTAGE) += bootstage.o +obj-$(CONFIG_$(SPL_TPL_)BOOTSTAGE) += bootstage.o ifdef CONFIG_SPL_BUILD obj-$(CONFIG_SPL_DFU_SUPPORT) += dfu.o
Signature · 1 line
2.1.4
PATCH v2 2/19 dm: timer: Convert to livetree
In reply to Philipp TomsichThis updates dm_timer_init to support a live tree and deals with some fallout (i.e. the need to restructure the code such, that we don't need multiple discontinuous #if CONFIG_IS_ENABLED blocks).
---
Changes in v2: None
drivers/timer/timer-uclass.c | 45 ++++++++++++++++++++++---------------------- 1 file changed, 23 insertions(+), 22 deletions(-)
drivers/timer/timer-uclass.c +23 -22
@@ -8,6 +8,7 @@#include <dm.h> #include <dm/lists.h> #include <dm/device-internal.h> +#include <dm/root.h> #include <clk.h> #include <errno.h> #include <timer.h>
@@ -54,9 +55,10 @@ static int timer_pre_probe(struct udevice *dev)if (IS_ERR_VALUE (ret))return ret; uc_priv->clock_rate = ret; - }else - uc_priv->clock_rate =fdtdec_get_int (gd->fdt_blob, -dev_of_offset (dev),"clock-frequency" ,0 ); + }else { + uc_priv->clock_rate = +dev_read_u32_default (dev,"clock-frequency" ,0 ); + }#endif return 0 ;
@@ -83,9 +85,8 @@ u64 timer_conv_64(u32 count) int notrace dm_timer_init(void) { -__maybe_unused const void *blob = gd->fdt_blob;struct udevice *dev =NULL ; -int node = -ENOENT ; +__maybe_unused ofnode node;int ret;if (gd->timer)
@@ -93,27 +94,27 @@ int notrace dm_timer_init(void)#if !CONFIG_IS_ENABLED (OF_PLATDATA )/* Check for a chosen timer to be used for tick */ - node =fdtdec_get_chosen_node (blob,"tick-timer" ); + node =ofnode_get_chosen_node ("tick-timer" ); + +if (ofnode_valid (node) && +uclass_get_device_by_ofnode (UCLASS_TIMER , node, &dev)) { +/* +* If the timer is not marked to be bound before +* relocation, bind it anyway. +*/ +if (!lists_bind_fdt (dm_root (), node, &dev)) { + ret =device_probe (dev); +if (ret) +return ret; + } + }#endif -if (node <0 ) { -/* No chosen timer, trying first available timer */ + +if (!dev) { +/* Fall back to the first available timer */ ret =uclass_first_device_err (UCLASS_TIMER , &dev);if (ret)return ret; - }else { -if (uclass_get_device_by_of_offset (UCLASS_TIMER , node, &dev)) { -/* -* If the timer is not marked to be bound before -* relocation, bind it anyway. -*/ -if (node >0 && - !lists_bind_fdt (gd->dm_root,offset_to_ofnode (node), - &dev)) { - ret =device_probe (dev); -if (ret) -return ret; - } - } }if (dev) {
Signature · 1 line
2.1.4
PATCH v2 3/19 dm: timer: handle being called before dm_root is ready
In reply to Philipp TomsichWhen used with bootstage recording, dm_timer_init may be called surprisingly early: i.e. before dm_root is ready. To deal with this case, we explicitly check for this condition and return -EAGAIN to the caller (refer to drivers/timer/rockchip_timer.c for a case where this is needed/used).
---
Changes in v2: None
drivers/timer/timer-uclass.c | 7 +++++++ 1 file changed, 7 insertions(+)
drivers/timer/timer-uclass.c +7 -0
@@ -92,6 +92,13 @@ int notrace dm_timer_init(void)if (gd->timer)return 0 ; +/* +* Directly access gd->dm_root to suppress error messages, if the +* virtual root driver does not yet exist. +*/ +if (gd->dm_root ==NULL ) +return -EAGAIN ; +#if !CONFIG_IS_ENABLED (OF_PLATDATA )/* Check for a chosen timer to be used for tick */ node =ofnode_get_chosen_node ("tick-timer" );
Signature · 1 line
2.1.4
PATCH v2 4/19 dm: core: add dev_read_addr_ptr()
In reply to Philipp TomsichThe dev_read_addr_ptr() mimics the behaviour of the devfdt_get_addr_ptr(), retrieving the first address of the node's reg-property and returning it as a pointer (or NULL on failure).
---
Changes in v2:
- implements the dev_read_addr_ptr() function
drivers/core/read.c | 7 +++++++ include/dm/read.h | 15 +++++++++++++++ 2 files changed, 22 insertions(+)
drivers/core/read.c +7 -0
@@ -57,6 +57,13 @@ fdt_addr_t dev_read_addr(struct udevice *dev)return dev_read_addr_index (dev,0 ); } +void *dev_read_addr_ptr (struct udevice *dev) +{ +fdt_addr_t addr =dev_read_addr (dev); + +return (addr ==FDT_ADDR_T_NONE ) ?NULL : (void *)addr; +} +fdt_addr_t dev_read_addr_size (struct udevice *dev,const char *property,fdt_size_t *sizep) {
include/dm/read.h +15 -0
@@ -113,6 +113,16 @@ fdt_addr_t dev_read_addr_index(struct udevice *dev, int index);fdt_addr_t dev_read_addr (struct udevice *dev);/** +* dev_read_addr_ptr() - Get the reg property of a device +* as a pointer +* +* @dev: Device to read from +* +* @return pointer or NULL if not found +*/ +void *dev_read_addr_ptr (struct udevice *dev); + +/** * dev_read_addr_size() - get address and size from a device property * * This does no address translation. It simply reads an property that contains
@@ -417,6 +427,11 @@ static inline fdt_addr_t dev_read_addr(struct udevice *dev)return devfdt_get_addr (dev); } +static inline void *dev_read_addr_ptr (struct udevice *dev) +{ +return devfdt_get_addr_ptr (dev); +} +static inline fdt_addr_t dev_read_addr_size (struct udevice *dev,const char *propname,fdt_size_t *sizep)
Signature · 1 line
2.1.4
PATCH v2 4/19 dm: core: add dev_read_addr_ptr()
Quoted 7 lines · Philipp Tomsich
The
dev_read_addr_ptr()mimics the behaviour of thedevfdt_get_addr_ptr(), retrieving the first address of the node's reg-property and returning it as a pointer (or NULL on failure).Signed-off-by Philipp Tomsich <[email protected]>Acked-by Philipp Tomsich <[email protected]>
Quoted 8 lines
---
Changes in v2:
- implements thedev_read_addr_ptr()functiondrivers/core/read.c | 7 +++++++ include/dm/read.h | 15 +++++++++++++++ 2 files changed, 22 insertions(+)
PATCH v2 5/19 net: designware: Convert to livetree
In reply to Philipp TomsichUpdate the Designware Ethernet MAC driver to support a live device tree.
---
Changes in v2: None
drivers/net/designware.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-)
drivers/net/designware.c +3 -8
@@ -737,16 +737,14 @@ int designware_eth_ofdata_to_platdata(struct udevice *dev)#endif struct eth_pdata *pdata = &dw_pdata->eth_pdata;const char *phy_mode; -const fdt32_t *cell;#ifdef CONFIG_DM_GPIO int reset_flags =GPIOD_IS_OUT ;#endif int ret =0 ; - pdata->iobase =devfdt_get_addr (dev); + pdata->iobase =dev_read_addr (dev); pdata->phy_interface =-1 ; - phy_mode =fdt_getprop (gd->fdt_blob,dev_of_offset (dev),"phy-mode" , -NULL ); + phy_mode =dev_read_string (dev,"phy-mode" );if (phy_mode) pdata->phy_interface =phy_get_interface_by_name (phy_mode);if (pdata->phy_interface ==-1 ) {
@@ -754,10 +752,7 @@ int designware_eth_ofdata_to_platdata(struct udevice *dev)return -EINVAL ; } - pdata->max_speed =0 ; - cell =fdt_getprop (gd->fdt_blob,dev_of_offset (dev),"max-speed" ,NULL ); -if (cell) - pdata->max_speed =fdt32_to_cpu (*cell); + pdata->max_speed =dev_read_u32_default (dev,"max-speed" ,0 );#ifdef CONFIG_DM_GPIO if (dev_read_bool (dev,"snps,reset-active-low" ))
Signature · 1 line
2.1.4
PATCH v2 6/19 net: phy: micrel: Convert to livetree
In reply to Philipp TomsichUpdate the Micrel KSZ90x1 driver for a live tree.
---
Changes in v2: None
drivers/net/phy/micrel_ksz90x1.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/net/phy/micrel_ksz90x1.c +2 -3
@@ -9,11 +9,11 @@* (C) Copyright 2017 Adaptrum, Inc. * Written by Alexandru Gagniuc <[email protected]> for Adaptrum, Inc. */ +#include <config.h> #include <common.h> #include <dm.h> #include <errno.h> -#include <fdtdec.h> #include <micrel.h> #include <phy.h>
@@ -120,8 +120,7 @@ static int ksz90x1_of_config_group(struct phy_device *phydev,return -EOPNOTSUPP ;for (i =0 ; i < ofcfg->grpsz; i++) { - val[i] =fdtdec_get_uint (gd->fdt_blob,dev_of_offset (dev), - ofcfg->grp[i].name,-1 ); + val[i] =dev_read_u32_default (dev, ofcfg->grp[i].name, ~0 ); offset = ofcfg->grp[i].off;if (val[i] ==-1 ) {/* Default register value for KSZ9021 */
Signature · 1 line
2.1.4
PATCH v2 6/19 net: phy: micrel: Convert to livetree
Quoted 3 lines · Philipp Tomsich
Update the Micrel KSZ90x1 driver for a live tree.
Signed-off-by Philipp Tomsich <[email protected]>
You seem to not have included my Acked-by tags in the new version.
-Joe
Quoted 41 lines
---
Changes in v2: None
drivers/net/phy/micrel_ksz90x1.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)drivers/net/phy/micrel_ksz90x1.c +2
-4@@ -9,11 +9,11 @@* (C) Copyright 2017 Adaptrum, Inc. * Written by Alexandru Gagniuc <[email protected]> for Adaptrum, Inc. */ +#include <config.h> #include <common.h> #include <dm.h> #include <errno.h> -#include <fdtdec.h> #include <micrel.h> #include <phy.h> @@ -120,8 +120,7 @@ static int ksz90x1_of_config_group(struct phy_device *phydev,return -EOPNOTSUPP ;for (i =0 ; i < ofcfg->grpsz; i++) { - val[i] =fdtdec_get_uint (gd->fdt_blob,dev_of_offset (dev), - ofcfg->grp[i].name,-1 ); + val[i] =dev_read_u32_default (dev, ofcfg->grp[i].name, ~0 ); offset = ofcfg->grp[i].off;if (val[i] ==-1 ) {/* Default register value for KSZ9021 */ --2.1.4
_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
https://lists.denx.de/listinfo/u-boot
PATCH v2 6/19 net: phy: micrel: Convert to livetree
Quoted 9 lines · Joe Hershberger
Quoted 3 lines · On Mon, Sep 11, 2017 at 4:18 AM, Philipp Tomsich <philipp.tomsich at…
Update the Micrel KSZ90x1 driver for a live tree.
Signed-off-by Philipp Tomsich <philipp.tomsich at theobroma-systems.com <mailto:[email protected]>>You seem to not have included my Acked-by tags in the new version.
Oops. Seems like those got lost those somewhere along the line. Thanks for pointing this out.
Phil.
PATCH v2 7/19 rockchip: mmc: convert to livetree
In reply to Philipp TomsichUpdate the Rockchip-specific wrapper for the Designware driver to support a live device tree.
Version-changes: 2
- use the dev_read_addr_ptr function in rockchip_dw_mmc.c
---
Changes in v2: None
drivers/mmc/rockchip_dw_mmc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mmc/rockchip_dw_mmc.c +1 -1
@@ -58,7 +58,7 @@ static int rockchip_dwmmc_ofdata_to_platdata(struct udevice *dev)struct dwmci_host *host = &priv->host; host->name = dev->name; - host->ioaddr = (void *)devfdt_get_addr (dev); + host->ioaddr =dev_read_addr_ptr (dev); host->buswidth =dev_read_u32_default (dev,"bus-width" ,4 ); host->get_mmc_clk = rockchip_dwmmc_get_mmc_clk; host->priv = dev;
Signature · 1 line
2.1.4
PATCH v2 8/19 rockchip: timer: implement timer_get_boot_us
In reply to Philipp TomsichTo make the Rockchip DM timer driver useful for the timing of bootstages, we need a few enhancements:
- This implements timer_get_boot_us.
- This avoids reinitialising the timer, if it has already been set up (e.g. by our TPL and SPL stages). Now, we have a single timebase ticking from TPL through the full U-Boot.
- This adds support for reading the timer even before the device-model is ready: we find the timer via /chosen/tick-timer, then read its address and clock-frequency, and finally read the timeval directly).
---
Changes in v2: None
drivers/timer/rockchip_timer.c | 72 +++++++++++++++++++++++++++++++++++++++--- 1 file changed, 67 insertions(+), 5 deletions(-)
drivers/timer/rockchip_timer.c +67 -5
@@ -6,6 +6,7 @@#include <common.h> #include <dm.h> +#include <dm/ofnode.h> #include <mapmem.h> #include <asm/arch/timer.h> #include <dt-structs.h>
@@ -25,17 +26,72 @@ struct rockchip_timer_priv {struct rk_timer *timer; }; -static int rockchip_timer_get_count (struct udevice *dev,u64 *count) +static inline int64_t rockchip_timer_get_curr_value (struct rk_timer *timer) { -struct rockchip_timer_priv *priv =dev_get_priv (dev);uint64_t timebase_h, timebase_l;uint64_t cntr; - timebase_l =readl (&priv->timer->timer_curr_value0); - timebase_h =readl (&priv->timer->timer_curr_value1); + timebase_l =readl (&timer->timer_curr_value0); + timebase_h =readl (&timer->timer_curr_value1); -/* timers are down-counting */ cntr = timebase_h <<32 | timebase_l; +return cntr; +} + +#if CONFIG_IS_ENABLED (BOOTSTAGE ) +ulong timer_get_boot_us (void ) +{ +uint64_t ticks =0 ; +uint32_t rate; +uint64_t us; +int ret; + + ret =dm_timer_init (); + +if (!ret) { +/* The timer is available */ + rate =timer_get_rate (gd->timer); +timer_get_count (gd->timer, &ticks); +#if !CONFIG_IS_ENABLED (OF_PLATDATA ) + } else if (ret == -EAGAIN) { +/* We have been called so early that the DM is not ready,... */ +ofnode node =offset_to_ofnode (-1 ); +struct rk_timer *timer =NULL ; + +/* +* ... so we try to access the raw timer, if it is specified +* via the tick-timer property in /chosen. +*/ + node =ofnode_get_chosen_node ("tick-timer" ); +if (!ofnode_valid (node)) { +debug ("%s: no /chosen/tick-timer\n" , __func__); +return 0 ; + } + + timer = (struct rk_timer *)ofnode_get_addr (node); + +/* This timer is down-counting */ + ticks = ~0uLL -rockchip_timer_get_curr_value (timer); +if (ofnode_read_u32 (node,"clock-frequency" , &rate)) { +debug ("%s: could not read clock-frequency\n" , __func__); +return 0 ; + } +#endif + }else { +return 0 ; + } + + us = (ticks *1000 ) / rate; +return us; +} +#endif + +static int rockchip_timer_get_count (struct udevice *dev,u64 *count) +{ +struct rockchip_timer_priv *priv =dev_get_priv (dev); +uint64_t cntr =rockchip_timer_get_curr_value (priv->timer); + +/* timers are down-counting */ *count = ~0ull - cntr;return 0 ; }
@@ -58,6 +114,12 @@ static int rockchip_timer_start(struct udevice *dev)const uint32_t reload_val_l = reload_val &0xffffffff ;const uint32_t reload_val_h = reload_val >>32 ; +/* don't reinit, if the timer is already running and set up */ +if ((readl (&priv->timer->timer_ctrl_reg) &1 ) ==1 && + (readl (&priv->timer->timer_load_count0) == reload_val_l) && + (readl (&priv->timer->timer_load_count1) == reload_val_h)) +return 0 ; +/* disable timer and reset all control */ writel (0 , &priv->timer->timer_ctrl_reg);/* write reload value */
Signature · 1 line
2.1.4
PATCH v2 9/19 rockchip: timer: Convert to livetree
In reply to Philipp TomsichUpdate the Rockchip timer driver to support a live device tree.
---
Changes in v2:
- use the new dev_read_addr_ptr() function
- improve error handling, in case dev_read_addr_ptr returns NULL
drivers/timer/rockchip_timer.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/timer/rockchip_timer.c +3 -1
@@ -101,7 +101,9 @@ static int rockchip_clk_ofdata_to_platdata(struct udevice *dev)#if !CONFIG_IS_ENABLED (OF_PLATDATA )struct rockchip_timer_priv *priv =dev_get_priv (dev); - priv->timer = (struct rk_timer *)devfdt_get_addr (dev); + priv->timer =dev_read_addr_ptr (dev); +if (!priv->timer) +return -ENOENT ;#endif return 0 ;
Signature · 1 line
2.1.4
PATCH v2 10/19 rockchip: clk: rk3368: Convert to livetree
In reply to Philipp TomsichUpdate the clock driver for the RK3368 to support a live device tree.
Version-changes: 2
- use the dev_read_addr_ptr function in clk_rk3368.c
---
Changes in v2: None
drivers/clk/rockchip/clk_rk3368.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clk/rockchip/clk_rk3368.c +1 -1
@@ -485,7 +485,7 @@ static int rk3368_clk_ofdata_to_platdata(struct udevice *dev)#if !CONFIG_IS_ENABLED (OF_PLATDATA )struct rk3368_clk_priv *priv =dev_get_priv (dev); - priv->cru = (struct rk3368_cru *)devfdt_get_addr (dev); + priv->cru =dev_read_addr_ptr (dev);#endif return 0 ;
Signature · 1 line
2.1.4
PATCH v2 11/19 rockchip: pinctrl: rk3368: Convert to livetree
In reply to Philipp TomsichUpdate the pinctrl driver for the RK3368 to support a live device tree.
---
Changes in v2: None
drivers/pinctrl/rockchip/pinctrl_rk3368.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/pinctrl/rockchip/pinctrl_rk3368.c +1 -2
@@ -632,8 +632,7 @@ static int rk3368_pinctrl_get_periph_id(struct udevice *dev,u32 cell[3 ];int ret; - ret =fdtdec_get_int_array (gd->fdt_blob,dev_of_offset (periph), -"interrupts" , cell,ARRAY_SIZE (cell)); + ret =dev_read_u32_array (periph,"interrupts" , cell,ARRAY_SIZE (cell));if (ret <0 )return -EINVAL ;
Signature · 1 line
2.1.4
PATCH v2 12/19 rockchip: spi: Convert to livetree
In reply to Philipp TomsichUpdate the Rockchip SPI driver to support a live device tree.
---
Changes in v2: None
drivers/spi/rk_spi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/spi/rk_spi.c +1 -1
@@ -184,7 +184,7 @@ static int rockchip_spi_ofdata_to_platdata(struct udevice *bus)struct rockchip_spi_priv *priv =dev_get_priv (bus);int ret; - plat->base =devfdt_get_addr (bus); + plat->base =dev_read_addr (bus); ret =clk_get_by_index (bus,0 , &priv->clk);if (ret <0 ) {
Signature · 1 line
2.1.4
PATCH v2 12/19 rockchip: spi: Convert to livetree
Quoted 5 lines · Philipp Tomsich
Update the Rockchip SPI driver to support a live device tree.
Signed-off-by Philipp Tomsich <[email protected]>Reviewed-by Simon Glass <[email protected]>Acked-by Philipp Tomsich <[email protected]>
thanks!
Signature · 4 lines
Jagan Teki Free Software Engineer | www.openedev.com U-Boot, Linux | Upstream Maintainer Hyderabad, India.
PATCH v2 13/19 rockchip: sdhci: Convert to livetree
In reply to Philipp TomsichUpdate the Rockchip SDHCI wrapper to support a live device tree.
Version-changes: 2
- use the dev_read_addr_ptr function in rockchip_sdhci.c
---
Changes in v2: None
drivers/mmc/rockchip_sdhci.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/mmc/rockchip_sdhci.c +1 -2
@@ -9,7 +9,6 @@#include <common.h> #include <dm.h> #include <dt-structs.h> -#include <fdtdec.h> #include <libfdt.h> #include <malloc.h> #include <mapmem.h>
@@ -82,7 +81,7 @@ static int arasan_sdhci_ofdata_to_platdata(struct udevice *dev)struct sdhci_host *host =dev_get_priv (dev); host->name = dev->name; - host->ioaddr =devfdt_get_addr_ptr (dev); + host->ioaddr =dev_read_addr_ptr (dev);#endif return 0 ;
Signature · 1 line
2.1.4
PATCH v2 14/19 rockchip: rk8xx: remove unused header includes
In reply to Philipp TomsichRemove header file includes that have been left over after the conversion to livetree-support.
---
Changes in v2: None
drivers/power/pmic/rk8xx.c | 2 -- 1 file changed, 2 deletions(-)
drivers/power/pmic/rk8xx.c +0 -2
@@ -8,8 +8,6 @@#include <common.h> #include <dm.h> #include <errno.h> -#include <fdtdec.h> -#include <libfdt.h> #include <power/rk8xx_pmic.h> #include <power/pmic.h>
Signature · 1 line
2.1.4
PATCH v2 15/19 rockchip: i2c: Convert to livetree
In reply to Philipp TomsichUpdate the Rockchip I2C driver to support livetree.
Version-changes: 2
- use the dev_read_addr_ptr function in rk_i2c.c
---
Changes in v2: None
drivers/i2c/rk_i2c.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/i2c/rk_i2c.c +1 -1
@@ -382,7 +382,7 @@ static int rockchip_i2c_probe(struct udevice *bus) {struct rk_i2c *priv =dev_get_priv (bus); - priv->regs = (void *)devfdt_get_addr (bus); + priv->regs =dev_read_addr_ptr (bus);return 0 ; }
Signature · 1 line
2.1.4
PATCH v2 15/19 rockchip: i2c: Convert to livetree
Hello Philipp,
Am 11.09.2017 um 11:18 schrieb Philipp Tomsich:
Quoted 9 lines
Update the Rockchip I2C driver to support livetree.
Signed-off-by Philipp Tomsich <[email protected]>Reviewed-by Simon Glass <[email protected]>Acked-by Philipp Tomsich <[email protected]>Version-changes: 2
- use thedev_read_addr_ptrfunction inrk_i2c.c
Quoted 6 lines
---
Changes in v2: None
drivers/i2c/rk_i2c.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
bye,
Heiko
Signature · 3 lines
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-52 Fax: +49-8142-66989-80 Email: hs at denx.de
PATCH v2 15/19 rockchip: i2c: Convert to livetree
In reply to Philipp TomsichQuoted 9 lines · Philipp Tomsich
Update the Rockchip I2C driver to support livetree.
Signed-off-by Philipp Tomsich <[email protected]>Reviewed-by Simon Glass <[email protected]>Acked-by Philipp Tomsich <[email protected]>Version-changes: 2
- use thedev_read_addr_ptrfunction inrk_i2c.c
Quoted 6 lines
---
Changes in v2: None
drivers/i2c/rk_i2c.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
PATCH v2 16/19 rockchip: gpio: convert to livetree
In reply to Philipp TomsichUpdate the Rockchip GPIO-bank driver to support a live tree.
Version-changes: 2
- use the dev_read_addr_ptr function in rk_gpio.c
---
Changes in v2: None
drivers/gpio/rk_gpio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpio/rk_gpio.c +1 -1
@@ -104,7 +104,7 @@ static int rockchip_gpio_probe(struct udevice *dev)int ret;/* This only supports RK3288 at present */ - priv->regs = (struct rockchip_gpio_regs *)devfdt_get_addr (dev); + priv->regs =dev_read_addr_ptr (dev); ret =uclass_first_device_err (UCLASS_PINCTRL , &priv->pinctrl);if (ret)return ret;
Signature · 1 line
2.1.4
PATCH v2 17/19 rockchip: gpio: remove outdated/misleading comment
In reply to Philipp TomsichRemove a comment claiming that this driver only supports the RK3288, as we also use it on the RK3368, RK3399 and (most likely) on other variants.
Version-changes: 2
- use the dev_read_addr_ptr function in rk_gpio.c
---
Changes in v2: None
drivers/gpio/rk_gpio.c | 1 - 1 file changed, 1 deletion(-)
drivers/gpio/rk_gpio.c +0 -1
@@ -103,7 +103,6 @@ static int rockchip_gpio_probe(struct udevice *dev)char *end;int ret; -/* This only supports RK3288 at present */ priv->regs =dev_read_addr_ptr (dev); ret =uclass_first_device_err (UCLASS_PINCTRL , &priv->pinctrl);if (ret)
Signature · 1 line
2.1.4
PATCH v2 18/19 rockchip: dts: rk3368-lion: add /chosen/tick-timer
In reply to Philipp TomsichTo support bootstage recording, we want to mark our DM timer as the tick-timer; this triggers the support for 'trying harder' to read the timer in the Rockchip DM timer driver, even if the device model isn't ready yet.
---
Changes in v2: None
arch/arm/dts/rk3368-lion-u-boot.dtsi | 2 ++ 1 file changed, 2 insertions(+)
arch/arm/dts/rk3368-lion-u-boot.dtsi +2 -0
@@ -13,6 +13,7 @@ chosen { stdout-path = "serial0:115200n8"; u-boot,spl-boot-order = &emmc, &sdmmc; + tick-timer = "/timer at ff810000"; }; };
@@ -88,6 +89,7 @@ &timer0 { u-boot,dm-pre-reloc; clock-frequency = <24000000>; + status = "okay"; };
Signature · 1 line
2.1.4
PATCH v2 19/19 rockchip: lion-rk3368: defconfig: resync w/ OF_LIVE and BOOTSTAGE enabled
In reply to Philipp TomsichThis adds OF_LIVE and BOOTSTAGE support for the RK3368-uQ7 and regenerates the defconfig (picking up a few changes/reorderings) from upstream Kconfig changes.
---
Changes in v2: None
configs/lion-rk3368_defconfig | 7 +++++++ 1 file changed, 7 insertions(+)
configs/lion-rk3368_defconfig +7 -0
@@ -19,6 +19,11 @@ CONFIG_FIT=y CONFIG_FIT_VERBOSE=y CONFIG_SPL_LOAD_FIT=y CONFIG_SPL_FIT_SOURCE="board/theobroma-systems/lion_rk3368/fit_spl_atf.its" +CONFIG_BOOTSTAGE=y +CONFIG_SPL_BOOTSTAGE=y +CONFIG_BOOTSTAGE_REPORT=y +CONFIG_BOOTSTAGE_FDT=y +CONFIG_ENV_IS_IN_MMC=y # CONFIG_DISPLAY_CPUINFO is not set CONFIG_ARCH_EARLY_INIT_R=y CONFIG_SPL=y
@@ -37,10 +42,12 @@ CONFIG_TPL_DRIVERS_MISC_SUPPORT=y CONFIG_CMD_GPIO=y CONFIG_CMD_MMC=y CONFIG_CMD_SF=y +CONFIG_CMD_BOOTSTAGE=y CONFIG_CMD_REGULATOR=y CONFIG_CMD_MTDPARTS=y CONFIG_SPL_OF_CONTROL=y CONFIG_TPL_OF_CONTROL=y +CONFIG_OF_LIVE=y CONFIG_OF_SPL_REMOVE_PROPS="pinctrl-0 pinctrl-names interrupt-parent" CONFIG_TPL_OF_PLATDATA=y CONFIG_ENV_IS_IN_MMC=y
Signature · 1 line
2.1.4