Skip to contentSkip to conversation

mvebu support for kirkwood HP T5325

PATCH New Andrew Lunn 3 participants 10 messages Feb 25, 2014

Subsystems (5)
lore
Share & tools
lore

Andrew Lunn

author maintainer
#0 lore raw

v3 cover mvebu support for kirkwood HP T5325

This patchset adds support to mvebu for the HP T5325 thin client. This is the first kirkwood device using device tree which supports audio. However the audio codec is missing a device tree binding, and simple-audio-card does not yet quite support all the properties needed for this hardware. So C code is used for the audio devices.

v3:
More tabification
Use kirkwood in subject line
Move Makefile hunk alongside dts file.

v2:
Indentation fixes, space->tab, extra spaces removed. Split DTS into a patch of its own.

Andrew Lunn (5):
ARM: kirkwood: Add audio node to kirkwood.dtsi
ARM: kirkwood: Add i2c alias so setting bus number
ARM: kirkwood: Add HP T5325 thin client
ARM: kirkwood: Add dts file describing HP T5325 thin client
ARM: kirkwood: Add HP T5325 devices to {multi|mvebu}_v5_defconfig

 arch/arm/boot/dts/Makefile           |   1 +
 arch/arm/boot/dts/kirkwood-t5325.dts | 208 +++++++++++++++++++++++++++++++++++
 arch/arm/boot/dts/kirkwood.dtsi      |  12 +-
 arch/arm/configs/multi_v5_defconfig  |   9 ++
 arch/arm/configs/mvebu_v5_defconfig  |   9 ++
 arch/arm/mach-mvebu/Kconfig          |   7 ++
 arch/arm/mach-mvebu/Makefile         |   1 +
 arch/arm/mach-mvebu/board-t5325.c    |  41 +++++++
 arch/arm/mach-mvebu/board.h          |  22 ++++
 arch/arm/mach-mvebu/kirkwood.c       |  11 +-
 10 files changed, 319 insertions(+), 2 deletions(-)
 create mode 100644 arch/arm/boot/dts/kirkwood-t5325.dts
 create mode 100644 arch/arm/mach-mvebu/board-t5325.c
 create mode 100644 arch/arm/mach-mvebu/board.h
Signature · 1 line
1.8.5.3
author maintainer
#1 lore raw

PATCH v3 1/5 ARM: kirkwood: Add audio node to kirkwood.dtsi

The binding has existed for a while, so add the missing node so it can be used by devices.

---
v2:
Tabify
v3:
More tabification

---
 arch/arm/boot/dts/kirkwood.dtsi | 9 +++++++++
 1 file changed, 9 insertions(+)
arch/arm/boot/dts/kirkwood.dtsi +9 -0
index 7b921b30cfcb..5a86fa820e12 100644
@@ -310,5 +310,14 @@
 			#phy-cells = <0>;
 			status = "ok";
 		};
+
+		audio0: audio-controller at a0000 {
+			compatible = "marvell,kirkwood-audio";
+			reg = <0xa0000 0x2210>;
+			interrupts = <24>;
+			clocks = <&gate_clk 9>;
+			clock-names = "internal";
+			status = "disabled";
+		};
 	};
 };
Signature · 1 line
1.8.5.3
author maintainer
#2 lore raw

PATCH v3 2/5 ARM: kirkwood: Add i2c alias so setting bus number

In reply to Andrew Lunn

When using platform_driver instantiation, the i2c bus was given bus number 0. The kirkwood-t5325 audio driver has this bus number hard coded for the address of the codec. However by default device tree i2c busses are dynamically allocated a bus number, starting from 1. Thus the kirkwood-t5325 cannot find its audio codec. By adding an alias in the DT file we can control the bus number and set it to 0. The codec can then be found.

---
 arch/arm/boot/dts/kirkwood.dtsi | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
arch/arm/boot/dts/kirkwood.dtsi +2 -1
index 5a86fa820e12..90384587c278 100644
@@ -24,6 +24,7 @@
 	aliases {
 	       gpio0 = &gpio0;
 	       gpio1 = &gpio1;
+	       i2c0 = &i2c0;
 	};
 
 	mbus {
@@ -111,7 +112,7 @@
 			clocks = <&gate_clk 7>;
 		};
 
-		i2c at 11000 {
+		i2c0: i2c at 11000 {
 			compatible = "marvell,mv64xxx-i2c";
 			reg = <0x11000 0x20>;
 			#address-cells = <1>;
Signature · 1 line
1.8.5.3
author maintainer
#3 lore raw

PATCH v3 3/5 ARM: kirkwood: Add HP T5325 thin client

In reply to Andrew Lunn

Convert the kirkwood t5325-setup.c to mostly device tree for mach-mvebu. Part of the audio setup needs to remain in C for the moment until suitable bindings are designed and implemented. So add board code, triggered by the compatibility string.

---
v2:
Remove spaces around KEY_POWER
Correct indentation of help text in Kconfig.
Put dts file into a patch of its own.
v3:
Defer dts Makefile patch to next patch.

---
 arch/arm/mach-mvebu/Kconfig       |  7 +++++++
 arch/arm/mach-mvebu/Makefile      |  1 +
 arch/arm/mach-mvebu/board-t5325.c | 41 +++++++++++++++++++++++++++++++++++++++
 arch/arm/mach-mvebu/board.h       | 22 +++++++++++++++++++++
 arch/arm/mach-mvebu/kirkwood.c    | 11 ++++++++++-
 5 files changed, 81 insertions(+), 1 deletion(-)
 create mode 100644 arch/arm/mach-mvebu/board-t5325.c
 create mode 100644 arch/arm/mach-mvebu/board.h
arch/arm/mach-mvebu/Kconfig +7 -0
index 529f9164a8ca..5de7ada19191 100644
@@ -92,6 +92,13 @@ config MACH_KIRKWOOD
 	  Say 'Y' here if you want your kernel to support boards based
 	  on the Marvell Kirkwood device tree.
 
+config MACH_T5325
+	bool "HP T5325 thin client"
+	depends on MACH_KIRKWOOD
+	help
+	  Say 'Y' here if you want your kernel to support the
+	  HP T5325 Thin client
+
 endmenu
 
 endif
arch/arm/mach-mvebu/Makefile +1 -0
index d7672f1c8a6a..bbeb41ee3e75 100644
@@ -9,3 +9,4 @@ obj-$(CONFIG_ARCH_MVEBU)	 += coherency.o coherency_ll.o pmsu.o
 obj-$(CONFIG_SMP)                += platsmp.o headsmp.o
 obj-$(CONFIG_HOTPLUG_CPU)        += hotplug.o
 obj-$(CONFIG_MACH_KIRKWOOD)	 += kirkwood.o kirkwood-pm.o
+obj-$(CONFIG_MACH_T5325)	 += board-t5325.o
arch/arm/mach-mvebu/board-t5325.c new file +41 -0

41 lines not on this page · raw message

arch/arm/mach-mvebu/board.h new file +22 -0
new file mode 100644
index 000000000000..de7f0a191394
@@ -0,0 +1,22 @@
+/*
+ * Board functions for Marvell System On Chip
+ *
+ * Copyright (C) 2014
+ *
+ * Andrew Lunn <[email protected]>
+ *
+ * This file is licensed under the terms of the GNU General Public
+ * License version 2.  This program is licensed "as is" without any
+ * warranty of any kind, whether express or implied.
+ */
+
+#ifndef __ARCH_MVEBU_BOARD_H
+#define __ARCH_MVEBU_BOARD_H
+
+#ifdef CONFIG_MACH_T5325
+void t5325_init(void);
+#else
+static inline void t5325_init(void) {};
+#endif
+
+#endif
arch/arm/mach-mvebu/kirkwood.c +10 -1
index 8a38b10532e5..120207fc36f1 100644
@@ -25,6 +25,7 @@
 #include "kirkwood.h"
 #include "kirkwood-pm.h"
 #include "common.h"
+#include "board.h"
 
 static struct resource kirkwood_cpufreq_resources[] = {
 	[0] = {
@@ -158,6 +159,11 @@ void kirkwood_disable_mbus_error_propagation(void)
 	writel(readl(cpu_config) & ~CPU_CONFIG_ERROR_PROP, cpu_config);
 }
 
+static struct of_dev_auxdata auxdata[] __initdata = {
+	OF_DEV_AUXDATA("marvell,kirkwood-audio", 0xf10a0000,
+		       "mvebu-audio", NULL),
+	{ /* sentinel */ }
+};
 
 static void __init kirkwood_dt_init(void)
 {
@@ -174,7 +180,10 @@ static void __init kirkwood_dt_init(void)
 	kirkwood_pm_init();
 	kirkwood_dt_eth_fixup();
 
-	of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
+	if (of_machine_is_compatible("hp,t5325"))
+		t5325_init();
+
+	of_platform_populate(NULL, of_default_bus_match_table, auxdata, NULL);
 }
 
 static const char * const kirkwood_dt_board_compat[] = {
Signature · 1 line
1.8.5.3
author maintainer
#4 lore raw

PATCH v3 4/5 ARM: kirkwood: Add dts file describing HP T5325 thin client

In reply to Andrew Lunn

Describe the T5325 using device tree properties, where possible. The first version of this file was produced by Thomas Petazzoni.

---
v3:
Makefile hunk.

---
 arch/arm/boot/dts/Makefile           |   1 +
 arch/arm/boot/dts/kirkwood-t5325.dts | 208 +++++++++++++++++++++++++++++++++++
 2 files changed, 209 insertions(+)
 create mode 100644 arch/arm/boot/dts/kirkwood-t5325.dts
arch/arm/boot/dts/Makefile +1 -0
index 436cc381db4a..20c152faa800 100644
@@ -132,6 +132,7 @@ kirkwood := \
 	kirkwood-rs411.dtb \
 	kirkwood-sheevaplug.dtb \
 	kirkwood-sheevaplug-esata.dtb \
+	kirkwood-t5325.dtb \
 	kirkwood-topkick.dtb \
 	kirkwood-ts219-6281.dtb \
 	kirkwood-ts219-6282.dtb \
arch/arm/boot/dts/kirkwood-t5325.dts new file +208 -0

208 lines not on this page · raw message

Signature · 1 line
1.8.5.3
author maintainer
#5 lore raw

PATCH v3 5/5 ARM: kirkwood: Add HP T5325 devices to {multi|mvebu}_v5_defconfig

In reply to Andrew Lunn

The HP T5325 has a PCI based VGA controller. Add the frame buffer driver, and frame buffer support to the defconfig's. Additionally add the soc audio framework and the necessary codec.

---
 arch/arm/configs/multi_v5_defconfig | 9 +++++++++
 arch/arm/configs/mvebu_v5_defconfig | 9 +++++++++
 2 files changed, 18 insertions(+)
arch/arm/configs/multi_v5_defconfig +9 -0
index 2bc1e1707930..84ba24a0ead7 100644
@@ -11,6 +11,7 @@ CONFIG_MODULE_UNLOAD=y
 # CONFIG_ARCH_MULTI_V7 is not set
 CONFIG_ARCH_MVEBU=y
 CONFIG_MACH_KIRKWOOD=y
+CONFIG_MACH_T5325=y
 CONFIG_ARCH_MXC=y
 CONFIG_MACH_IMX25_DT=y
 CONFIG_MACH_IMX27_DT=y
@@ -101,6 +102,12 @@ CONFIG_THERMAL=y
 CONFIG_KIRKWOOD_THERMAL=y
 CONFIG_WATCHDOG=y
 CONFIG_ORION_WATCHDOG=y
+CONFIG_FB=y
+CONFIG_SOUND=y
+CONFIG_SND=y
+CONFIG_SND_SOC=y
+CONFIG_SND_KIRKWOOD_SOC=y
+CONFIG_SND_KIRKWOOD_SOC_T5325=y
 # CONFIG_ABX500_CORE is not set
 CONFIG_REGULATOR=y
 CONFIG_REGULATOR_FIXED_VOLTAGE=y
@@ -150,6 +157,8 @@ CONFIG_RTC_DRV_S35390A=y
 CONFIG_RTC_DRV_MV=y
 CONFIG_DMADEVICES=y
 CONFIG_MV_XOR=y
+CONFIG_STAGING=y
+CONFIG_FB_XGI=y
 CONFIG_EXT2_FS=y
 CONFIG_EXT3_FS=y
 # CONFIG_EXT3_FS_XATTR is not set
arch/arm/configs/mvebu_v5_defconfig +9 -0
index 2844636c0cf2..36484a37a1ca 100644
@@ -11,6 +11,7 @@ CONFIG_MODULE_UNLOAD=y
 # CONFIG_ARCH_MULTI_V7 is not set
 CONFIG_ARCH_MVEBU=y
 CONFIG_MACH_KIRKWOOD=y
+CONFIG_MACH_T5325=y
 # CONFIG_CPU_FEROCEON_OLD_ID is not set
 CONFIG_PCI_MVEBU=y
 CONFIG_PREEMPT=y
@@ -93,6 +94,12 @@ CONFIG_SENSORS_LM85=y
 CONFIG_THERMAL=y
 CONFIG_WATCHDOG=y
 CONFIG_ORION_WATCHDOG=y
+CONFIG_FB=y
+CONFIG_SOUND=y
+CONFIG_SND=y
+CONFIG_SND_SOC=y
+CONFIG_SND_KIRKWOOD_SOC=y
+CONFIG_SND_KIRKWOOD_SOC_T5325=y
 CONFIG_REGULATOR=y
 CONFIG_REGULATOR_FIXED_VOLTAGE=y
 CONFIG_HID_DRAGONRISE=y
@@ -137,6 +144,8 @@ CONFIG_RTC_DRV_S35390A=y
 CONFIG_RTC_DRV_MV=y
 CONFIG_DMADEVICES=y
 CONFIG_MV_XOR=y
+CONFIG_STAGING=y
+CONFIG_FB_XGI=y
 CONFIG_EXT2_FS=y
 CONFIG_EXT3_FS=y
 # CONFIG_EXT3_FS_XATTR is not set
Signature · 1 line
1.8.5.3
maintainer
#6 lore raw

PATCH v3 5/5 ARM: kirkwood: Add HP T5325 devices to {multi|mvebu}_v5_defconfig

Quoted 6 lines · On Tuesday 25 February 2014 18:34:03 Andrew Lunn wrote:

The HP T5325 has a PCI based VGA controller. Add the frame buffer driver, and frame buffer support to the defconfig's. Additionally add the soc audio framework and the necessary codec.

Does the VGA console still work with the new PCI driver?

I noticed we're not setting 'vga_base'.

Arnd

author maintainer
#7 lore raw

PATCH v3 5/5 ARM: kirkwood: Add HP T5325 devices to {multi|mvebu}_v5_defconfig

Quoted 8 lines · Arnd Bergmann
Quoted 6 lines · On Tuesday 25 February 2014 18:34:03 Andrew Lunn wrote:

The HP T5325 has a PCI based VGA controller. Add the frame buffer driver, and frame buffer support to the defconfig's. Additionally add the soc audio framework and the necessary codec.

Does the VGA console still work with the new PCI driver?

I've not plugged in a monitor, but i do see:

xgifb 0000:01:00.0: Relocate IO address: 10000 [00010030]
PCI: enabling device 0000:00:01.0 (0140 -> 0143)
xgifb 0000:01:00.0: chipid = 32
xgifb: SR14=51 DramSzie 2000000 ChannelNum 1
xgifb 0000:01:00.0: Framebuffer at 0xe0000000, mapped to 0xe1000000, size 32768k xgifb 0000:01:00.0: MMIO at 0xe4000000, mapped to 0xe0a00000, size 256k xgifb 0000:01:00.0: No or unknown bridge type detected
xgifb: Default mode is 800x600x16 (60Hz)

so it looks like the frame buffer is happy.

I will see if i can find a cable and a monitor.

Andrew

maintainer
#8 lore raw

PATCH v3 5/5 ARM: kirkwood: Add HP T5325 devices to {multi|mvebu}_v5_defconfig

Quoted 21 lines · On Tuesday 25 February 2014 19:53:17 Andrew Lunn wrote:
Quoted 8 lines · Arnd Bergmann
Quoted 6 lines · On Tuesday 25 February 2014 18:34:03 Andrew Lunn wrote:

The HP T5325 has a PCI based VGA controller. Add the frame buffer driver, and frame buffer support to the defconfig's. Additionally add the soc audio framework and the necessary codec.

Does the VGA console still work with the new PCI driver?

I've not plugged in a monitor, but i do see:

xgifb 0000:01:00.0: Relocate IO address: 10000 [00010030]
PCI: enabling device 0000:00:01.0 (0140 -> 0143)
xgifb 0000:01:00.0: chipid = 32
xgifb: SR14=51 DramSzie 2000000 ChannelNum 1
xgifb 0000:01:00.0: Framebuffer at 0xe0000000, mapped to 0xe1000000, size 32768k xgifb 0000:01:00.0: MMIO at 0xe4000000, mapped to 0xe0a00000, size 256k xgifb 0000:01:00.0: No or unknown bridge type detected
xgifb: Default mode is 800x600x16 (60Hz)

Quoted 3 lines

so it looks like the frame buffer is happy.

I will see if i can find a cable and a monitor.

Ok, xgifb doesn't rely on vga_base, so that probably hasn't changed. In theory, it could have worked with vgacon or vga16fb before but that would be broken now.

Arnd

Applied
#9 lore raw

v3 cover mvebu support for kirkwood HP T5325

In reply to Andrew Lunn

Andrew,

Quoted 5 lines · Andrew Lunn

This patchset adds support to mvebu for the HP T5325 thin client. This is the first kirkwood device using device tree which supports audio. However the audio codec is missing a device tree binding, and simple-audio-card does not yet quite support all the properties needed for this hardware. So C code is used for the audio devices.

...

Applied as follows:

Quoted 3 lines

Andrew Lunn (5):
ARM: kirkwood: Add audio node to kirkwood.dtsi
ARM: kirkwood: Add i2c alias so setting bus number

mvebu/dt

Quoted 1 line

ARM: kirkwood: Add HP T5325 thin client

mvebu/soc-kw

Quoted 1 line

ARM: kirkwood: Add dts file describing HP T5325 thin client

mvebu/dt

Quoted 1 line

ARM: kirkwood: Add HP T5325 devices to {multi|mvebu}_v5_defconfig

mvebu/defconfig

That's one more down!

thx,

Jason.