Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D483BEB64DA for ; Sat, 24 Jun 2023 21:12:04 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 1E72585F50; Sat, 24 Jun 2023 23:12:00 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=konsulko.com header.i=@konsulko.com header.b="NVVr0Q/D"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 1D51285E73; Sat, 24 Jun 2023 23:11:48 +0200 (CEST) Received: from mail-qk1-x734.google.com (mail-qk1-x734.google.com [IPv6:2607:f8b0:4864:20::734]) (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 EA93E85CB1 for ; Sat, 24 Jun 2023 23:11:43 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=trini@konsulko.com Received: by mail-qk1-x734.google.com with SMTP id af79cd13be357-7655f778c91so108039885a.1 for ; Sat, 24 Jun 2023 14:11:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=konsulko.com; s=google; t=1687641103; x=1690233103; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=Jc/+0A8WEUYSugOoSNKr1zweRnWhPxoDuT3zLSDsSBQ=; b=NVVr0Q/D3aT3RoSxUo+U4aWEkJRPXyihTBfZPwlSapbde1OOUIp18W6+cazTfrANKI QZl3HY5aXswqSOPjNj3PX2JfhcWUxQ+BngC3LB4qNKZrWjjlOzso92vgFWGSy4DZ3MIv 8yqjc+gC6hUSNCoRYyJWhn/9Cmi0snMwXw5tM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687641103; x=1690233103; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=Jc/+0A8WEUYSugOoSNKr1zweRnWhPxoDuT3zLSDsSBQ=; b=G2zB2qoHH8zvP7gIKL1iJVAf4UlY5JAFmPwbqip8E+R7+DSRKxQqR1i4fGgspVIPtZ e9hVhGqpaAufD2dl6qrI+eTjUnbApVR7Svhy7s7RjD5hUe6uDWiuVksbv8tRbQIMQZct QTscVk2h02MtrRILflO2spFOwSEYR/j709PWEUV1tu83mOaYsS6ProUfsIPviadk85cn c4GST5oJY+9Kni7K7WEkUX5SkQtKXSyuDNf2zKPk3BqirLQ4QauoxISGV5OUe6x6awnN CT4YeIfme85omw90zYVkJuDWWDs38xeH7gz81A3Ct9fGv6qBlYaTTIDVYluX9PkyqdYs Cvwg== X-Gm-Message-State: AC+VfDx/8ffhSDdkpwAjK69EV4m95zjGB40dUnt6MhCGG5aHjU9MbUhu 6VAVO6GOWd/z40Yley664INUGEEHrKwtijriuSbt9Q== X-Google-Smtp-Source: ACHHUZ4MOw/+iMz5bSoqZYluBH1V61EVFnf5aLagtErvggqCjeXOQzSAAdgsCecQtO6wDOS+tsWiRQ== X-Received: by 2002:a81:7bc2:0:b0:562:16d7:e6eb with SMTP id w185-20020a817bc2000000b0056216d7e6ebmr15714658ywc.40.1687625869742; Sat, 24 Jun 2023 09:57:49 -0700 (PDT) Received: from bill-the-cat (2603-6081-7b00-6400-da61-6355-3777-b00c.res6.spectrum.com. [2603:6081:7b00:6400:da61:6355:3777:b00c]) by smtp.gmail.com with ESMTPSA id r206-20020a0de8d7000000b0057060bb2874sm417042ywe.37.2023.06.24.09.57.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 24 Jun 2023 09:57:49 -0700 (PDT) Date: Sat, 24 Jun 2023 12:57:46 -0400 From: Tom Rini To: Pali =?iso-8859-1?Q?Roh=E1r?= Cc: u-boot@lists.denx.de Subject: Re: [PATCH v2] powerpc: Add support for CZ.NIC Turris 1.x routers Message-ID: <20230624165746.GT3931582@bill-the-cat> References: <20220516090119.20217-1-pali@kernel.org> <20220817205622.26644-1-pali@kernel.org> <20230612180724.GA2757833@bill-the-cat> <20230624091951.e7f6axiamo6qzqgh@pali> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="PejB2hQ3Nfw+bLmQ" Content-Disposition: inline In-Reply-To: <20230624091951.e7f6axiamo6qzqgh@pali> X-Clacks-Overhead: GNU Terry Pratchett X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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.103.8 at phobos.denx.de X-Virus-Status: Clean --PejB2hQ3Nfw+bLmQ Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Jun 24, 2023 at 11:19:51AM +0200, Pali Roh=E1r wrote: > On Monday 12 June 2023 14:07:24 Tom Rini wrote: > > On Wed, Aug 17, 2022 at 10:56:22PM +0200, Pali Roh=E1r wrote: > >=20 > > > CZ.NIC Turris 1.0 and 1.1 are open source routers, they have dual-core > > > PowerPC Freescale P2020 CPU and are based on Freescale P2020RDB-PC-A = board. > > >=20 > > > Hardware design is fully open source, all firmware and hardware design > > > files are available at Turris project website: > > >=20 > > > https://docs.turris.cz/hw/turris-1x/turris-1x/ > > > https://project.turris.cz/en/hardware.html > > >=20 > > > This patch adds full U-Boot support for CZ.NIC Turris 1.x routers. P2= 020 > > > BootROM can load U-Boot either from NOR flash or from SD card. So the= re is > > > defconfig file turris_1x_nor_defconfig which builds NOR version and > > > defconfig file turris_1x_sdcard_defconfig which builds SD card versio= n. > > >=20 > > > Design of CZ.NIC Turris 1.x routers is based on Freescale P2020RDB-PC= -A > > > board, so common board code from boards/freescale/p1_p2_rdb_pc direct= ory is > > > shared and linked also into Turris 1.x U-Boot board code. > > >=20 > > > Turris 1.x code in this patch uses modern distroboot and can boot Lin= ux > > > kernel from various locations, including NAND, SD card, USB flash dis= ks, > > > NVMe disks or SATA disks (connected to extra SATA/SCSI PCIe controlle= rs). > > >=20 > > > Signed-off-by: Pali Roh=E1r > >=20 > > To be clear, this is something that if there's still interest in > > upstreaming this platform, this patch needs to be rebased and re-tested > > as it's non-trivially out of date. In addition: >=20 > Meanwhile I have already done rebase and retest, v3 is here: > https://patchwork.ozlabs.org/project/uboot/patch/20220831164821.29109-1-p= ali@kernel.org/ Yes, and I replied to that with feedback. > > > diff --git a/board/CZ.NIC/turris_1x/Kconfig b/board/CZ.NIC/turris_1x/= Kconfig > > > new file mode 100644 > > > index 000000000000..2a1cbd22c783 > > > --- /dev/null > > > +++ b/board/CZ.NIC/turris_1x/Kconfig > > > @@ -0,0 +1,170 @@ > > > +# SPDX-License-Identifier: GPL-2.0+ > > > +# (C) 2022 Pali Roh=E1r > > > + > > > +if TARGET_TURRIS_1X > > > + > > > +# Board identification > > > +config SYS_BOARD > > > + default "turris_1x" > > > +config SYS_VENDOR > > > + default "CZ.NIC" > > > +config SYS_CONFIG_NAME > > > + default "turris_1x" > > > +config DEFAULT_DEVICE_TREE > > > + default "turris1x" > > > + > > > +# Board functions > > > +config ATSHA204A > > > + default y > > > +config BOARD_EARLY_INIT_F > > > + default y > > > +config BOARD_EARLY_INIT_R > > > + default y > > > +config LAST_STAGE_INIT > > > + default y > > > +config MISC > > > + default y > > > +config OF_BOARD_FIXUP > > > + default y > > > +config OF_BOARD_SETUP > > > + default y > > > + > > > +# ENV > > > +config ENV_SIZE > > > + default 0x2000 > > > +config ENV_SECT_SIZE > > > + default 0x20000 > > > +config ENV_OVERWRITE > > > + default y > > > +config ENV_IS_IN_FLASH > > > + default y > > > +config ENV_ADDR > > > + default 0xeff20000 # in NOR > > > +config SYS_RELOC_GD_ENV_ADDR > > > + default y > > > + > > > +# DDR > > > +config DDR_CLK_FREQ > > > + default 66666666 > > > + > > > +# UART > > > +config DEBUG_UART_BASE > > > + default 0xffe04500 if DEBUG_UART > > > +config DEBUG_UART_CLOCK > > > + default 37500000 if DEBUG_UART > > > +config SYS_NS16550 > > > + default y > > > + > > > +# I2C > > > +config I2C_SET_DEFAULT_BUS_NUM > > > + default y > > > +config SYS_FSL_I2C_OFFSET > > > + default 0x3000 > > > +config SYS_FSL_HAS_I2C2_OFFSET > > > + default y > > > +config SYS_FSL_I2C2_OFFSET > > > + default 0x3100 > > > +config SYS_I2C_FSL > > > + default y > > > + > > > +# GPIO > > > +config MPC8XXX_GPIO > > > + default y > > > + > > > +# WDT > > > +config WDT_MAX6370 > > > + default y > > > + > > > +# PCIe > > > +config PCI_INIT_R > > > + default y > > > +config PCIE_FSL > > > + default y > > > + > > > +# Ethernet > > > +config MII > > > + default y > > > +config PHY_FIXED > > > + default y > > > +config TSEC_ENET > > > + default y > > > + > > > +# USB > > > +config USB_EHCI_FSL > > > + default y > > > +config USB_XHCI_HCD > > > + default y > > > +config USB_XHCI_PCI > > > + default y > > > + > > > +# SDHC > > > +config FSL_ESDHC > > > + default y > > > +config FSL_PREPBL_ESDHC_BOOT_SECTOR > > > + default y if SYS_EXTRA_OPTIONS =3D SDCARD > > > +config SYS_FSL_ESDHC_DEFAULT_BUS_WIDTH > > > + default 4 > > > + > > > +# NOR > > > +config MTD_NOR_FLASH > > > + default y > > > +config CFI_FLASH > > > + default y > > > +config FLASH_CFI_MTD > > > + default y > > > +config SYS_FLASH_USE_BUFFER_WRITE > > > + default y > > > + > > > +# NAND > > > +config MTD_RAW_NAND > > > + default y > > > +config NAND_FSL_ELBC > > > + default y > > > +config NAND_FSL_ELBC_DT > > > + default y > > > +config BCH > > > + default y > > > +config SYS_FLASH_CFI > > > + default y > > > + > > > +config MPC85XX_HAVE_RESET_VECTOR > > > + default y if SYS_EXTRA_OPTIONS !=3D SDCARD > > > + > > > +config SYS_LOAD_ADDR > > > + default 0x1000000 > > > + > > > +config SYS_TEXT_BASE > > > + default 0x11000000 if SPL # in DDR > > > + default 0xf8f80000 if SYS_EXTRA_OPTIONS =3D SDCARD # in SRAM > > > + default 0xeff40000 # in NOR > > > + > > > +if SPL > > > + > > > +config SPL_TEXT_BASE > > > + default 0xf8f80000 if SYS_EXTRA_OPTIONS =3D SDCARD # in SRAM > > > + default 0xeff40000 # in NOR > > > + > > > +config SPL_ENV_SUPPORT > > > + default y > > > +config SPL_FRAMEWORK > > > + default n > > > +config SPL_I2C > > > + default y > > > +config SPL_LIBCOMMON_SUPPORT > > > + default y > > > +config SPL_LIBGENERIC_SUPPORT > > > + default y > > > +config SPL_MMC > > > + default y if SYS_EXTRA_OPTIONS =3D SDCARD > > > +config SPL_MMC_BOOT > > > + default y if SYS_EXTRA_OPTIONS =3D SDCARD > > > +config SPL_MPC8XXX_INIT_DDR > > > + default y > > > +config SPL_SERIAL > > > + default y > > > +config SPL_SYS_I2C_LEGACY > > > + default y > > > + > > > +endif > > > + > > > +endif > >=20 > > Almost none of this belongs in the board Kconfig file. Other than > > SYS_BOARD/VENDOR/CONFIG_NAME these all look like normal defconfig > > options. > >=20 > > And since I suspect you're going to note that this is common to both > > ways of using the platform, I would on the one hand suggest using config > > fragments. But on the other hand, I would really like to see someone > > figure out what we need to do so that they can reside in the board > > directory rather than top-level configs directory, and have the rest of > > the rules work and generate the config appropriately, before we start > > making big use of that feature. Given the rest of your general concerns > > I don't know if you want to spend any time on that or not. >=20 > We do not have config fragments support (yet), so I put common > information into Kconfig files. We have config fragment support right now (see https://patchwork.ozlabs.org/project/uboot/list/?series=3D360950&state=3D*). >=20 > > [snip] > > > diff --git a/include/configs/turris_1x.h b/include/configs/turris_1x.h > > > new file mode 100644 > > > index 000000000000..c53bed028c7a > > > --- /dev/null > > > +++ b/include/configs/turris_1x.h > > > @@ -0,0 +1,390 @@ > > > +// SPDX-License-Identifier: GPL-2.0+ > > > +// (C) 2022 Pali Roh=E1r > > > + > > > +#ifndef _CONFIG_TURRIS_1X_H > > > +#define _CONFIG_TURRIS_1X_H > > > + > > > +#include > > > + > > > +/* > > > + * Turris 1.x memory map: > > > + * > > > + * 0x0000_0000 - 0x7fff_ffff 2 GB DDR cacheable > > > + * 0x8000_0000 - 0xbfff_ffff 1 GB PCIe MEM (bus 1-2) non-cachea= ble > > > + * 0xc000_0000 - 0xc01f_ffff 2 MB PCIe MEM (bus 3) non-cachea= ble > > > + * 0xc020_0000 - 0xeeff_ffff 750 MB unused > > > + * 0xef00_0000 - 0xefff_ffff 16 MB NOR (CS0) non-cachea= ble > > > + * 0xf000_0000 - 0xf8f7_ffff 143 MB unused > > > + * 0xf8f8_0000 - 0xf8ff_ffff 512 kB L2 SRAM cacheable = (early boot, SD card only) > > > + * 0xf900_0000 - 0xff6f_ffff 103 MB unused > > > + * 0xff70_0000 - 0xff7f_ffff 1 MB CCSR non-cachea= ble (SPL only) > > > + * 0xff80_0000 - 0xff80_7fff 32 kB NAND (CS1) non-cachea= ble > > > + * 0xffa0_0000 - 0xffa1_ffff 128 kB CPLD (CS3) non-cachea= ble > > > + * 0xffc0_0000 - 0xffc2_ffff 192 kB PCIe IO non-cachea= ble > > > + * 0xffd0_0000 - 0xffd0_3fff 16 kB L1 stack cacheable = (early boot) > > > + * 0xffe0_0000 - 0xffef_ffff 1 MB CCSR non-cachea= ble (not in SPL) > > > + * 0xffff_f000 - 0xffff_ffff 4 kB Boot page non-cachea= ble > > > + */ > >=20 > > This would belong in a board doc file under doc/board/... and not in > > this header. > >=20 > > --=20 > > Tom >=20 > All other mpc85xx boards have this memory mapping in include/configs/*boa= rd*.h > header files, so I put it into same place too. So anybody would look for > memory mapping for any mpc85xx board, this information is on the same > place. Yes, please put this information in the new and correct place and not further add to the bit-rotten documentation locations. I know you won't go and convert the other platforms, but yes, the maintainers of those platforms should also move their documentation to the new location and format. --=20 Tom --PejB2hQ3Nfw+bLmQ Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGzBAABCgAdFiEEGjx/cOCPqxcHgJu/FHw5/5Y0tywFAmSXIIcACgkQFHw5/5Y0 tyzFVQv/YMAXSb8EdaFhEdcdscsa0kImolu+I8y7XMZi0fw/FYjXwh9x7LvD82dq YPOAEqGbP2UICBO6EKHMzGj9lNhx0hWQJSB5i6w+JJujckqc9RthO1wtrbD7VD1H fOfsBXw9wGaGKCynCxoX6ER4SVgty+sLAVsT16B9Jr2zPcDnKEh6+WTy7pWu/Ekk j03ONHcnzPvzjIAI5cFHl1fPx4ZzD9U8sk24FBKZtaVh9C3n6Xp/wsemA1jba5YJ JhCRg2IhSU6ry4RDVq9RSuY2SDD53hXl8OcisARPnW58VuX1kfy2MP0fwb5gy1eJ Bl3+IvbtxC9X0bJanYtjPQiOi/1S8sayP4XSqZMBZJUbB2fT9NPzxYTU69pGvp3D Ew/4bY0rv9RNQUYdP17MPRnSgkIYwdyj8JrZpVN+lrudwiBXGhEHwtJ6FngjGcYq TXip48dchYBlGZXaGK3bnmrKH+Qq+wOla1BTdB0H2QOawlvWwmkCtx4qeimS1FKR 6uUvb7HY =qohp -----END PGP SIGNATURE----- --PejB2hQ3Nfw+bLmQ--