Skip to contentSkip to conversation

phycore-pcl060: U-boot support for Phytec phyCORE PCL060

PATCH New Niel Fourie 5 participants 11 messages Apr 18, 2019 – Apr 25, 2019

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 phycore-pcl060: U-boot support for Phytec phyCORE PCL060

Support for Phytech phyCORE AM335x R2 SOM (PCL060) on the Phytec phyBOARD-Wega AM335x.

CPU  : AM335X-GP rev 2.1
Model: Phytec AM335x phyBOARD-WEGA
DRAM:  256 MiB
NAND:  256 MiB
MMC:   OMAP SD/MMC: 0
eth0: ethernet at 4a100000

Working:
- Eth0
- i2C
- MMC/SD
- NAND
- UART
- USB (host)

---
 arch/arm/dts/Makefile                    |   3 +-
 arch/arm/dts/am335x-phycore-som.dtsi     | 327 ++++++++++++++++++++++
 arch/arm/dts/am335x-wega-rdk-u-boot.dtsi |  35 +++
 arch/arm/dts/am335x-wega-rdk.dts         |  23 ++
 arch/arm/dts/am335x-wega.dtsi            | 231 +++++++++++++++
 arch/arm/include/asm/mach-types.h        |   1 +
 arch/arm/mach-omap2/Kconfig              |   1 +
 arch/arm/mach-omap2/am33xx/Kconfig       |   7 +
 board/phytec/phycore_pcl060/Kconfig      |  19 ++
 board/phytec/phycore_pcl060/MAINTAINERS  |   7 +
 board/phytec/phycore_pcl060/Makefile     |  11 +
 board/phytec/phycore_pcl060/board.c      | 340 +++++++++++++++++++++++
 board/phytec/phycore_pcl060/board.h      |  24 ++
 board/phytec/phycore_pcl060/mux.c        | 117 ++++++++
 configs/phycore-pcl060-wega_defconfig    |  80 ++++++
 include/configs/phycore_pcl060.h         | 141 ++++++++++
 16 files changed, 1366 insertions(+), 1 deletion(-)
 create mode 100644 arch/arm/dts/am335x-phycore-som.dtsi
 create mode 100644 arch/arm/dts/am335x-wega-rdk-u-boot.dtsi
 create mode 100644 arch/arm/dts/am335x-wega-rdk.dts
 create mode 100644 arch/arm/dts/am335x-wega.dtsi
 create mode 100644 board/phytec/phycore_pcl060/Kconfig
 create mode 100644 board/phytec/phycore_pcl060/MAINTAINERS
 create mode 100644 board/phytec/phycore_pcl060/Makefile
 create mode 100644 board/phytec/phycore_pcl060/board.c
 create mode 100644 board/phytec/phycore_pcl060/board.h
 create mode 100644 board/phytec/phycore_pcl060/mux.c
 create mode 100644 configs/phycore-pcl060-wega_defconfig
 create mode 100644 include/configs/phycore_pcl060.h
arch/arm/dts/Makefile +2 -1
index 0aee8dfde0..a44a95d0a2 100644
@@ -253,7 +253,8 @@ dtb-$(CONFIG_AM33XX) += \
 	am335x-chiliboard.dtb \
 	am335x-sl50.dtb \
 	am335x-base0033.dtb \
-	am335x-guardian.dtb
+	am335x-guardian.dtb \
+	am335x-wega-rdk.dtb
 dtb-$(CONFIG_AM43XX) += am437x-gp-evm.dtb am437x-sk-evm.dtb	\
 	am43x-epos-evm.dtb \
 	am437x-idk-evm.dtb \
arch/arm/dts/am335x-phycore-som.dtsi new file +327 -0

327 lines not on this page · raw message

arch/arm/dts/am335x-wega-rdk-u-boot.dtsi new file +35 -0
new file mode 100644
index 0000000000..bafef3c76d
@@ -0,0 +1,35 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (C) 2019 DENX Software Engineering GmbH
+ */
+
+/ {
+	chosen {
+		#address-cells = <1>;
+		#size-cells = <1>;
+
+		bootargs = "console=ttyO0,115200 earlyprintk";
+		stdout-path = &uart0;
+	};
+
+	ocp {
+		u-boot,dm-spl;
+		u-boot,dm-pre-reloc;
+	};
+};
+
+&scm {
+	u-boot,dm-spl;
+	u-boot,dm-pre-reloc;
+};
+
+&uart0 {
+	u-boot,dm-spl;
+	u-boot,dm-pre-reloc;
+};
+
+&mmc1 {
+	u-boot,dm-spl;
+	u-boot,dm-pre-reloc;
+	cd-gpios = <&gpio0 6 GPIO_ACTIVE_LOW>;
+};
arch/arm/dts/am335x-wega-rdk.dts new file +23 -0
new file mode 100644
index 0000000000..fe50f3041a
@@ -0,0 +1,23 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (C) 2015 Phytec Messtechnik GmbH
+ * Author: Teresa Remmet <[email protected]>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+/dts-v1/;
+
+#include "am335x-phycore-som.dtsi"
+#include "am335x-wega.dtsi"
+
+/* SoM */
+&i2c_eeprom {
+	status = "okay";
+};
+
+&i2c_rtc {
+	status = "okay";
+};
arch/arm/dts/am335x-wega.dtsi new file +231 -0

231 lines not on this page · raw message

arch/arm/include/asm/mach-types.h +1 -0
index 9f82efe007..79c522ecdc 100644
@@ -5057,4 +5057,5 @@
 #define MACH_TYPE_NASM25               5112
 #define MACH_TYPE_TOMATO               5113
 #define MACH_TYPE_OMAP3_MRC3D          5114
+#define MACH_TYPE_PCL060               5115
 #endif
arch/arm/mach-omap2/Kconfig +1 -0
index d29f1ca0b5..9336439340 100644
@@ -186,6 +186,7 @@ source "board/ti/am43xx/Kconfig"
 source "board/ti/am335x/Kconfig"
 source "board/compulab/cm_t335/Kconfig"
 source "board/compulab/cm_t43/Kconfig"
+source "board/phytec/phycore_pcl060/Kconfig"
 
 config SPL_LDSCRIPT
         default "arch/arm/mach-omap2/u-boot-spl.lds"
arch/arm/mach-omap2/am33xx/Kconfig +7 -0
index 500df1aa11..4e84cfbeff 100644
@@ -156,6 +156,13 @@ config TARGET_ETAMIN
 	select DM_SERIAL
 	imply CMD_DM
 
+config TARGET_PCL060
+	bool "Support pcl060"
+	select DM
+	select DM_GPIO
+	select DM_SERIAL
+	imply CMD_DM
+
 config TARGET_PCM051
 	bool "Support pcm051"
 	select DM
