Skip to contentSkip to conversation

Switch ARM i.MX27 PCM-038/PCM-970 to devicetree probe

RFC PATCH In review Alexander Shiyan 2 participants 8 messages Apr 6, 2014 – Apr 7, 2014

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

cover Switch ARM i.MX27 PCM-038/PCM-970 to devicetree probe

It is only RFC for now.
Known issues:
- PMIC is not detected after "reset" command.

Alexander Shiyan (2):
ARM: dts: Add devicetree files for Phytec PCM-038/PCM-970
ARM: PCM038: Switch to devicetree probe

 arch/arm/boards/phytec-phycore-imx27/Makefile      |   5 +-
 arch/arm/boards/phytec-phycore-imx27/env/boot/nor  |   9 +
 .../boards/phytec-phycore-imx27/env/config-board   |   7 +-
 .../phytec-phycore-imx27/env/init/mtdparts-nand    |  11 -
 .../phytec-phycore-imx27/env/init/mtdparts-nor     |  11 -
 arch/arm/boards/phytec-phycore-imx27/pcm038.c      | 358 +++------------------
 arch/arm/boards/phytec-phycore-imx27/pcm970.c      | 201 ++++--------
 arch/arm/configs/phytec-phycore-imx27_defconfig    |  62 ++--
 arch/arm/dts/Makefile                              |   3 +-
 arch/arm/dts/imx27-phytec-phycore-rdk-bb.dts       |  64 ++++
 arch/arm/dts/imx27-phytec-phycore-rdk.dts          | 289 +++++++++++++++++
 arch/arm/dts/imx27-phytec-phycore-som.dtsi         | 333 +++++++++++++++++++
 arch/arm/mach-imx/Kconfig                          |  14 +-
 13 files changed, 849 insertions(+), 518 deletions(-)
 create mode 100644 arch/arm/boards/phytec-phycore-imx27/env/boot/nor
 delete mode 100644 arch/arm/boards/phytec-phycore-imx27/env/init/mtdparts-nand
 delete mode 100644 arch/arm/boards/phytec-phycore-imx27/env/init/mtdparts-nor
 create mode 100644 arch/arm/dts/imx27-phytec-phycore-rdk-bb.dts
 create mode 100644 arch/arm/dts/imx27-phytec-phycore-rdk.dts
 create mode 100644 arch/arm/dts/imx27-phytec-phycore-som.dtsi
Signature · 7 lines
1.8.3.2


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#1 lore raw

RFC PATCH 1/2 ARM: dts: Add devicetree files for Phytec PCM-038/PCM-970

---
 arch/arm/dts/Makefile                        |   3 +-
 arch/arm/dts/imx27-phytec-phycore-rdk-bb.dts |  64 +++++
 arch/arm/dts/imx27-phytec-phycore-rdk.dts    | 289 +++++++++++++++++++++++
 arch/arm/dts/imx27-phytec-phycore-som.dtsi   | 333 +++++++++++++++++++++++++++
 4 files changed, 688 insertions(+), 1 deletion(-)
 create mode 100644 arch/arm/dts/imx27-phytec-phycore-rdk-bb.dts
 create mode 100644 arch/arm/dts/imx27-phytec-phycore-rdk.dts
 create mode 100644 arch/arm/dts/imx27-phytec-phycore-som.dtsi
arch/arm/dts/Makefile +2 -1
index b45c174..ca1e5b8 100644
@@ -3,7 +3,8 @@ dtb-$(CONFIG_ARCH_AM33XX) += \
 	am335x-boneblack.dtb \
 	am335x-phytec-phycore.dtb
 dtb-$(CONFIG_ARCH_IMX25) += imx25-karo-tx25.dtb
-dtb-$(CONFIG_ARCH_IMX27) += imx27-phytec-phycard-s-rdk-bb.dtb
+dtb-$(CONFIG_ARCH_IMX27) += imx27-phytec-phycard-s-rdk-bb.dtb \
+	imx27-phytec-phycore-rdk-bb.dtb
 dtb-$(CONFIG_ARCH_IMX51) += imx51-babbage.dtb \
 	imx51-genesi-efika-sb.dtb
 dtb-$(CONFIG_ARCH_IMX53) += imx53-mba53.dtb \
arch/arm/dts/imx27-phytec-phycore-rdk-bb.dts new file +64 -0

64 lines not on this page · raw message

arch/arm/dts/imx27-phytec-phycore-rdk.dts new file +289 -0

289 lines not on this page · raw message

arch/arm/dts/imx27-phytec-phycore-som.dtsi new file +333 -0

333 lines not on this page · raw message

Signature · 7 lines
1.8.3.2


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#2 lore raw

RFC PATCH 2/2 ARM: PCM038: Switch to devicetree probe

In reply to Alexander Shiyan

This patch removes non-DT support for PCM-038/PCM-970 and switch to devicetree probe for these targets.

---
 arch/arm/boards/phytec-phycore-imx27/Makefile      |   5 +-
 arch/arm/boards/phytec-phycore-imx27/env/boot/nor  |   9 +
 .../boards/phytec-phycore-imx27/env/config-board   |   7 +-
 .../phytec-phycore-imx27/env/init/mtdparts-nand    |  11 -
 .../phytec-phycore-imx27/env/init/mtdparts-nor     |  11 -
 arch/arm/boards/phytec-phycore-imx27/pcm038.c      | 358 +++------------------
 arch/arm/boards/phytec-phycore-imx27/pcm970.c      | 201 ++++--------
 arch/arm/configs/phytec-phycore-imx27_defconfig    |  62 ++--
 arch/arm/mach-imx/Kconfig                          |  14 +-
 9 files changed, 161 insertions(+), 517 deletions(-)
 create mode 100644 arch/arm/boards/phytec-phycore-imx27/env/boot/nor
 delete mode 100644 arch/arm/boards/phytec-phycore-imx27/env/init/mtdparts-nand
 delete mode 100644 arch/arm/boards/phytec-phycore-imx27/env/init/mtdparts-nor
arch/arm/boards/phytec-phycore-imx27/Makefile +2 -3
index bfb55d3..eb82f0d 100644
@@ -1,3 +1,2 @@
-obj-y					+= pcm038.o
-lwl-y				+= lowlevel.o
-obj-$(CONFIG_MACH_PCM970_BASEBOARD)	+= pcm970.o
+obj-y	+= pcm038.o pcm970.o
+lwl-y	+= lowlevel.o
arch/arm/boards/phytec-phycore-imx27/env/boot/nor new file +9 -0
new file mode 100644
index 0000000..0d10584
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+if [ "$1" = menu ]; then
+	boot-menu-add-entry "$0" "nor"
+	exit
+fi
+
+global.bootm.image="/dev/nor0.kernel"
+global.linux.bootargs.dyn.root="root=/dev/mtdblock3 ro"
arch/arm/boards/phytec-phycore-imx27/env/config-board +4 -3
index e8e8378..9fec434 100644
@@ -1,6 +1,7 @@
 #!/bin/sh
 
-# board defaults, do not change in running system. Change /env/config
-# instead
+# Default boot entry (one of /env/boot/*)
+global.boot.default=nor
 
-global.linux.bootargs.base="console=ttymxc0,115200"
+# Board bootargs
+global.linux.bootargs.base="earlyprintk"
arch/arm/boards/phytec-phycore-imx27/env/init/mtdparts-nand deleted +0 -11
deleted file mode 100644
index 84220b7..0000000
@@ -1,11 +0,0 @@
-#!/bin/sh
-
-if [ "$1" = menu ]; then
-	init-menu-add-entry "$0" "NAND partitions"
-	exit
-fi
-
-mtdparts="512k(nand0.barebox)ro,128k(nand0.bareboxenv),4M(nand0.kernel),-(nand0.root)"
-kernelname="mxc_nand"
-
-mtdparts-add -b -d nand0 -k ${kernelname} -p ${mtdparts}
arch/arm/boards/phytec-phycore-imx27/env/init/mtdparts-nor deleted +0 -11
deleted file mode 100644
index c2c4065..0000000
@@ -1,11 +0,0 @@
-#!/bin/sh
-
-if [ "$1" = menu ]; then
-	init-menu-add-entry "$0" "NOR partitions"
-	exit
-fi
-
-mtdparts="512k(nor0.barebox)ro,128k(nor0.bareboxenv),4M(nor0.kernel),-(nor0.root)"
-kernelname="physmap-flash.0"
-
-mtdparts-add -d nor0 -k ${kernelname} -p ${mtdparts}
arch/arm/boards/phytec-phycore-imx27/pcm038.c +39 -319

415 lines not on this page · raw message

arch/arm/boards/phytec-phycore-imx27/pcm970.c +68 -133

237 lines not on this page · raw message

arch/arm/configs/phytec-phycore-imx27_defconfig +38 -24

115 lines not on this page · raw message

arch/arm/mach-imx/Kconfig +1 -13
index d40c944..07c3b53 100644
@@ -338,22 +338,10 @@ config MACH_PCA100
 config MACH_PCM038
 	bool "phyCORE-i.MX27"
 	select ARCH_IMX27
-	select IMX_IIM
-	select SPI
-	select DRIVER_SPI_IMX
-	select MFD_MC13XXX
 	select HAVE_DEFAULT_ENVIRONMENT_NEW
 	help
 	  Say Y here if you are using Phytec's phyCORE-i.MX27 (pcm038) equipped
-	  with a Freescale i.MX27 Processor
-
-config MACH_PCM970_BASEBOARD
-	bool "PHYTEC PCM970 development board"
-	depends on MACH_PCM038
-	default y
-	help
-	  This adds board specific devices that can be found on Phytec's
-	  PCM970 evaluation board.
+	  with a Freescale i.MX27 Processor.
 
 config MACH_NESO
 	bool "Garz+Fricke Neso"
Signature · 7 lines
1.8.3.2


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
maintainer
#4 lore raw
In reply to Alexander Shiyan
Quoted 3 lines · Alexander Shiyan

It is only RFC for now.
Known issues:
- PMIC is not detected after "reset" command.

Is this issure introduced with this series? strange.

Sascha

Signature · 9 lines
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
maintainer
#3 lore raw

Re: [PATCH RFC 2/2] ARM: PCM038: Switch to devicetree probe

In reply to Alexander Shiyan
Quoted 205 lines · Alexander Shiyan

This patch removes non-DT support for PCM-038/PCM-970 and switch to devicetree probe for these targets.

---
 arch/arm/boards/phytec-phycore-imx27/Makefile      |   5 +-
 arch/arm/boards/phytec-phycore-imx27/env/boot/nor  |   9 +
 .../boards/phytec-phycore-imx27/env/config-board   |   7 +-
 .../phytec-phycore-imx27/env/init/mtdparts-nand    |  11 -
 .../phytec-phycore-imx27/env/init/mtdparts-nor     |  11 -
 arch/arm/boards/phytec-phycore-imx27/pcm038.c      | 358 +++------------------
 arch/arm/boards/phytec-phycore-imx27/pcm970.c      | 201 ++++--------
 arch/arm/configs/phytec-phycore-imx27_defconfig    |  62 ++--
 arch/arm/mach-imx/Kconfig                          |  14 +-
 9 files changed, 161 insertions(+), 517 deletions(-)
 create mode 100644 arch/arm/boards/phytec-phycore-imx27/env/boot/nor
 delete mode 100644 arch/arm/boards/phytec-phycore-imx27/env/init/mtdparts-nand
 delete mode 100644 arch/arm/boards/phytec-phycore-imx27/env/init/mtdparts-nor
arch/arm/boards/phytec-phycore-imx27/Makefile +2 -3
index bfb55d3..eb82f0d 100644
@@ -1,3 +1,2 @@
-obj-y					+= pcm038.o
-lwl-y				+= lowlevel.o
-obj-$(CONFIG_MACH_PCM970_BASEBOARD)	+= pcm970.o
+obj-y	+= pcm038.o pcm970.o
+lwl-y	+= lowlevel.o
arch/arm/boards/phytec-phycore-imx27/env/boot/nor new file +9 -0
new file mode 100644
index 0000000..0d10584
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+if [ "$1" = menu ]; then
+	boot-menu-add-entry "$0" "nor"
+	exit
+fi
+
+global.bootm.image="/dev/nor0.kernel"
+global.linux.bootargs.dyn.root="root=/dev/mtdblock3 ro"
arch/arm/boards/phytec-phycore-imx27/env/config-board +4 -3
index e8e8378..9fec434 100644
@@ -1,6 +1,7 @@
 #!/bin/sh
 
-# board defaults, do not change in running system. Change /env/config
-# instead
+# Default boot entry (one of /env/boot/*)
+global.boot.default=nor
 
-global.linux.bootargs.base="console=ttymxc0,115200"
+# Board bootargs
+global.linux.bootargs.base="earlyprintk"
arch/arm/boards/phytec-phycore-imx27/env/init/mtdparts-nand deleted +0 -11
deleted file mode 100644
index 84220b7..0000000
@@ -1,11 +0,0 @@
-#!/bin/sh
-
-if [ "$1" = menu ]; then
-	init-menu-add-entry "$0" "NAND partitions"
-	exit
-fi
-
-mtdparts="512k(nand0.barebox)ro,128k(nand0.bareboxenv),4M(nand0.kernel),-(nand0.root)"
-kernelname="mxc_nand"
-
-mtdparts-add -b -d nand0 -k ${kernelname} -p ${mtdparts}
arch/arm/boards/phytec-phycore-imx27/env/init/mtdparts-nor deleted +0 -11
deleted file mode 100644
index c2c4065..0000000
@@ -1,11 +0,0 @@
-#!/bin/sh
-
-if [ "$1" = menu ]; then
-	init-menu-add-entry "$0" "NOR partitions"
-	exit
-fi
-
-mtdparts="512k(nor0.barebox)ro,128k(nor0.bareboxenv),4M(nor0.kernel),-(nor0.root)"
-kernelname="physmap-flash.0"
-
-mtdparts-add -d nor0 -k ${kernelname} -p ${mtdparts}
arch/arm/boards/phytec-phycore-imx27/pcm038.c +8 -64
index 7df0ddc..6f74322 100644
@@ -10,79 +10,27 @@
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- *
- *
  */
+
 #define pr_fmt(fmt) "pcm038: " fmt
 
 #include <common.h>
-#include <bootsource.h>
-#include <net.h>
-#include <init.h>
-#include <environment.h>
-#include <mach/imx27-regs.h>
-#include <fec.h>
-#include <sizes.h>
-#include <notifier.h>
 #include <gpio.h>
-#include <asm/armlinux.h>
-#include <generated/mach-types.h>
-#include <partition.h>
-#include <fs.h>
-#include <nand.h>
-#include <spi/spi.h>
+#include <init.h>
 #include <io.h>
-#include <mach/imx-nand.h>
+#include <notifier.h>
+#include <sizes.h>
+#include <mach/devices-imx27.h>
 #include <mach/imx-pll.h>
-#include <mach/weim.h>
+#include <mach/imx27-regs.h>
 #include <mach/imxfb.h>
-#include <i2c/i2c.h>
-#include <mach/spi.h>
 #include <mach/iomux-mx27.h>
-#include <mach/devices-imx27.h>
-#include <mach/iim.h>
 #include <mfd/mc13xxx.h>
-#include <mach/generic.h>
 
 #include "pll.h"
 
-#define PCM038_GPIO_PMIC_IRQ	(GPIO_PORTB + 23)
-#define PCM038_GPIO_FEC_RST	(GPIO_PORTC + 30)
-#define PCM970_GPIO_SPI_CS1	(GPIO_PORTD + 27)
-#define PCM038_GPIO_SPI_CS0	(GPIO_PORTD + 28)
 #define PCM038_GPIO_OTG_STP	(GPIO_PORTE + 1)
 
