From patchwork Mon Mar 29 03:04:48 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dillon Min X-Patchwork-Id: 1459571 X-Patchwork-Delegate: patrice.chotard@st.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=iAWX+xB2; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4F8BB91RDpz9sR4 for ; Mon, 29 Mar 2021 23:06:09 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 2DF84828E6; Mon, 29 Mar 2021 14:05:41 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="iAWX+xB2"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id E4060828A1; Mon, 29 Mar 2021 05:05:17 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pj1-x1030.google.com (mail-pj1-x1030.google.com [IPv6:2607:f8b0:4864:20::1030]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 51FD482898 for ; Mon, 29 Mar 2021 05:05:12 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=dillon.minfei@gmail.com Received: by mail-pj1-x1030.google.com with SMTP id w8so5319428pjf.4 for ; Sun, 28 Mar 2021 20:05:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Z9EnFiqGWDWVadlqINa4zBP4l9S8wL0sHEJzlTVWQCQ=; b=iAWX+xB27RgpHuRLYO+R4v+Bqwb128O3xMvLVXu1emmmVPgNO5REsAywBLmwBywNpG Q1yFXnQIf2kyXYVB3asHSTAv7ABo0X43yvq4FEk88Ae9851godtLeqLzkmN9G2uXytqw iXvVEfrEqtdPZ6V8nzYpCGGbKnLJ/7bi+p4wo7hQpYxFTpIe+Nvj9ZeMoUmUo9TNkigK A0TH6OVlzRHvdJsvZjS/kpU625id//geuHKlz0bHLyK4mKJ6FSKuQobTSHibcHcswwcp InxQlwIImzIS+nSjxoQYvVXHwS3Xy/tQD9YUiXqQdlxR3dymvmMTAWUF/KLPueqP+4go mLDg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Z9EnFiqGWDWVadlqINa4zBP4l9S8wL0sHEJzlTVWQCQ=; b=TlEOho6LVbs3GnqStVe98vU4ala394Qe68ll8R9yYl0Os84fei9bfe6sngLA9Ly0La EhXHVVqDVMMDAflgyzBgHszUhSdXTfwgixv/vqcKqhe9rKZsFFVVPIlyrEvWk+ZqMCF3 +7Y8XM7W5nDyEi6d48CR+9GTeIqm6FKl17iaDtuk6ZBPSEYT3phKLRfPrkhioFZq6bDx i3Ic0em16D1s7b/6IxWNKOU1gZudBgAEw0TXb9jseeNR/1injv/pxQSM+UrpktIuP2Fj RjOBaY8NkWYKmpLn5HlcsDK1wvrSXnA1VoHbNPiqE0myW/y2JEK7/QgvRgqPIvKGal4g e8Bw== X-Gm-Message-State: AOAM532yELQjxE1AnjMVKooTxc91GVDoWdS/TkwmNBtpV9hnP1V71k0b S/i/sLF/ntCNIKyfNHmC72I= X-Google-Smtp-Source: ABdhPJwO6R7C0BqYj4Fb7sJrpPevqdtPiT9TOXNYqbRDODCkOw74jl7V/uWHMI6wPPUWtDnHWBEc0Q== X-Received: by 2002:a17:902:9303:b029:e6:f010:a5f9 with SMTP id bc3-20020a1709029303b02900e6f010a5f9mr26986815plb.9.1616987110573; Sun, 28 Mar 2021 20:05:10 -0700 (PDT) Received: from fmin-OptiPlex-7060.nreal.work ([137.59.103.165]) by smtp.gmail.com with ESMTPSA id a204sm15331914pfd.106.2021.03.28.20.05.06 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 28 Mar 2021 20:05:10 -0700 (PDT) From: dillon.minfei@gmail.com To: kever.yang@rock-chips.com, andre.przywara@arm.com, priyanka.jain@nxp.com, jagan@amarulasolutions.com, narmstrong@baylibre.com, marex@denx.de, aford173@gmail.com, ioana.ciornei@nxp.com, josip.kelecic@sartura.hr, festevam@gmail.com, hs@denx.de, heiko.stuebner@theobroma-systems.com, u-boot@lists.denx.de, patrice.chotard@foss.st.com, patrick.delaunay@foss.st.com, uboot-stm32@st-md-mailman.stormreply.com Cc: dillon min Subject: [PATCH v3 3/6] board: Add rt-thread art-pi board support Date: Mon, 29 Mar 2021 11:04:48 +0800 Message-Id: <1616987091-3432-4-git-send-email-dillon.minfei@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1616987091-3432-1-git-send-email-dillon.minfei@gmail.com> References: <1616987091-3432-1-git-send-email-dillon.minfei@gmail.com> X-Mailman-Approved-At: Mon, 29 Mar 2021 14:05:30 +0200 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.4 at phobos.denx.de X-Virus-Status: Clean From: dillon min This patch adds support for rt-thread art-pi board. for more information about art-pi, please goto: https://art-pi.gitee.io/website/ Signed-off-by: dillon min --- v3: no changes arch/arm/mach-stm32/stm32h7/Kconfig | 4 ++ board/st/stm32h750-art-pi/Kconfig | 19 +++++++++ board/st/stm32h750-art-pi/MAINTAINERS | 7 ++++ board/st/stm32h750-art-pi/Makefile | 6 +++ board/st/stm32h750-art-pi/stm32h750-art-pi.c | 58 ++++++++++++++++++++++++++++ configs/stm32h750-art-pi_defconfig | 51 ++++++++++++++++++++++++ include/configs/stm32h750-art-pi.h | 48 +++++++++++++++++++++++ 7 files changed, 193 insertions(+) create mode 100644 board/st/stm32h750-art-pi/Kconfig create mode 100644 board/st/stm32h750-art-pi/MAINTAINERS create mode 100644 board/st/stm32h750-art-pi/Makefile create mode 100644 board/st/stm32h750-art-pi/stm32h750-art-pi.c create mode 100644 configs/stm32h750-art-pi_defconfig create mode 100644 include/configs/stm32h750-art-pi.h diff --git a/arch/arm/mach-stm32/stm32h7/Kconfig b/arch/arm/mach-stm32/stm32h7/Kconfig index 55e6217..70233a4 100644 --- a/arch/arm/mach-stm32/stm32h7/Kconfig +++ b/arch/arm/mach-stm32/stm32h7/Kconfig @@ -6,7 +6,11 @@ config TARGET_STM32H743_DISCO config TARGET_STM32H743_EVAL bool "STM32H743 Evaluation board" +config TARGET_STM32H750_ART_PI + bool "STM32H750 ART Pi board" + source "board/st/stm32h743-eval/Kconfig" source "board/st/stm32h743-disco/Kconfig" +source "board/st/stm32h750-art-pi/Kconfig" endif diff --git a/board/st/stm32h750-art-pi/Kconfig b/board/st/stm32h750-art-pi/Kconfig new file mode 100644 index 0000000..c31b984 --- /dev/null +++ b/board/st/stm32h750-art-pi/Kconfig @@ -0,0 +1,19 @@ +if TARGET_STM32H750_ART_PI + +config SYS_BOARD + string + default "stm32h750-art-pi" + +config SYS_VENDOR + string + default "st" + +config SYS_SOC + string + default "stm32h7" + +config SYS_CONFIG_NAME + string + default "stm32h750-art-pi" + +endif diff --git a/board/st/stm32h750-art-pi/MAINTAINERS b/board/st/stm32h750-art-pi/MAINTAINERS new file mode 100644 index 0000000..9578833 --- /dev/null +++ b/board/st/stm32h750-art-pi/MAINTAINERS @@ -0,0 +1,7 @@ +STM32H750 ART PI BOARD +M: Dillon Min +S: Maintained +F: board/st/stm32h750-art-pi +F: include/configs/stm32h750-art-pi.h +F: configs/stm32h750-art-pi_defconfig +F: arch/arm/dts/stm32h7* diff --git a/board/st/stm32h750-art-pi/Makefile b/board/st/stm32h750-art-pi/Makefile new file mode 100644 index 0000000..a06de87 --- /dev/null +++ b/board/st/stm32h750-art-pi/Makefile @@ -0,0 +1,6 @@ +# SPDX-License-Identifier: GPL-2.0+ +# +# Copyright (C) 2021, RT-Thread - All Rights Reserved +# Author(s): Dillon Min, for RT-Thread. + +obj-y := stm32h750-art-pi.o diff --git a/board/st/stm32h750-art-pi/stm32h750-art-pi.c b/board/st/stm32h750-art-pi/stm32h750-art-pi.c new file mode 100644 index 0000000..c374dd3 --- /dev/null +++ b/board/st/stm32h750-art-pi/stm32h750-art-pi.c @@ -0,0 +1,58 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright (C) 2021, STMicroelectronics - All Rights Reserved + * Author(s): Dillon Min for STMicroelectronics. + */ + +#include +#include +#include +#include +#include + +DECLARE_GLOBAL_DATA_PTR; + +int dram_init(void) +{ + struct udevice *dev; + int ret; + + ret = uclass_get_device(UCLASS_RAM, 0, &dev); + if (ret) { + debug("DRAM init failed: %d\n", ret); + return ret; + } + + if (fdtdec_setup_mem_size_base() != 0) + ret = -EINVAL; + + return ret; +} + +int dram_init_banksize(void) +{ + fdtdec_setup_memory_banksize(); + + return 0; +} + +int board_early_init_f(void) +{ + return 0; +} + +u32 get_board_rev(void) +{ + return 0; +} + +int board_late_init(void) +{ + return 0; +} + +int board_init(void) +{ + gd->bd->bi_boot_params = gd->bd->bi_dram[0].start + 0x100; + return 0; +} diff --git a/configs/stm32h750-art-pi_defconfig b/configs/stm32h750-art-pi_defconfig new file mode 100644 index 0000000..a5c4cd7 --- /dev/null +++ b/configs/stm32h750-art-pi_defconfig @@ -0,0 +1,51 @@ +CONFIG_ARM=y +CONFIG_ARCH_STM32=y +CONFIG_SYS_TEXT_BASE=0x90000000 +CONFIG_SYS_MALLOC_F_LEN=0xF00 +CONFIG_NR_DRAM_BANKS=1 +CONFIG_ENV_SIZE=0x2000 +CONFIG_STM32H7=y +CONFIG_TARGET_STM32H750_ART_PI=y +CONFIG_DEFAULT_DEVICE_TREE="stm32h750i-art-pi" +CONFIG_DISTRO_DEFAULTS=y +CONFIG_BOOTDELAY=3 +CONFIG_AUTOBOOT_KEYED=y +CONFIG_AUTOBOOT_PROMPT="Hit SPACE in %d seconds to stop autoboot.\n" +CONFIG_AUTOBOOT_STOP_STR=" " +# CONFIG_USE_BOOTCOMMAND is not set +CONFIG_DEFAULT_FDT_FILE="stm32h750i-art-pi" +# CONFIG_DISPLAY_CPUINFO is not set +CONFIG_BOARD_EARLY_INIT_F=y +CONFIG_BOARD_LATE_INIT=y +CONFIG_SYS_PROMPT="U-Boot > " +CONFIG_CMD_GPT=y +CONFIG_CMD_MMC=y +# CONFIG_CMD_SETEXPR is not set +CONFIG_CMD_CACHE=y +CONFIG_CMD_TIMER=y +CONFIG_CMD_EXT4_WRITE=y +# CONFIG_ISO_PARTITION is not set +CONFIG_OF_CONTROL=y +CONFIG_SYS_RELOC_GD_ENV_ADDR=y +# CONFIG_NET is not set +CONFIG_DM_MMC=y +CONFIG_STM32_SDMMC2=y +# CONFIG_PINCTRL_FULL is not set +CONFIG_OF_LIBFDT_OVERLAY=y +CONFIG_BAUDRATE=2000000 +CONFIG_USE_BOOTARGS=y +CONFIG_BOOTARGS="console=ttySTM0,2000000 root=/dev/ram rdinit=/linuxrc loglevel=8" +CONFIG_BOOTCOMMAND="bootm 90080000" +CONFIG_REQUIRE_SERIAL_CONSOLE=y +CONFIG_SERIAL_PRESENT=y +CONFIG_DM_SERIAL=y +CONFIG_STM32_SERIAL=y +CONFIG_FIT=y +CONFIG_FIT_EXTERNAL_OFFSET=0x0 +CONFIG_FIT_ENABLE_SHA256_SUPPORT=y +CONFIG_FIT_FULL_CHECK=y +CONFIG_FIT_PRINT=y +CONFIG_LEGACY_IMAGE_FORMAT=y +CONFIG_SUPPORT_RAW_INITRD=y +CONFIG_USE_BOOTCOMMAND=y +CONFIG_DM_DMA=y diff --git a/include/configs/stm32h750-art-pi.h b/include/configs/stm32h750-art-pi.h new file mode 100644 index 0000000..43dc79a --- /dev/null +++ b/include/configs/stm32h750-art-pi.h @@ -0,0 +1,48 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* + * Copyright (C) 2021, STMicroelectronics - All Rights Reserved + * Author(s): Dillon Min for STMicroelectronics. + */ + +#ifndef __CONFIG_H +#define __CONFIG_H + +#include +#include + +/* For booting Linux, use the first 16MB of memory */ +#define CONFIG_SYS_BOOTMAPSZ (SZ_16M + SZ_8M) + +#define CONFIG_SYS_FLASH_BASE 0x90000000 +#define CONFIG_SYS_INIT_SP_ADDR 0x24040000 + +/* + * Configuration of the external SDRAM memory + */ +#define CONFIG_SYS_LOAD_ADDR 0xC1800000 +#define CONFIG_LOADADDR 0xC1800000 + +#define CONFIG_SYS_HZ_CLOCK 1000000 + +#define CONFIG_CMDLINE_TAG +#define CONFIG_SETUP_MEMORY_TAGS +#define CONFIG_INITRD_TAG +#define CONFIG_REVISION_TAG + +#define CONFIG_SYS_MAXARGS 16 +#define CONFIG_SYS_MALLOC_LEN (1 * 1024 * 1024) + +#define BOOT_TARGET_DEVICES(func) \ + func(MMC, mmc, 0) + +#include +#define CONFIG_EXTRA_ENV_SETTINGS \ + "kernel_addr_r=0xC0008000\0" \ + "fdtfile=stm32h750i-art-pi.dtb\0" \ + "fdt_addr_r=0xC0408000\0" \ + "scriptaddr=0xC0418000\0" \ + "pxefile_addr_r=0xC0428000\0" \ + "ramdisk_addr_r=0xC0438000\0" \ + BOOTENV + +#endif /* __CONFIG_H */