board/phytec/phycore_pcl060/Kconfig new file +19 -0
new file mode 100644
index 0000000000..bdd1a9b6e0
@@ -0,0 +1,19 @@
+if TARGET_PCL060
+
+config SYS_BOARD
+	default "phycore_pcl060"
+
+config SYS_VENDOR
+	default "phytec"
+
+config SYS_SOC
+	default "am33xx"
+
+config SYS_CONFIG_NAME
+	default "phycore_pcl060"
+
+config PCL060_DDR_SIZE
+	int "DDR size (in MiB) of Phycore PCL060 module"
+	default 256
+
+endif
board/phytec/phycore_pcl060/MAINTAINERS new file +7 -0
new file mode 100644
index 0000000000..cddcc308c4
@@ -0,0 +1,7 @@
+phyCORE PCL060 BOARD
+M:	Niel Fourie <[email protected]>
+M:	Parthiban Nallathambi <[email protected]>
+S:	Maintained
+F:	board/phytec/phycore_pcl060
+F:	include/configs/phycore_pcl060.h
+F:	configs/phycore-pcl060-wega_defconfig
board/phytec/phycore_pcl060/Makefile new file +11 -0
new file mode 100644
index 0000000000..ff6f8b4221
@@ -0,0 +1,11 @@
+# SPDX-License-Identifier: GPL-2.0+
+#
+# Makefile
+#
+# Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
+
+ifdef CONFIG_SPL_BUILD
+obj-y	+= mux.o
+endif
+
+obj-y	+= board.o
board/phytec/phycore_pcl060/board.c new file +340 -0

340 lines not on this page · raw message

board/phytec/phycore_pcl060/board.h new file +24 -0
new file mode 100644
index 0000000000..68c3d56aa5
@@ -0,0 +1,24 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * board.h
+ *
+ * Phytec phyCORE-AM335x (pcl060) boards information header
+ *
+ * Copyright (C) 2013 Lars Poeschel, Lemonage Software GmbH
+ * Copyright (C) 2019 DENX Software Engineering GmbH
+ */
+
+#ifndef _BOARD_H_
+#define _BOARD_H_
+
+/*
+ * We have three pin mux functions that must exist.  We must be able to enable
+ * uart0, for initial output and i2c0 to access the PMIC. We then have a main
+ * pinmux function that can be overridden to enable all other pinmux that
+ * is required on the board.
+ */
+void enable_uart0_pin_mux(void);
+void enable_i2c0_pin_mux(void);
+void enable_board_pin_mux(void);
+void enable_cbmux_pin_mux(void);
+#endif
board/phytec/phycore_pcl060/mux.c new file +117 -0

117 lines not on this page · raw message

configs/phycore-pcl060-wega_defconfig new file +80 -0

80 lines not on this page · raw message

include/configs/phycore_pcl060.h new file +141 -0

141 lines not on this page · raw message

Signature · 1 line
2.17.2
#1 lore raw

PATCH 1/1 phycore-pcl060: U-boot support for Phytec phyCORE PCL060

Quoted 18 lines · Niel Fourie

Support for Phytech phyCORE AM335x R2 SOM (PCL060) on the Phytec phyBOARD-Wega AM335x.

CPU  : AM335X-GP rev 2.1
Model: Phytec AM335x phyBOARD-WEGA
DRAM:  256 MiB
NAND:  256 MiB
MMC:   OMAP SD/MMC: 0
eth0: ethernet at 4a100000

Working:
- Eth0
- i2C
- MMC/SD
- NAND
- UART
- USB (host)

Quoted 7 lines
---
 arch/arm/dts/Makefile                    |   3 +-
 arch/arm/dts/am335x-phycore-som.dtsi     | 327 ++++++++++++++++++++++
 arch/arm/dts/am335x-wega-rdk-u-boot.dtsi |  35 +++
 arch/arm/dts/am335x-wega-rdk.dts         |  23 ++
 arch/arm/dts/am335x-wega.dtsi            | 231 +++++++++++++++

The DTs come from Linux kernel, but which version of Linux ? Which exact commit ? Did you modify them in any way ?

[...]

arch/arm/mach-omap2/Kconfig source "board/ti/am43xx/Kconfig" · line 189

Quoted 9 lines
arch/arm/mach-omap2/Kconfig +1 -0
index d29f1ca0b5..9336439340 100644
@@ -186,6 +186,7 @@ source "board/ti/am43xx/Kconfig"
 source "board/ti/am335x/Kconfig"
 source "board/compulab/cm_t335/Kconfig"
 source "board/compulab/cm_t43/Kconfig"
+source "board/phytec/phycore_pcl060/Kconfig"

Here [1] it says the name of the SoM is PCM-060 , what is PCL-060 ?

[1]
https://www.phytec.eu/product-eu/system-on-modules/phycore-am335x-download/
[...]

Quoted 13 lines
board/phytec/phycore_pcl060/Kconfig new file +7 -0
new file mode 100644
index 0000000000..bdd1a9b6e0
@@ -0,0 +1,19 @@
+if TARGET_PCL060
+
+config SYS_BOARD
+	default "phycore_pcl060"
+
+config SYS_VENDOR
+	default "phytec"

board/phytec/phycore_pcl060/Kconfig line 17

Quoted 10 lines
board/phytec/phycore_pcl060/Kconfig new file +10 -0
+
+config SYS_SOC
+	default "am33xx"
+
+config SYS_CONFIG_NAME
+	default "phycore_pcl060"
+
+config PCL060_DDR_SIZE
+	int "DDR size (in MiB) of Phycore PCL060 module"
+	default 256

DRAM size should come from DT, we don't need another custom config option. Look at fdtdec_setup_mem_size_base() and fdtdec_setup_memory_banksize().

[...]

Quoted 39 lines
board/phytec/phycore_pcl060/board.c new file +33 -0
new file mode 100644
index 0000000000..01fe13e959
@@ -0,0 +1,340 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * board.c
+ *
+ * Board functions for Phytec phyCORE-AM335x R2 (pcl060) based boards
+ *
+ * Copyright (C) 2011, Texas Instruments, Incorporated - http://www.ti.com/
+ * Copyright (C) 2013 Lars Poeschel, Lemonage Software GmbH
+ * Copyright (C) 2015 Wadim Egorov, PHYTEC Messtechnik GmbH
+ * Copyright (C) 2019 DENX Software Engineering GmbH
+ */
+
+#include <common.h>
+#include <environment.h>
+#include <errno.h>
+#include <spl.h>
+#include <asm/arch/cpu.h>
+#include <asm/arch/hardware.h>
+#include <asm/arch/omap.h>
+#include <asm/arch/ddr_defs.h>
+#include <asm/arch/clock.h>
+#include <asm/arch/gpio.h>
+#include <asm/arch/mmc_host_def.h>
+#include <asm/arch/sys_proto.h>
+#include <asm/io.h>
+#include <asm/emif.h>
+#include <asm/gpio.h>
+#include <i2c.h>
+#include <miiphy.h>
+#include <cpsw.h>
+#include <power/tps65910.h>
+#include <jffs2/load_kernel.h>
+#include <mtd_node.h>

board/phytec/phycore_pcl060/board.c line 43

Quoted 10 lines
board/phytec/phycore_pcl060/board.c new file +10 -0
+#include <fdt_support.h>
+#include "board.h"
+
+DECLARE_GLOBAL_DATA_PTR;
+
+static struct ctrl_dev *cdev = (struct ctrl_dev *)CTRL_DEVICE_BASE;
+
+#ifdef CONFIG_SPL_BUILD
+
+#ifdef CONFIG_SPL_OS_BOOT

#if CONFIG_IS_ENABLED(OS_BOOT)

Quoted 27 lines
board/phytec/phycore_pcl060/board.c new file +27 -0
+int spl_start_uboot(void)
+{
+	return 1;
+}
+#endif
+/* DDR RAM defines */
+#define DDR_CLK_MHZ		400 /* DDR_DPLL_MULT value */
+
+#define OSC	(V_OSCK / 1000000)
+const struct dpll_params dpll_ddr = {
+		DDR_CLK_MHZ, OSC - 1, 1, -1, -1, -1, -1};
+
+const struct dpll_params *get_dpll_ddr_params(void)
+{
+	return &dpll_ddr;
+}
+
+const struct ctrl_ioregs ioregs = {
+	.cm0ioctl		= 0x18B,
+	.cm1ioctl		= 0x18B,
+	.cm2ioctl		= 0x18B,
+	.dt0ioctl		= 0x18B,
+	.dt1ioctl		= 0x18B,
+};
+
+static const struct cmd_control ddr3_cmd_ctrl_data = {
+	.cmd0csratio = 0x80,

board/phytec/phycore_pcl060/board.c line 80

Quoted 10 lines
board/phytec/phycore_pcl060/board.c new file +10 -0
+	.cmd0iclkout = 0x0,
+
+	.cmd1csratio = 0x80,
+	.cmd1iclkout = 0x0,
+
+	.cmd2csratio = 0x80,
+	.cmd2iclkout = 0x0,
+};
+
+#if CONFIG_PCL060_DDR_SIZE == 256

Get the DRAM layout from DT and apply EMIF settings accordingly.

[...]

Quoted 117 lines
include/configs/phycore_pcl060.h new file +111 -0
new file mode 100644
index 0000000000..982c96b267
@@ -0,0 +1,141 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * phycore_pcl060.h
+ *
+ * Phytec phyCORE-AM335x (pcl060) boards information header
+ *
+ * Copyright (C) 2011, Texas Instruments, Incorporated - http://www.ti.com/
+ * Copyright (C) 2013 Lars Poeschel, Lemonage Software GmbH
+ * Copyright (C) 2019 DENX Software Engineering GmbH
+ */
+
+#ifndef __CONFIG_PCL060_H
+#define __CONFIG_PCL060_H
+
+#include <configs/ti_am335x_common.h>
+
+#define CONFIG_ENV_SIZE			(128 << 10)	/* 128 KiB */
+#define CONFIG_MACH_TYPE		MACH_TYPE_PCL060
+#define CONFIG_SYS_MMC_ENV_DEV		0
+#define CONFIG_SYS_MMCSD_FS_BOOT_PARTITION	1
+
+#ifdef CONFIG_NAND
+#define NANDARGS \
+	"mtdids=" CONFIG_MTDIDS_DEFAULT "\0" \
+	"mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0" \
+	"nandargs=setenv bootargs console=${console} " \
+		"${optargs} " \
+		"root=${nandroot} " \
+		"rootfstype=${nandrootfstype}\0" \
+	"nandroot=ubi0:root ubi.mtd=NAND.UBI\0" \
+	"nandrootfstype=ubifs rootwait rw fsck.repair=yes\0" \
+	"nandboot=echo Booting from nand ...; " \
+		"run nandargs; " \
+		"ubi part NAND.UBI; " \
+		"ubi readvol ${fdtaddr} oftree; " \
+		"ubi readvol ${loadaddr} kernel; " \
+		"bootz ${loadaddr} - ${fdtaddr}\0"
+
+#else
+#define NANDARGS ""
+#endif
+
+/* set to negative value for no autoboot */
+#define BOOTENV_DEV_LEGACY_MMC(devtypeu, devtypel, instance) \
+	"bootcmd_" #devtypel #instance "=" \
+	"setenv mmcdev " #instance "; "\
+	"setenv bootpart " #instance ":1 ; "\
+	"setenv rootpart " #instance ":2 ; "\
+	"run mmcboot\0"
+
+#define BOOTENV_DEV_NAME_LEGACY_MMC(devtypeu, devtypel, instance) \
+	#devtypel #instance " "
+
+#define BOOTENV_DEV_NAND(devtypeu, devtypel, instance) \
+	"bootcmd_" #devtypel #instance "=" \
+	"run nandboot\0"
+
+#define BOOTENV_DEV_NAME_NAND(devtypeu, devtypel, instance) \
+	#devtypel #instance " "
+
+#define BOOT_TARGET_DEVICES(func) \
+	func(MMC, mmc, 0) \
+	func(LEGACY_MMC, legacy_mmc, 0) \
+	func(MMC, mmc, 1) \
+	func(LEGACY_MMC, legacy_mmc, 1) \
+	func(NAND, nand, 0)
+
+#include <config_distro_bootcmd.h>
+#include <environment/ti/dfu.h>
+#include <environment/ti/mmc.h>
+
+#define CONFIG_EXTRA_ENV_SETTINGS \
+	DEFAULT_MMC_TI_ARGS \
+	DEFAULT_LINUX_BOOT_ENV \
+	"bootfile=zImage\0" \
+	"fdtfile=" CONFIG_DEFAULT_FDT_FILE "\0" \
+	"console=ttyO0,115200n8\0" \
+	"optargs=\0" \
+	"mmcrootfstype=ext2 rootwait\0" \
+	"finduuid=part uuid mmc ${rootpart} uuid\0" \
+	"boot_fit=0\0" \
+	NANDARGS \
+	BOOTENV
+
+/* Clock Defines */
+#define V_OSCK				25000000  /* Clock output from T2 */
+#define V_SCLK				(V_OSCK)
+
+#define CONFIG_POWER_TPS65910
+
+#ifdef CONFIG_NAND
+/* NAND: device related configs */
+#define CONFIG_SYS_NAND_5_ADDR_CYCLE
+#define CONFIG_SYS_NAND_PAGE_COUNT	(CONFIG_SYS_NAND_BLOCK_SIZE / \
+					 CONFIG_SYS_NAND_PAGE_SIZE)
+#define CONFIG_SYS_NAND_PAGE_SIZE	2048
+#define CONFIG_SYS_NAND_OOBSIZE		64
+#define CONFIG_SYS_NAND_BLOCK_SIZE	(128 * 1024)
+/* NAND: driver related configs */
+#define CONFIG_SYS_NAND_BAD_BLOCK_POS	NAND_LARGE_BADBLOCK_POS
+#define CONFIG_SYS_NAND_ECCPOS		{ 2, 3, 4, 5, 6, 7, 8, 9, \
+					 10, 11, 12, 13, 14, 15, 16, 17, \
+					 18, 19, 20, 21, 22, 23, 24, 25, \
+					 26, 27, 28, 29, 30, 31, 32, 33, \
+					 34, 35, 36, 37, 38, 39, 40, 41, \
+					 42, 43, 44, 45, 46, 47, 48, 49, \
+					 50, 51, 52, 53, 54, 55, 56, 57, }
+
+#define CONFIG_SYS_NAND_ECCSIZE		512
+#define CONFIG_SYS_NAND_ECCBYTES	14
+#define CONFIG_SYS_NAND_ONFI_DETECTION

include/configs/phycore_pcl060.h line 121