-static struct fec_platform_data fec_info = {
-	.xcv_type = PHY_INTERFACE_MODE_MII,
-	.phy_addr = 1,
-};
-
-static int pcm038_spi_cs[] = {
-	PCM038_GPIO_SPI_CS0,
-#ifdef CONFIG_MACH_PCM970_BASEBOARD
-	PCM970_GPIO_SPI_CS1,
-#endif
-};
-
-static struct spi_imx_master pcm038_spi_0_data = {
-	.chipselect = pcm038_spi_cs,
-	.num_chipselect = ARRAY_SIZE(pcm038_spi_cs),
-};
-
-static struct spi_board_info pcm038_spi_board_info[] = {
-	{
-		.name = "mc13783",
-		.bus_num = 0,
-		.chip_select = 0,
-	}
-};
-
-static struct imx_nand_platform_data nand_info = {
-	.width		= 1,
-	.hw_ecc		= 1,
-	.flash_bbt	= 1,
-};
-
 static struct imx_fb_videomode imxfb_mode = {
 	.mode = {
 		.name		= "Sharp-LQ035Q7",
@@ -106,51 +54,44 @@ static struct imx_fb_videomode imxfb_mode = {
 	 * - data enable low active
 	 * - enable sharp mode
 	 */
-	.pcr		= 0xF00080C0,
+	.pcr		= 0xf00080c0,
 	.bpp		= 16,
 };
 
 static struct imx_fb_platform_data pcm038_fb_data = {
 	.mode	= &imxfb_mode,
 	.num_modes = 1,
-	.pwmr	= 0x00A903FF,
+	.pwmr	= 0x00a903ff,
 	.lscr1	= 0x00120300,
 	.dmacr	= 0x00020010,
 };
 
-/**
- * The spctl0 register is a beast: Seems you can read it
- * only one times without writing it again.
- */

arch/arm/boards/phytec-phycore-imx27/pcm038.c static struct imx_fb_videomode imxfb_mode = { · line 74

Quoted 10 lines
arch/arm/boards/phytec-phycore-imx27/pcm038.c +4 -4
-static inline uint32_t get_pll_spctl10(void)
+static int pcm038_init(void)
 {
-	uint32_t reg;
+	struct mc13xxx *mc13xxx = mc13xxx_get();
 
-	reg = readl(MX27_CCM_BASE_ADDR + MX27_SPCTL0);
-	writel(reg, MX27_CCM_BASE_ADDR + MX27_SPCTL0);
+	if (!of_machine_is_compatible("phytec,imx27-pcm038"))
+		return -ENOSYS;

Please return successfully here. Otherwise we get errors here each time on multiboard images.

Sascha

Signature · 9 lines
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#5 lore raw
In reply to Sascha Hauer

Mon, 7 Apr 2014 09:43:52 +0200 от Sascha Hauer <[email protected]>:

Quoted 6 lines · Alexander Shiyan
Quoted 3 lines

It is only RFC for now.
Known issues:
- PMIC is not detected after "reset" command.

Is this issure introduced with this series? strange.

I think so. I will recheck this in the current (non-modified) version.

---

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox

#6 lore raw
In reply to Sascha Hauer

Mon, 7 Apr 2014 09:43:52 +0200 от Sascha Hauer <[email protected]>:

Quoted 6 lines · Alexander Shiyan
Quoted 3 lines

It is only RFC for now.
Known issues:
- PMIC is not detected after "reset" command.

Is this issure introduced with this series? strange.

I can see the difference in the definition of CSPI1.
Non-DT version contains definition for CSPI1 RDY signal, but I do not see that it is used for PMIC on the schematic of PCM038 ...

---

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox

#7 lore raw

Mon, 07 Apr 2014 12:07:28 +0400 от Alexander Shiyan <[email protected]>:

Quoted 11 lines

Mon, 7 Apr 2014 09:43:52 +0200 от Sascha Hauer <[email protected]>:

Quoted 6 lines · Alexander Shiyan
Quoted 3 lines

It is only RFC for now.
Known issues:
- PMIC is not detected after "reset" command.

Is this issure introduced with this series? strange.

I can see the difference in the definition of CSPI1.
Non-DT version contains definition for CSPI1 RDY signal, but I do not see that it is used for PMIC on the schematic of PCM038 ...

I found this bug. Sascha, please apply following patch to "master" if it possible.
---

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox