Skip to contentSkip to conversation

mach-shmobile: Emma Mobile EV2 DT prototype code

PATCH New Magnus Damm 1 participant 1 message May 10, 2012

Subsystems (5)
lore
Share & tools
lore

Magnus Damm

author maintainer
#0 lore raw

PATCH 1/1 mach-shmobile: Emma Mobile EV2 DT prototype code

From: Magnus Damm <[email protected]>

Here's a first attempt at DT support for EMEV2.

Basic devices like the serial ports UART0->UART3 and the STI timer are now described in the .dts file.

It all is rather straightforward. The main exception is a mismatch between the data sheet IRQ numbers and the ones used in the .dts file. The EMEV2 data sheet includes all GIC interrupts such as SGI, PPI and SPI, so the SPI interrupts are starting from interrupt 32. The default GIC operation seems to be top start SPI from 0 which is somewhat confusing for the user. With platform devices we use gic_spi() for interrupts starting from 32. Not sure the best way to start counting from 0 with DT.

At this point the DT support in this patch is UP only, I'd be very interested in enabling SMP on a SoC level.

Future work include GPIO driver and DT bindings, followed by on-board Ethernet controller support.

Not-yet-signed-off-by Magnus Damm <[email protected]>

---

 arch/arm/boot/Makefile               |    1 
 arch/arm/boot/dts/emev2-kzm9d.dts    |   66 ++++++++++++++++++++++++++++++++++
 arch/arm/mach-shmobile/Makefile.boot |    3 +
 arch/arm/mach-shmobile/clock-emev2.c |    5 ++
 arch/arm/mach-shmobile/setup-emev2.c |   49 ++++++++++++++++++++++++-
 5 files changed, 123 insertions(+), 1 deletion(-)
arch/arm/boot/Makefile +1 -0
@@ -53,6 +53,7 @@ $(obj)/compressed/vmlinux: $(obj)/Image
 
 $(obj)/zImage:	$(obj)/compressed/vmlinux FORCE
 	$(call if_changed,objcopy)
+	cat $(obj)/emev2-kzm9d.dtb >> $@
 	@echo '  Kernel: $@ is ready'
 
 endif
arch/arm/boot/dts/emev2-kzm9d.dts new file +66 -0

66 lines not on this page · raw message

arch/arm/mach-shmobile/Makefile.boot +3 -0
@@ -7,3 +7,6 @@ __ZRELADDR	:= $(shell /bin/bash -c 'prin
 #
 #params_phys-y (Instead: Pass atags pointer in r2)
 #initrd_phys-y (Instead: Use compiled-in initramfs)
+
+dtb-y	+= emev2-kzm9d.dtb
+
arch/arm/mach-shmobile/clock-emev2.c +5 -0
@@ -168,10 +168,15 @@ static int __init emev2_sclkdiv_register
 
 static struct clk_lookup lookups[] = {
 	CLKDEV_DEV_ID("serial8250-em.0", &gclk_clks[GCLK_USIAU0_SCLK]),
+	CLKDEV_DEV_ID("e1020000.uart", &gclk_clks[GCLK_USIAU0_SCLK]),
 	CLKDEV_DEV_ID("serial8250-em.1", &gclk_clks[GCLK_USIBU1_SCLK]),
+	CLKDEV_DEV_ID("e1030000.uart", &gclk_clks[GCLK_USIBU1_SCLK]),
 	CLKDEV_DEV_ID("serial8250-em.2", &gclk_clks[GCLK_USIBU2_SCLK]),
+	CLKDEV_DEV_ID("e1040000.uart", &gclk_clks[GCLK_USIBU2_SCLK]),
 	CLKDEV_DEV_ID("serial8250-em.3", &gclk_clks[GCLK_USIBU3_SCLK]),
+	CLKDEV_DEV_ID("e1050000.uart", &gclk_clks[GCLK_USIBU3_SCLK]),
 	CLKDEV_DEV_ID("em_sti.0", &gclk_clks[GCLK_STI_SCLK]),
+	CLKDEV_DEV_ID("e0180000.sti", &gclk_clks[GCLK_STI_SCLK]),
 };
 
 void __init emev2_clock_init(void)
arch/arm/mach-shmobile/setup-emev2.c +48 -1

75 lines not on this page · raw message