Quoted 10 lines
include/configs/phycore_pcl060.h new file +10 -0
+#define CONFIG_NAND_OMAP_ECCSCHEME	OMAP_ECC_BCH8_CODE_HW
+
+/* NAND: SPL related configs */
+#ifdef CONFIG_SPL_OS_BOOT
+#define CONFIG_SYS_NAND_SPL_KERNEL_OFFS	0x00200000 /* kernel offset */
+#endif
+#endif /* !CONFIG_NAND */
+
+#define CONFIG_SYS_BAUDRATE_TABLE	{ 110, 300, 600, 1200, 2400, \
+4800, 9600, 14400, 19200, 28800, 38400, 56000, 57600, 115200 }

I think there's a default value for that in include/config_fallbacks.h , why do you override it here ?

Quoted 7 lines
include/configs/phycore_pcl060.h new file +7 -0
+/* CPU */
+
+#ifdef CONFIG_SPI_BOOT
+#define CONFIG_SYS_SPI_U_BOOT_OFFS	0x20000
+#define CONFIG_SYS_SPI_U_BOOT_SIZE	0x40000
+#elif defined(CONFIG_ENV_IS_IN_NAND)
+#define CONFIG_ENV_OFFSET		0x000a0000

include/configs/phycore_pcl060.h line 139

Quoted 10 lines
include/configs/phycore_pcl060.h new file +10 -0
+#define CONFIG_SYS_ENV_SECT_SIZE	CONFIG_SYS_NAND_BLOCK_SIZE
+#endif
+
+/*
+ * USB configuration
+ */
+#define CONFIG_AM335X_USB0
+#define CONFIG_AM335X_USB0_MODE	MUSB_PERIPHERAL
+#define CONFIG_AM335X_USB1
+#define CONFIG_AM335X_USB1_MODE MUSB_HOST

Can't the USB settings be extracted from DT ?

Signature · 2 lines
Best regards,
Marek Vasut
#2 lore raw

PATCH 1/1 phycore-pcl060: U-boot support for Phytec phyCORE PCL060

Hello Marek,

Quoted 44 lines · Marek Vasut
Quoted 18 lines · Niel Fourie

Support for Phytech phyCORE AM335x R2 SOM (PCL060) on the Phytec phyBOARD-Wega AM335x.

CPU  : AM335X-GP rev 2.1
Model: Phytec AM335x phyBOARD-WEGA
DRAM:  256 MiB
NAND:  256 MiB
MMC:   OMAP SD/MMC: 0
eth0: ethernet at 4a100000

Working:
- Eth0
- i2C
- MMC/SD
- NAND
- UART
- USB (host)

Quoted 7 lines
---
 arch/arm/dts/Makefile                    |   3 +-
 arch/arm/dts/am335x-phycore-som.dtsi     | 327 ++++++++++++++++++++++
 arch/arm/dts/am335x-wega-rdk-u-boot.dtsi |  35 +++
 arch/arm/dts/am335x-wega-rdk.dts         |  23 ++
 arch/arm/dts/am335x-wega.dtsi            | 231 +++++++++++++++

The DTs come from Linux kernel, but which version of Linux ? Which exact commit ? Did you modify them in any way ?

[...]

arch/arm/mach-omap2/Kconfig source "board/ti/am43xx/Kconfig" · line 189

Quoted 9 lines
arch/arm/mach-omap2/Kconfig +1 -0
index d29f1ca0b5..9336439340 100644
@@ -186,6 +186,7 @@ source "board/ti/am43xx/Kconfig"
 source "board/ti/am335x/Kconfig"
 source "board/compulab/cm_t335/Kconfig"
 source "board/compulab/cm_t43/Kconfig"
+source "board/phytec/phycore_pcl060/Kconfig"

Here [1] it says the name of the SoM is PCM-060 , what is PCL-060 ?

Quoted 3 lines

[1]
https://www.phytec.eu/product-eu/system-on-modules/phycore-am335x-download/
[...]

This differs only by the connector. PCM variants are pluggable and PCL variants are direct soliderable to the carrier board.

Copied from [1]:
The PCL-060 System On Module is a connector-less, BGA style variant of the PCM-060/phyCORE-AM335x R2 SOM. Unlike traditional Phytec SOM products that support high density connectors, the PCL-060 SOM is directly soldered down to the phyBOARD-Wega AM335x using Phytec's Direct Solder Connect technology (DSC). This solution offers an ultra-low cost Single Board Computer for the AM335x processor, while maintaining most of the advantages of the SOM concept.

[1] https://www.phytec.de/fileadmin/user_upload/downloads/Manuals/L-845e_1.pdf

Thanks,
Parthiban N

Quoted 276 lines
Quoted 14 lines
board/phytec/phycore_pcl060/Kconfig new file +7 -0
new file mode 100644
index 0000000000..bdd1a9b6e0
@@ -0,0 +1,19 @@
+if TARGET_PCL060
+
+config SYS_BOARD
+	default "phycore_pcl060"
+
+config SYS_VENDOR
+	default "phytec"

board/phytec/phycore_pcl060/Kconfig line 17

Quoted 10 lines
board/phytec/phycore_pcl060/Kconfig new file +10 -0
+
+config SYS_SOC
+	default "am33xx"
+
+config SYS_CONFIG_NAME
+	default "phycore_pcl060"
+
+config PCL060_DDR_SIZE
+	int "DDR size (in MiB) of Phycore PCL060 module"
+	default 256

DRAM size should come from DT, we don't need another custom config option. Look at fdtdec_setup_mem_size_base() and fdtdec_setup_memory_banksize().

[...]

Quoted 39 lines
board/phytec/phycore_pcl060/board.c new file +33 -0
new file mode 100644
index 0000000000..01fe13e959
@@ -0,0 +1,340 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * board.c
+ *
+ * Board functions for Phytec phyCORE-AM335x R2 (pcl060) based boards
+ *
+ * Copyright (C) 2011, Texas Instruments, Incorporated - http://www.ti.com/
+ * Copyright (C) 2013 Lars Poeschel, Lemonage Software GmbH
+ * Copyright (C) 2015 Wadim Egorov, PHYTEC Messtechnik GmbH
+ * Copyright (C) 2019 DENX Software Engineering GmbH
+ */
+
+#include <common.h>
+#include <environment.h>
+#include <errno.h>
+#include <spl.h>
+#include <asm/arch/cpu.h>
+#include <asm/arch/hardware.h>
+#include <asm/arch/omap.h>
+#include <asm/arch/ddr_defs.h>
+#include <asm/arch/clock.h>
+#include <asm/arch/gpio.h>
+#include <asm/arch/mmc_host_def.h>
+#include <asm/arch/sys_proto.h>
+#include <asm/io.h>
+#include <asm/emif.h>
+#include <asm/gpio.h>
+#include <i2c.h>
+#include <miiphy.h>
+#include <cpsw.h>
+#include <power/tps65910.h>
+#include <jffs2/load_kernel.h>
+#include <mtd_node.h>

board/phytec/phycore_pcl060/board.c line 43

Quoted 10 lines
board/phytec/phycore_pcl060/board.c new file +10 -0
+#include <fdt_support.h>
+#include "board.h"
+
+DECLARE_GLOBAL_DATA_PTR;
+
+static struct ctrl_dev *cdev = (struct ctrl_dev *)CTRL_DEVICE_BASE;
+
+#ifdef CONFIG_SPL_BUILD
+
+#ifdef CONFIG_SPL_OS_BOOT

#if CONFIG_IS_ENABLED(OS_BOOT)

Quoted 27 lines
board/phytec/phycore_pcl060/board.c new file +27 -0
+int spl_start_uboot(void)
+{
+	return 1;
+}
+#endif
+/* DDR RAM defines */
+#define DDR_CLK_MHZ		400 /* DDR_DPLL_MULT value */
+
+#define OSC	(V_OSCK / 1000000)
+const struct dpll_params dpll_ddr = {
+		DDR_CLK_MHZ, OSC - 1, 1, -1, -1, -1, -1};
+
+const struct dpll_params *get_dpll_ddr_params(void)
+{
+	return &dpll_ddr;
+}
+
+const struct ctrl_ioregs ioregs = {
+	.cm0ioctl		= 0x18B,
+	.cm1ioctl		= 0x18B,
+	.cm2ioctl		= 0x18B,
+	.dt0ioctl		= 0x18B,
+	.dt1ioctl		= 0x18B,
+};
+
+static const struct cmd_control ddr3_cmd_ctrl_data = {
+	.cmd0csratio = 0x80,

board/phytec/phycore_pcl060/board.c line 80

Quoted 10 lines
board/phytec/phycore_pcl060/board.c new file +10 -0
+	.cmd0iclkout = 0x0,
+
+	.cmd1csratio = 0x80,
+	.cmd1iclkout = 0x0,
+
+	.cmd2csratio = 0x80,
+	.cmd2iclkout = 0x0,
+};
+
+#if CONFIG_PCL060_DDR_SIZE == 256

Get the DRAM layout from DT and apply EMIF settings accordingly.

[...]

Quoted 117 lines
include/configs/phycore_pcl060.h new file +111 -0
new file mode 100644
index 0000000000..982c96b267
@@ -0,0 +1,141 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * phycore_pcl060.h
+ *
+ * Phytec phyCORE-AM335x (pcl060) boards information header
+ *
+ * Copyright (C) 2011, Texas Instruments, Incorporated - http://www.ti.com/
+ * Copyright (C) 2013 Lars Poeschel, Lemonage Software GmbH
+ * Copyright (C) 2019 DENX Software Engineering GmbH
+ */
+
+#ifndef __CONFIG_PCL060_H
+#define __CONFIG_PCL060_H
+
+#include <configs/ti_am335x_common.h>
+
+#define CONFIG_ENV_SIZE			(128 << 10)	/* 128 KiB */
+#define CONFIG_MACH_TYPE		MACH_TYPE_PCL060
+#define CONFIG_SYS_MMC_ENV_DEV		0
+#define CONFIG_SYS_MMCSD_FS_BOOT_PARTITION	1
+
+#ifdef CONFIG_NAND
+#define NANDARGS \
+	"mtdids=" CONFIG_MTDIDS_DEFAULT "\0" \
+	"mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0" \
+	"nandargs=setenv bootargs console=${console} " \
+		"${optargs} " \
+		"root=${nandroot} " \
+		"rootfstype=${nandrootfstype}\0" \
+	"nandroot=ubi0:root ubi.mtd=NAND.UBI\0" \
+	"nandrootfstype=ubifs rootwait rw fsck.repair=yes\0" \
+	"nandboot=echo Booting from nand ...; " \
+		"run nandargs; " \
+		"ubi part NAND.UBI; " \
+		"ubi readvol ${fdtaddr} oftree; " \
+		"ubi readvol ${loadaddr} kernel; " \
+		"bootz ${loadaddr} - ${fdtaddr}\0"
+
+#else
+#define NANDARGS ""
+#endif
+
+/* set to negative value for no autoboot */
+#define BOOTENV_DEV_LEGACY_MMC(devtypeu, devtypel, instance) \
+	"bootcmd_" #devtypel #instance "=" \
+	"setenv mmcdev " #instance "; "\
+	"setenv bootpart " #instance ":1 ; "\
+	"setenv rootpart " #instance ":2 ; "\
+	"run mmcboot\0"
+
+#define BOOTENV_DEV_NAME_LEGACY_MMC(devtypeu, devtypel, instance) \
+	#devtypel #instance " "
+
+#define BOOTENV_DEV_NAND(devtypeu, devtypel, instance) \
+	"bootcmd_" #devtypel #instance "=" \
+	"run nandboot\0"
+
+#define BOOTENV_DEV_NAME_NAND(devtypeu, devtypel, instance) \
+	#devtypel #instance " "
+
+#define BOOT_TARGET_DEVICES(func) \
+	func(MMC, mmc, 0) \
+	func(LEGACY_MMC, legacy_mmc, 0) \
+	func(MMC, mmc, 1) \
+	func(LEGACY_MMC, legacy_mmc, 1) \
+	func(NAND, nand, 0)
+
+#include <config_distro_bootcmd.h>
+#include <environment/ti/dfu.h>
+#include <environment/ti/mmc.h>
+
+#define CONFIG_EXTRA_ENV_SETTINGS \
+	DEFAULT_MMC_TI_ARGS \
+	DEFAULT_LINUX_BOOT_ENV \
+	"bootfile=zImage\0" \
+	"fdtfile=" CONFIG_DEFAULT_FDT_FILE "\0" \
+	"console=ttyO0,115200n8\0" \
+	"optargs=\0" \
+	"mmcrootfstype=ext2 rootwait\0" \
+	"finduuid=part uuid mmc ${rootpart} uuid\0" \
+	"boot_fit=0\0" \
+	NANDARGS \
+	BOOTENV
+
+/* Clock Defines */
+#define V_OSCK				25000000  /* Clock output from T2 */
+#define V_SCLK				(V_OSCK)
+
+#define CONFIG_POWER_TPS65910
+
+#ifdef CONFIG_NAND
+/* NAND: device related configs */
+#define CONFIG_SYS_NAND_5_ADDR_CYCLE
+#define CONFIG_SYS_NAND_PAGE_COUNT	(CONFIG_SYS_NAND_BLOCK_SIZE / \
+					 CONFIG_SYS_NAND_PAGE_SIZE)
+#define CONFIG_SYS_NAND_PAGE_SIZE	2048
+#define CONFIG_SYS_NAND_OOBSIZE		64
+#define CONFIG_SYS_NAND_BLOCK_SIZE	(128 * 1024)
+/* NAND: driver related configs */
+#define CONFIG_SYS_NAND_BAD_BLOCK_POS	NAND_LARGE_BADBLOCK_POS
+#define CONFIG_SYS_NAND_ECCPOS		{ 2, 3, 4, 5, 6, 7, 8, 9, \
+					 10, 11, 12, 13, 14, 15, 16, 17, \
+					 18, 19, 20, 21, 22, 23, 24, 25, \
+					 26, 27, 28, 29, 30, 31, 32, 33, \
+					 34, 35, 36, 37, 38, 39, 40, 41, \
+					 42, 43, 44, 45, 46, 47, 48, 49, \
+					 50, 51, 52, 53, 54, 55, 56, 57, }
+
+#define CONFIG_SYS_NAND_ECCSIZE		512
+#define CONFIG_SYS_NAND_ECCBYTES	14
+#define CONFIG_SYS_NAND_ONFI_DETECTION

include/configs/phycore_pcl060.h line 121

Quoted 10 lines
include/configs/phycore_pcl060.h new file +10 -0
+#define CONFIG_NAND_OMAP_ECCSCHEME	OMAP_ECC_BCH8_CODE_HW
+
+/* NAND: SPL related configs */
+#ifdef CONFIG_SPL_OS_BOOT
+#define CONFIG_SYS_NAND_SPL_KERNEL_OFFS	0x00200000 /* kernel offset */
+#endif
+#endif /* !CONFIG_NAND */
+
+#define CONFIG_SYS_BAUDRATE_TABLE	{ 110, 300, 600, 1200, 2400, \
+4800, 9600, 14400, 19200, 28800, 38400, 56000, 57600, 115200 }

I think there's a default value for that in include/config_fallbacks.h , why do you override it here ?

Quoted 7 lines
include/configs/phycore_pcl060.h new file +7 -0
+/* CPU */
+
+#ifdef CONFIG_SPI_BOOT
+#define CONFIG_SYS_SPI_U_BOOT_OFFS	0x20000
+#define CONFIG_SYS_SPI_U_BOOT_SIZE	0x40000
+#elif defined(CONFIG_ENV_IS_IN_NAND)
+#define CONFIG_ENV_OFFSET		0x000a0000

include/configs/phycore_pcl060.h line 139

Quoted 10 lines
include/configs/phycore_pcl060.h new file +10 -0
+#define CONFIG_SYS_ENV_SECT_SIZE	CONFIG_SYS_NAND_BLOCK_SIZE
+#endif
+
+/*
+ * USB configuration
+ */
+#define CONFIG_AM335X_USB0
+#define CONFIG_AM335X_USB0_MODE	MUSB_PERIPHERAL
+#define CONFIG_AM335X_USB1
+#define CONFIG_AM335X_USB1_MODE MUSB_HOST

Can't the USB settings be extracted from DT ?

Signature · 6 lines
Thanks,
Parthiban N

DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-22 Fax: (+49)-8142-66989-80 Email: pn at denx.de
#3 lore raw

PATCH 1/1 phycore-pcl060: U-boot support for Phytec phyCORE PCL060

On 4/19/19 3:18 PM, Parthiban Nallathambi wrote:

Hi,

[...]

Quoted 27 lines
Quoted 12 lines

arch/arm/mach-omap2/Kconfig source "board/ti/am43xx/Kconfig" · line 189

Quoted 9 lines
arch/arm/mach-omap2/Kconfig +1 -0
index d29f1ca0b5..9336439340 100644
@@ -186,6 +186,7 @@ source "board/ti/am43xx/Kconfig"
 source "board/ti/am335x/Kconfig"
 source "board/compulab/cm_t335/Kconfig"
 source "board/compulab/cm_t43/Kconfig"
+source "board/phytec/phycore_pcl060/Kconfig"

Here [1] it says the name of the SoM is PCM-060 , what is PCL-060 ?

Quoted 3 lines

[1]
https://www.phytec.eu/product-eu/system-on-modules/phycore-am335x-download/
[...]

This differs only by the connector. PCM variants are pluggable and PCL variants are direct soliderable to the carrier board.

Copied from [1]:
The PCL-060 System On Module is a connector-less, BGA style variant of the PCM-060/phyCORE-AM335x R2 SOM. Unlike traditional Phytec SOM products that support high density connectors, the PCL-060 SOM is directly soldered down to the phyBOARD-Wega AM335x using Phytec's Direct Solder Connect technology (DSC). This solution offers an ultra-low cost Single Board Computer for the AM335x processor, while maintaining most of the advantages of the SOM concept.

Quoted 1 line

[1] https://www.phytec.de/fileadmin/user_upload/downloads/Manuals/L-845e_1.pdf

Ah damn, this looks like a consistency problem is coming up. We have multiple PCM* SoMs in U-Boot, one PCL* SoM and now another PCL/PCM SoM. But the PCL063 isn't even manufactured in variant with connectors, so I guess we can ignore that one.

I wonder whether we should stick to PCM* for all of the Phytec SoMs for consistency sake and document that PCL060 is also supported or maybe there's a better way ?

[...]

Signature · 2 lines
Best regards,
Marek Vasut
#4 lore raw

PATCH 1/1 phycore-pcl060: U-boot support for Phytec phyCORE PCL060

Hello Marek,

Quoted 35 lines · Marek Vasut

On 4/19/19 3:18 PM, Parthiban Nallathambi wrote:

Hi,

[...]

Quoted 27 lines
Quoted 12 lines

arch/arm/mach-omap2/Kconfig source "board/ti/am43xx/Kconfig" · line 189

Quoted 9 lines
arch/arm/mach-omap2/Kconfig +1 -0
index d29f1ca0b5..9336439340 100644
@@ -186,6 +186,7 @@ source "board/ti/am43xx/Kconfig"
 source "board/ti/am335x/Kconfig"
 source "board/compulab/cm_t335/Kconfig"
 source "board/compulab/cm_t43/Kconfig"
+source "board/phytec/phycore_pcl060/Kconfig"

Here [1] it says the name of the SoM is PCM-060 , what is PCL-060 ?

Quoted 3 lines

[1]
https://www.phytec.eu/product-eu/system-on-modules/phycore-am335x-download/
[...]

This differs only by the connector. PCM variants are pluggable and PCL variants are direct soliderable to the carrier board.

Copied from [1]:
The PCL-060 System On Module is a connector-less, BGA style variant of the PCM-060/phyCORE-AM335x R2 SOM. Unlike traditional Phytec SOM products that support high density connectors, the PCL-060 SOM is directly soldered down to the phyBOARD-Wega AM335x using Phytec's Direct Solder Connect technology (DSC). This solution offers an ultra-low cost Single Board Computer for the AM335x processor, while maintaining most of the advantages of the SOM concept.

Quoted 1 line

[1] https://www.phytec.de/fileadmin/user_upload/downloads/Manuals/L-845e_1.pdf

Quoted 8 lines

Ah damn, this looks like a consistency problem is coming up. We have multiple PCM* SoMs in U-Boot, one PCL* SoM and now another PCL/PCM SoM. But the PCL063 isn't even manufactured in variant with connectors, so I guess we can ignore that one.

I wonder whether we should stick to PCM* for all of the Phytec SoMs for consistency sake and document that PCL060 is also supported or maybe there's a better way ?

Does PCX/PCx makes sense? But we have the same problem with variscite [1] SoM's (either SODIMM or solderable).

[1] https://lists.denx.de/pipermail/u-boot/2019-April/365667.html

Quoted 3 lines

[...]

Signature · 6 lines
Thanks,
Parthiban N

DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-22 Fax: (+49)-8142-66989-80 Email: pn at denx.de
#5 lore raw

PATCH 1/1 phycore-pcl060: U-boot support for Phytec phyCORE PCL060

Quoted 43 lines · Parthiban Nallathambi

Hello Marek,

Quoted 40 lines · Marek Vasut

On 4/19/19 3:18 PM, Parthiban Nallathambi wrote:

Hi,

[...]

Quoted 27 lines
Quoted 12 lines

arch/arm/mach-omap2/Kconfig source "board/ti/am43xx/Kconfig" · line 189

Quoted 9 lines
arch/arm/mach-omap2/Kconfig +1 -0
index d29f1ca0b5..9336439340 100644
@@ -186,6 +186,7 @@ source "board/ti/am43xx/Kconfig"
 source "board/ti/am335x/Kconfig"
 source "board/compulab/cm_t335/Kconfig"
 source "board/compulab/cm_t43/Kconfig"
+source "board/phytec/phycore_pcl060/Kconfig"

Here [1] it says the name of the SoM is PCM-060 , what is PCL-060 ?

Quoted 3 lines

[1]
https://www.phytec.eu/product-eu/system-on-modules/phycore-am335x-download/
[...]

This differs only by the connector. PCM variants are pluggable and PCL variants are direct soliderable to the carrier board.

Copied from [1]:
The PCL-060 System On Module is a connector-less, BGA style variant of the PCM-060/phyCORE-AM335x R2 SOM. Unlike traditional Phytec SOM products that support high density connectors, the PCL-060 SOM is directly soldered down to the phyBOARD-Wega AM335x using Phytec's Direct Solder Connect technology (DSC). This solution offers an ultra-low cost Single Board Computer for the AM335x processor, while maintaining most of the advantages of the SOM concept.

Quoted 1 line

[1] https://www.phytec.de/fileadmin/user_upload/downloads/Manuals/L-845e_1.pdf

Ah damn, this looks like a consistency problem is coming up. We have multiple PCM* SoMs in U-Boot, one PCL* SoM and now another PCL/PCM SoM. But the PCL063 isn't even manufactured in variant with connectors, so I guess we can ignore that one.

Quoted 8 lines
Quoted 3 lines

I wonder whether we should stick to PCM* for all of the Phytec SoMs for consistency sake and document that PCL060 is also supported or maybe there's a better way ?

Does PCX/PCx makes sense? But we have the same problem with variscite [1] SoM's (either SODIMM or solderable).

[1] https://lists.denx.de/pipermail/u-boot/2019-April/365667.html

PCX would introduce another option, in addition to PCM/PCL, one which cannot be easily found on the internet, so I'd like to avoid that. I am banking toward the sticking with PCM where possible (simply because that's what $searchengine spits out first when you look for that SoM, and because we already have plenty of PCM-nnn SoMs), but maybe someone has a better idea .

Signature · 2 lines
Best regards,
Marek Vasut
#6 lore raw

PATCH 1/1 phycore-pcl060: U-boot support for Phytec phyCORE PCL060

Hi,

Quoted 47 lines · Marek Vasut
Quoted 46 lines · Parthiban Nallathambi

Hello Marek,

Quoted 32 lines · Marek Vasut

On 4/19/19 3:18 PM, Parthiban Nallathambi wrote:

Hi,

[...]

Quoted 25 lines
Quoted 11 lines

arch/arm/mach-omap2/Kconfig source "board/ti/am43xx/Kconfig" · line 189

Quoted 9 lines
arch/arm/mach-omap2/Kconfig +1 -0
index d29f1ca0b5..9336439340 100644
@@ -186,6 +186,7 @@ source "board/ti/am43xx/Kconfig"
 source "board/ti/am335x/Kconfig"
 source "board/compulab/cm_t335/Kconfig"
 source "board/compulab/cm_t43/Kconfig"
+source "board/phytec/phycore_pcl060/Kconfig"

Here [1] it says the name of the SoM is PCM-060 , what is PCL-060 ?

Quoted 3 lines

[1]
https://www.phytec.eu/product-eu/system-on-modules/phycore-am335x-download/
[...]

This differs only by the connector. PCM variants are pluggable and PCL variants are direct soliderable to the carrier board.

Copied from [1]:
The PCL-060 System On Module is a connector-less, BGA style variant of the PCM-060/phyCORE-AM335x R2 SOM. Unlike traditional Phytec SOM products that support high density connectors, the PCL-060 SOM is directly soldered down to the phyBOARD-Wega AM335x using Phytec's Direct Solder Connect technology (DSC). This solution offers an ultra-low cost Single Board Computer for the AM335x processor, while maintaining most of the advantages of the SOM concept.

Quoted 1 line

[1] https://www.phytec.de/fileadmin/user_upload/downloads/Manuals/L-845e_1.pdf

Quoted 8 lines

Ah damn, this looks like a consistency problem is coming up. We have multiple PCM* SoMs in U-Boot, one PCL* SoM and now another PCL/PCM SoM. But the PCL063 isn't even manufactured in variant with connectors, so I guess we can ignore that one.

I wonder whether we should stick to PCM* for all of the Phytec SoMs for consistency sake and document that PCL060 is also supported or maybe there's a better way ?

Does PCX/PCx makes sense? But we have the same problem with variscite [1] SoM's (either SODIMM or solderable).

Quoted 7 lines
Quoted 1 line

[1] https://lists.denx.de/pipermail/u-boot/2019-April/365667.html

PCX would introduce another option, in addition to PCM/PCL, one which cannot be easily found on the internet, so I'd like to avoid that. I am banking toward the sticking with PCM where possible (simply because that's what $searchengine spits out first when you look for that SoM, and because we already have plenty of PCM-nnn SoMs), but maybe someone has a better idea .

why not simply use the full name of the module instead?

- phyCORE-AM335x
- phyCORE-AM335x R2

I did the same for the phyCORE-RK3288.
There is no real difference between a PCM and PCL SOM. You can take look at the barebox code for this modules to get some inspiration on how to handle the different SOM variants.

Â
https://git.pengutronix.de/cgit/barebox/tree/arch/arm/boards/phytec-som-am335x

Regards,
Wadim

Quoted 1 line
#7 lore raw

PATCH 1/1 phycore-pcl060: U-boot support for Phytec phyCORE PCL060

Quoted 58 lines · Wadim Egorov

Hi,

Quoted 47 lines · Marek Vasut
Quoted 46 lines · Parthiban Nallathambi

Hello Marek,

Quoted 32 lines · Marek Vasut

On 4/19/19 3:18 PM, Parthiban Nallathambi wrote:

Hi,

[...]

Quoted 25 lines
Quoted 11 lines

arch/arm/mach-omap2/Kconfig source "board/ti/am43xx/Kconfig" · line 189

Quoted 9 lines
arch/arm/mach-omap2/Kconfig +1 -0
index d29f1ca0b5..9336439340 100644
@@ -186,6 +186,7 @@ source "board/ti/am43xx/Kconfig"
 source "board/ti/am335x/Kconfig"
 source "board/compulab/cm_t335/Kconfig"
 source "board/compulab/cm_t43/Kconfig"
+source "board/phytec/phycore_pcl060/Kconfig"

Here [1] it says the name of the SoM is PCM-060 , what is PCL-060 ?

Quoted 3 lines

[1]
https://www.phytec.eu/product-eu/system-on-modules/phycore-am335x-download/
[...]

This differs only by the connector. PCM variants are pluggable and PCL variants are direct soliderable to the carrier board.

Copied from [1]:
The PCL-060 System On Module is a connector-less, BGA style variant of the PCM-060/phyCORE-AM335x R2 SOM. Unlike traditional Phytec SOM products that support high density connectors, the PCL-060 SOM is directly soldered down to the phyBOARD-Wega AM335x using Phytec's Direct Solder Connect technology (DSC). This solution offers an ultra-low cost Single Board Computer for the AM335x processor, while maintaining most of the advantages of the SOM concept.

Quoted 1 line

[1] https://www.phytec.de/fileadmin/user_upload/downloads/Manuals/L-845e_1.pdf

Quoted 8 lines

Ah damn, this looks like a consistency problem is coming up. We have multiple PCM* SoMs in U-Boot, one PCL* SoM and now another PCL/PCM SoM. But the PCL063 isn't even manufactured in variant with connectors, so I guess we can ignore that one.

I wonder whether we should stick to PCM* for all of the Phytec SoMs for consistency sake and document that PCL060 is also supported or maybe there's a better way ?

Does PCX/PCx makes sense? But we have the same problem with variscite [1] SoM's (either SODIMM or solderable).

Quoted 7 lines
Quoted 1 line

[1] https://lists.denx.de/pipermail/u-boot/2019-April/365667.html

PCX would introduce another option, in addition to PCM/PCL, one which cannot be easily found on the internet, so I'd like to avoid that. I am banking toward the sticking with PCM where possible (simply because that's what $searchengine spits out first when you look for that SoM, and because we already have plenty of PCM-nnn SoMs), but maybe someone has a better idea .

Quoted 6 lines

why not simply use the full name of the module instead?

- phyCORE-AM335x
- phyCORE-AM335x R2

I did the same for the phyCORE-RK3288.

Well, that's fine by me, and I think it's better than the pcm060 or pcl060 too. Let's go with this, unless there are objections.

Signature · 2 lines
Best regards,
Marek Vasut
#8 lore raw

PATCH 1/1 phycore-pcl060: U-boot support for Phytec phyCORE PCL060

In reply to Marek Vasut

Hi All,

Quoted 9 lines · Marek Vasut
Quoted 6 lines
---
  arch/arm/dts/Makefile                    |   3 +-
  arch/arm/dts/am335x-phycore-som.dtsi     | 327 ++++++++++++++++++++++
  arch/arm/dts/am335x-wega-rdk-u-boot.dtsi |  35 +++
  arch/arm/dts/am335x-wega-rdk.dts         |  23 ++
  arch/arm/dts/am335x-wega.dtsi            | 231 +++++++++++++++

The DTs come from Linux kernel, but which version of Linux ? Which exact commit ? Did you modify them in any way ?

I pulled these in from current Linux Mainline. I added SPDX headers and reformatted some lines to for line length (but I have reverted the line lengths in my follow-up patch).

Quoted 9 lines

[...]

Here [1] it says the name of the SoM is PCM-060 , what is PCL-060 ?

[1]
https://www.phytec.eu/product-eu/system-on-modules/phycore-am335x-download/
[...]

I renamed everything to variants of phycore_am335x_r2 as previously discussed.

Quoted 4 lines

DRAM size should come from DT, we don't need another custom config option. Look at fdtdec_setup_mem_size_base() and fdtdec_setup_memory_banksize().

Done, thank you for the suggestion. I also took inspiration for the data structure as suggested by Wadim Egorov.

Quoted 7 lines
Quoted 7 lines
include/configs/phycore_pcl060.h new file +0 -0
new file mode 100644
index 0000000000..982c96b267
@@ -0,0 +1,141 @@

[...]

Quoted 9 lines

include/configs/phycore_pcl060.h line 139

Quoted 7 lines
include/configs/phycore_pcl060.h new file +7 -0
+/*
+ * USB configuration
+ */
+#define CONFIG_AM335X_USB0
+#define CONFIG_AM335X_USB0_MODE	MUSB_PERIPHERAL
+#define CONFIG_AM335X_USB1
+#define CONFIG_AM335X_USB1_MODE MUSB_HOST

Can't the USB settings be extracted from DT ?

Unfortunately, these defines are referenced within arch/arm/mach-omap2/am335x/board.c, which I would rather not want to break at this time.

Other than that, I implemented all points, along with some further refinement/clean-up.

Best regards,
Niel Fourie

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-21 Fax: +49-8142-66989-80  Email: lusus at denx.de
#9 lore raw

PATCH 1/1 phycore-pcl060: U-boot support for Phytec phyCORE PCL060

Quoted 1 line · Niel Fourie

Hi All,

Hi,

Quoted 8 lines · Marek Vasut
Quoted 7 lines
Quoted 6 lines

---
  arch/arm/dts/Makefile                    |   3 +- arch/arm/dts/am335x-phycore-som.dtsi     | 327 ++++++++++++++++++++++ arch/arm/dts/am335x-wega-rdk-u-boot.dtsi |  35 +++ arch/arm/dts/am335x-wega-rdk.dts         |  23 ++ arch/arm/dts/am335x-wega.dtsi            | 231 +++++++++++++++

Quoted 6 lines
Quoted 2 lines

The DTs come from Linux kernel, but which version of Linux ? Which exact commit ? Did you modify them in any way ?

I pulled these in from current Linux Mainline. I added SPDX headers and reformatted some lines to for line length (but I have reverted the line lengths in my follow-up patch).

The commit message should contain the commit ID in Linux from which the files came , since when someone decides to upgrade those files in the future, they will be able to generate a diff from that commit to Linux version that's current at that point. Please add it.

Quoted 43 lines
Quoted 10 lines

[...]

Here [1] it says the name of the SoM is PCM-060 , what is PCL-060 ?

[1]
https://www.phytec.eu/product-eu/system-on-modules/phycore-am335x-download/

  [...]

I renamed everything to variants of phycore_am335x_r2 as previously discussed.

Quoted 4 lines

DRAM size should come from DT, we don't need another custom config option. Look at fdtdec_setup_mem_size_base() and fdtdec_setup_memory_banksize().

Done, thank you for the suggestion. I also took inspiration for the data structure as suggested by Wadim Egorov.

Quoted 8 lines
Quoted 8 lines
include/configs/phycore_pcl060.h new file +0 -0
new file mode 100644
index 0000000000..982c96b267
@@ -0,0 +1,141 @@

[...]

Quoted 9 lines

include/configs/phycore_pcl060.h line 139

Quoted 7 lines
include/configs/phycore_pcl060.h new file +7 -0
+/*
+ * USB configuration
+ */
+#define CONFIG_AM335X_USB0
+#define CONFIG_AM335X_USB0_MODE    MUSB_PERIPHERAL
+#define CONFIG_AM335X_USB1
+#define CONFIG_AM335X_USB1_MODE MUSB_HOST

Can't the USB settings be extracted from DT ?

Quoted 3 lines

Unfortunately, these defines are referenced within arch/arm/mach-omap2/am335x/board.c, which I would rather not want to break at this time.

Take a look at configs/am335x_evm_defconfig:CONFIG_DM_USB_GADGET=y

Maybe we can at least get rid of some of the hard-coded USB non-DM stuff.

Signature · 2 lines
Best regards,
Marek Vasut
#10 lore raw

PATCH 1/1 phycore-pcl060: U-boot support for Phytec phyCORE PCL060

On Thu, Apr 25, 2019 at 1:33 PM Marek Vasut <[email protected]> wrote:
[..]

Quoted 4 lines

The commit message should contain the commit ID in Linux from which the files came , since when someone decides to upgrade those files in the future, they will be able to generate a diff from that commit to Linux version that's current at that point. Please add it.

+1

--
Best regards,
Eugeniu.