From: Wadim Egorov <w.egorov@phytec.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 18/35] rockchip: rk3288-phycore: move phycore_init() to its own board file
Date: Tue, 23 Jul 2019 12:36:37 +0200 [thread overview]
Message-ID: <dd798030-7130-9513-e015-d55f9df9276d@phytec.de> (raw)
In-Reply-To: <20190722115942.24962-19-kever.yang@rock-chips.com>
Hi Kever,
this is fine for me. You can drop the phycore_init() code completely. No
need to carry this around in our board code.
The SOM was redesigned and is equipped with an STM8 connected to the
RK818. The required setup we did before in the SPL is now done by the ST
controller. I know there are only a few SOMs without the STM8 out in the
wild. So if you remove it it will affect only a few people who probably
already have both boards.
Thanks,
Wadim
On 22.07.19 13:59, Kever Yang wrote:
> phycore_init() is use for phycore board only, it should be move back
> to phycore-rk3288.c
>
> Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
> ---
>
> arch/arm/mach-rockchip/rk3288-board-spl.c | 39 ----------------
> arch/arm/mach-rockchip/rk3288/Kconfig | 1 +
> board/phytec/phycore_rk3288/phycore-rk3288.c | 47 ++++++++++++++++++++
> 3 files changed, 48 insertions(+), 39 deletions(-)
>
> diff --git a/arch/arm/mach-rockchip/rk3288-board-spl.c b/arch/arm/mach-rockchip/rk3288-board-spl.c
> index 6db5369a10..13cd86079b 100644
> --- a/arch/arm/mach-rockchip/rk3288-board-spl.c
> +++ b/arch/arm/mach-rockchip/rk3288-board-spl.c
> @@ -25,8 +25,6 @@
> #include <dm/root.h>
> #include <dm/test.h>
> #include <dm/util.h>
> -#include <power/regulator.h>
> -#include <power/rk8xx_pmic.h>
>
> DECLARE_GLOBAL_DATA_PTR;
>
> @@ -81,32 +79,6 @@ fallback:
> return BOOT_DEVICE_MMC1;
> }
>
> -#if !defined(CONFIG_SPL_OF_PLATDATA)
> -static int phycore_init(void)
> -{
> - struct udevice *pmic;
> - int ret;
> -
> - ret = uclass_first_device_err(UCLASS_PMIC, &pmic);
> - if (ret)
> - return ret;
> -
> -#if defined(CONFIG_SPL_POWER_SUPPORT)
> - /* Increase USB input current to 2A */
> - ret = rk818_spl_configure_usb_input_current(pmic, 2000);
> - if (ret)
> - return ret;
> -
> - /* Close charger when USB lower then 3.26V */
> - ret = rk818_spl_configure_usb_chrg_shutdown(pmic, 3260000);
> - if (ret)
> - return ret;
> -#endif
> -
> - return 0;
> -}
> -#endif
> -
> __weak int arch_cpu_init(void)
> {
> return 0;
> @@ -175,17 +147,6 @@ void board_init_f(ulong dummy)
> return;
> }
>
> -#if !defined(CONFIG_SPL_OF_PLATDATA)
> - if (of_machine_is_compatible("phytec,rk3288-phycore-som")) {
> - ret = phycore_init();
> - if (ret) {
> - debug("Failed to set up phycore power settings: %d\n",
> - ret);
> - return;
> - }
> - }
> -#endif
> -
> #if !defined(CONFIG_SUPPORT_TPL)
> debug("\nspl:init dram\n");
> ret = uclass_get_device(UCLASS_RAM, 0, &dev);
> diff --git a/arch/arm/mach-rockchip/rk3288/Kconfig b/arch/arm/mach-rockchip/rk3288/Kconfig
> index 6e3ab1d06b..87d0786ba8 100644
> --- a/arch/arm/mach-rockchip/rk3288/Kconfig
> +++ b/arch/arm/mach-rockchip/rk3288/Kconfig
> @@ -85,6 +85,7 @@ config TARGET_MIQI_RK3288
> config TARGET_PHYCORE_RK3288
> bool "phyCORE-RK3288"
> select BOARD_LATE_INIT
> + select SPL_BOARD_INIT if SPL
> help
> Add basic support for the PCM-947 carrier board, a RK3288 based
> development board made by PHYTEC. This board works in a combination
> diff --git a/board/phytec/phycore_rk3288/phycore-rk3288.c b/board/phytec/phycore_rk3288/phycore-rk3288.c
> index ffe1833b06..fbf1511978 100644
> --- a/board/phytec/phycore_rk3288/phycore-rk3288.c
> +++ b/board/phytec/phycore_rk3288/phycore-rk3288.c
> @@ -8,10 +8,13 @@
> #include <common.h>
> #include <dm.h>
> #include <environment.h>
> +#include <fdtdec.h>
> #include <i2c.h>
> #include <i2c_eeprom.h>
> #include <netdev.h>
> #include "som.h"
> +#include <power/regulator.h>
> +#include <power/rk8xx_pmic.h>
>
> static int valid_rk3288_som(struct rk3288_som *som)
> {
> @@ -68,3 +71,47 @@ int rk_board_late_init(void)
>
> return 0;
> }
> +
> +#ifdef CONFIG_SPL_BUILD
> +#if !defined(CONFIG_SPL_OF_PLATDATA)
> +static int phycore_init(void)
> +{
> + struct udevice *pmic;
> + int ret;
> +
> + ret = uclass_first_device_err(UCLASS_PMIC, &pmic);
> + if (ret)
> + return ret;
> +
> +#if defined(CONFIG_SPL_POWER_SUPPORT)
> + /* Increase USB input current to 2A */
> + ret = rk818_spl_configure_usb_input_current(pmic, 2000);
> + if (ret)
> + return ret;
> +
> + /* Close charger when USB lower then 3.26V */
> + ret = rk818_spl_configure_usb_chrg_shutdown(pmic, 3260000);
> + if (ret)
> + return ret;
> +#endif
> +
> + return 0;
> +}
> +#endif
> +
> +void spl_board_init(void)
> +{
> +#if !defined(CONFIG_SPL_OF_PLATDATA)
> + int ret;
> +
> + if (of_machine_is_compatible("phytec,rk3288-phycore-som")) {
> + ret = phycore_init();
> + if (ret) {
> + debug("Failed to set up phycore power settings: %d\n",
> + ret);
> + return;
> + }
> + }
> +#endif
> +}
> +#endif
next prev parent reply other threads:[~2019-07-23 10:36 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-22 11:59 [U-Boot] [PATCH 00/35] rockchip: Migrate to use common SPL board file Kever Yang
2019-07-22 11:59 ` [U-Boot] [PATCH 01/35] rockchip: remove redundant CONFIG_SYS_NS16550_MEM32 Kever Yang
2019-07-22 11:59 ` [U-Boot] [PATCH 02/35] rockchip: add CONFIG_IRAM_BASE for all SoCs Kever Yang
2019-07-22 11:59 ` [U-Boot] [PATCH 03/35] rockchip: intruduce common BROM_BOOTSOURCE_ID_ADDR Kever Yang
2019-07-22 11:59 ` [U-Boot] [PATCH 04/35] rockchip: declear boot_devices in bootrom.h Kever Yang
2019-07-22 11:59 ` [U-Boot] [PATCH 05/35] rockchip: add common spl board file Kever Yang
2019-07-22 11:59 ` [U-Boot] [PATCH 06/35] rockchip: rk3188: init CPU freq in clock driver Kever Yang
2019-07-22 11:59 ` [U-Boot] [PATCH 07/35] rockchip: rk3188: move usb uart init into arch_cpu_init() Kever Yang
2019-07-22 11:59 ` [U-Boot] [PATCH 08/35] rockchip: Migrate to use BOOTROM_SUPPORT driver Kever Yang
2019-07-22 11:59 ` [U-Boot] [PATCH 09/35] rockchip: rk3188: move spl_board_init() into rk3188.c Kever Yang
2019-07-22 11:59 ` [U-Boot] [PATCH 10/35] rockchip: rk3188: add boot_devices mapping to support 'same-as-spl' Kever Yang
2019-07-22 11:59 ` [U-Boot] [PATCH 11/35] rockchip: rk3188: migrate to use common spl board file Kever Yang
2019-07-22 11:59 ` [U-Boot] [PATCH 12/35] rockchip: rk322x: introduce arch_cpu_init() for SoC setting init Kever Yang
2019-07-22 11:59 ` [U-Boot] [PATCH 13/35] rockchip: rk322x: migrate to use common spl board file Kever Yang
2019-07-22 11:59 ` [U-Boot] [PATCH 14/35] rockchip: rk322x: add boot_devices mapping to support 'same-as-spl' Kever Yang
2019-07-22 11:59 ` [U-Boot] [PATCH 15/35] rockchip: fit_spl_optee: rockchip: fix warning unit_address_vs_reg Kever Yang
2019-07-22 11:59 ` [U-Boot] [PATCH 16/35] rockchip: rk3288: show SPL BANNER earlier in board_init_f() Kever Yang
2019-07-22 11:59 ` [U-Boot] [PATCH 17/35] rockchip: rk3288: move setup_led() to firefly-rk3288 Kever Yang
2019-07-22 11:59 ` [U-Boot] [PATCH 18/35] rockchip: rk3288-phycore: move phycore_init() to its own board file Kever Yang
2019-07-23 10:36 ` Wadim Egorov [this message]
2019-07-22 11:59 ` [U-Boot] [PATCH 19/35] rockchip: rk3288: move dram_init_banksize() into soc file Kever Yang
2019-07-22 11:59 ` [U-Boot] [PATCH 20/35] rockchip: rk3288: Migrate to use common spl board file Kever Yang
2019-07-22 11:59 ` [U-Boot] [PATCH 21/35] rockchip: phycore: remove no use "u-boot, boot0" in dts Kever Yang
2019-07-22 11:59 ` [U-Boot] [PATCH 22/35] rockchip: rk3288-veyron: Migrate "u-boot, boot0" to "u-boot, spl-boot-order" Kever Yang
2019-07-22 11:59 ` [U-Boot] [PATCH 23/35] rockchip: rk3288: add boot_devices mapping to support 'same-as-spl' Kever Yang
2019-07-22 11:59 ` [U-Boot] [PATCH 24/35] rockchip: rk3328: add STIMER_BASE definition Kever Yang
2019-07-22 11:59 ` [U-Boot] [PATCH 25/35] rockchip: rk3328: migrate to use common spl board file Kever Yang
2019-07-22 11:59 ` [U-Boot] [PATCH 26/35] rockchip: rk3328: add boot_devices mapping to support 'same-as-spl' Kever Yang
2019-07-22 11:59 ` [U-Boot] [PATCH 27/35] rockchip: rk3368: migrate to use common spl board file Kever Yang
2019-07-22 11:59 ` [U-Boot] [PATCH 28/35] rockchip: rk3368: add boot_devices mapping to support 'same-as-spl' Kever Yang
2019-07-22 11:59 ` [U-Boot] [PATCH 29/35] rockchip: rk3399: move spl_perform_fixups() into soc file Kever Yang
2019-07-22 11:59 ` [U-Boot] [PATCH 30/35] rockchip: rk3399: show SPL BANNER earlier in board_init_f() Kever Yang
2019-07-22 11:59 ` [U-Boot] [PATCH 31/35] rockchip: rk3399: move SoC setting into arch_cpu_init() Kever Yang
2019-07-22 11:59 ` [U-Boot] [PATCH 32/35] rockchip: rk3399; move spl_board_init() into soc file Kever Yang
2019-07-22 11:59 ` [U-Boot] [PATCH 33/35] rockchip: rk3399: move boot_devices " Kever Yang
2019-07-22 11:59 ` [U-Boot] [PATCH 34/35] rockchip: rk3399: move chromebook bob specific flow to its board file Kever Yang
2019-07-22 11:59 ` [U-Boot] [PATCH 35/35] rockchip: rk3399: Migrate to use common spl " Kever Yang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=dd798030-7130-9513-e015-d55f9df9276d@phytec.de \
--to=w.egorov@phytec.de \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox