[PATCH V4 6/7] board: rockchip: Add support for new boards to RGxx3

Kever Yang kever.yang at rock-chips.com
Thu Jan 18 08:21:27 CET 2024


On 2024/1/2 23:46, Chris Morgan wrote:
> From: Chris Morgan <macromorgan at hotmail.com>
>
> Add support for the Anbernic RG-ARC-D, Anbernic RG-ARC-S, Powkiddy
> RK2023, and Powkiddy RGB30 to the Anbernic RGxx3. While the Powkiddy
> devices are manufactured by Powkiddy instead of Anbernic,
> the hardware is so similar they can all use the same bootloader.
>
> Signed-off-by: Chris Morgan <macromorgan at hotmail.com>
Reviewed-by: Kever Yang <kever.yang at rock-chips.com>

Thanks,
- Kever
> ---
>   board/anbernic/rgxx3_rk3566/rgxx3-rk3566.c | 44 +++++++++++++++++++---
>   1 file changed, 39 insertions(+), 5 deletions(-)
>
> diff --git a/board/anbernic/rgxx3_rk3566/rgxx3-rk3566.c b/board/anbernic/rgxx3_rk3566/rgxx3-rk3566.c
> index 7bef5a53f0..e12a85a02a 100644
> --- a/board/anbernic/rgxx3_rk3566/rgxx3-rk3566.c
> +++ b/board/anbernic/rgxx3_rk3566/rgxx3-rk3566.c
> @@ -48,9 +48,13 @@ enum rgxx3_device_id {
>   	RG353P,
>   	RG353V,
>   	RG503,
> +	RGB30,
> +	RK2023,
> +	RGARCD,
>   	/* Devices with duplicate ADC value */
>   	RG353PS,
>   	RG353VS,
> +	RGARCS,
>   };
>   
>   static const struct rg3xx_model rg3xx_model_details[] = {
> @@ -83,6 +87,27 @@ static const struct rg3xx_model rg3xx_model_details[] = {
>   		.fdtfile = DTB_DIR "rk3566-anbernic-rg503.dtb",
>   		.detect_panel = 0,
>   	},
> +	[RGB30] = {
> +		.adc_value = 383, /* Gathered from second hand information */
> +		.board = "rk3566-powkiddy-rgb30",
> +		.board_name = "RGB30",
> +		.fdtfile = DTB_DIR "rk3566-powkiddy-rgb30.dtb",
> +		.detect_panel = 0,
> +	},
> +	[RK2023] = {
> +		.adc_value = 635, /* Observed average from device */
> +		.board = "rk3566-powkiddy-rk2023",
> +		.board_name = "RK2023",
> +		.fdtfile = DTB_DIR "rk3566-powkiddy-rk2023.dtb",
> +		.detect_panel = 0,
> +	},
> +	[RGARCD] = {
> +		.adc_value = 183, /* Observed average from device */
> +		.board = "rk3566-anbernic-rg-arc-d",
> +		.board_name = "Anbernic RG ARC-D",
> +		.fdtfile = DTB_DIR "rk3566-anbernic-rg-arc-d.dtb",
> +		.detect_panel = 0,
> +	},
>   	/* Devices with duplicate ADC value */
>   	[RG353PS] = {
>   		.adc_value = 860, /* Observed average from device */
> @@ -98,6 +123,13 @@ static const struct rg3xx_model rg3xx_model_details[] = {
>   		.fdtfile = DTB_DIR "rk3566-anbernic-rg353vs.dtb",
>   		.detect_panel = 1,
>   	},
> +	[RGARCS] = {
> +		.adc_value = 183, /* Observed average from device */
> +		.board = "rk3566-anbernic-rg-arc-s",
> +		.board_name = "Anbernic RG ARC-S",
> +		.fdtfile = DTB_DIR "rk3566-anbernic-rg-arc-s.dtb",
> +		.detect_panel = 0,
> +	},
>   };
>   
>   struct rg353_panel {
> @@ -332,19 +364,21 @@ int rgxx3_detect_device(void)
>   	}
>   
>   	/*
> -	 * Try to access the eMMC on an RG353V or RG353P. If it's
> -	 * missing, it's an RG353VS or RG353PS. Note we could also
> -	 * check for a touchscreen at 0x1a on i2c2.
> +	 * Try to access the eMMC on an RG353V, RG353P, or RG Arc D.
> +	 * If it's missing, it's an RG353VS, RG353PS, or RG Arc S.
> +	 * Note we could also check for a touchscreen at 0x1a on i2c2.
>   	 */
> -	if (board_id == RG353V || board_id == RG353P) {
> +	if (board_id == RG353V || board_id == RG353P || board_id == RGARCD) {
>   		mmc = find_mmc_device(0);
>   		if (mmc) {
>   			ret = mmc_init(mmc);
>   			if (ret) {
>   				if (board_id == RG353V)
>   					board_id = RG353VS;
> -				else
> +				else if (board_id == RG353P)
>   					board_id = RG353PS;
> +				else
> +					board_id = RGARCS;
>   			}
>   		}
>   	}


More information about the U-Boot mailing list