Re: [PATCH V2 4/5] MIPS: Add support for the IMG Pistachio SoC

2015-03-16 Thread James Hogan
Hi Andrew,

On 13/03/15 22:54, Andrew Bresticker wrote:
> diff --git a/arch/mips/Kbuild.platforms b/arch/mips/Kbuild.platforms
> index e5fc463..2298baa 100644
> --- a/arch/mips/Kbuild.platforms
> +++ b/arch/mips/Kbuild.platforms
> @@ -23,6 +23,7 @@ platforms += netlogic
>  platforms += paravirt
>  platforms += pmcs-msp71xx
>  platforms += pnx833x
> +platforms += pistachio

Please keep this sorted alphabetically.

>  platforms += ralink
>  platforms += rb532
>  platforms += sgi-ip22

...

> diff --git a/arch/mips/include/asm/mach-pistachio/gpio.h 
> b/arch/mips/include/asm/mach-pistachio/gpio.h
> new file mode 100644
> index 000..6c1649c
> --- /dev/null
> +++ b/arch/mips/include/asm/mach-pistachio/gpio.h
> @@ -0,0 +1,21 @@
> +/*
> + * Pistachio IRQ setup
> + *
> + * Copyright (C) 2014 Google, Inc.
> + *
> + * This program is free software; you can redistribute it and/or modify it
> + * under the terms and conditions of the GNU General Public License,
> + * version 2, as published by the Free Software Foundation.
> + */
> +
> +#ifndef __ASM_MACH_PISTACHIO_GPIO_H
> +#define __ASM_MACH_PISTACHIO_GPIO_H
> +
> +#include 
> +
> +#define gpio_get_value   __gpio_get_value
> +#define gpio_set_value   __gpio_set_value
> +#define gpio_cansleep__gpio_cansleep
> +#define gpio_to_irq  __gpio_to_irq

Makes me wish ARCH_HAVE_CUSTOM_GPIO_H could be selected on a
per-platform basis :P. Never mind.

> +
> +#endif /* __ASM_MACH_PISTACHIO_GPIO_H */

...

> diff --git a/arch/mips/pistachio/init.c b/arch/mips/pistachio/init.c
> new file mode 100644
> index 000..6b297d5
> --- /dev/null
> +++ b/arch/mips/pistachio/init.c
> @@ -0,0 +1,131 @@

...

> +static int __init plat_of_setup(void)
> +{
> + if (!of_have_populated_dt())
> + panic("Device tree not present");
> +
> + if (of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL))
> + panic("Failed to populate DT\n");

No need for newline in panic message.

> +
> + return 0;
> +}
> +arch_initcall(plat_of_setup);

...

Otherwise from what I can tell this patch looks good to me (though I
probably wouldn't know if something important was missing from it).

Thanks!
James



signature.asc
Description: OpenPGP digital signature


[PATCH V2 4/5] MIPS: Add support for the IMG Pistachio SoC

2015-03-13 Thread Andrew Bresticker
Add initial support for boards based on the Imagination Pistachio SoC.
Pistachio is based on a dual-core MIPS interAptiv CPU and will boot
using device-tree.

Signed-off-by: James Hartley 
Signed-off-by: Andrew Bresticker 
---
Changes from v1:
 - switched to MIPS UHI hand-off protocol
---
 arch/mips/Kbuild.platforms  |   1 +
 arch/mips/Kconfig   |  27 ++
 arch/mips/include/asm/mach-pistachio/gpio.h |  21 +
 arch/mips/include/asm/mach-pistachio/irq.h  |  18 
 arch/mips/pistachio/Makefile|   1 +
 arch/mips/pistachio/Platform|   8 ++
 arch/mips/pistachio/init.c  | 131 
 arch/mips/pistachio/irq.c   |  28 ++
 arch/mips/pistachio/time.c  |  52 +++
 9 files changed, 287 insertions(+)
 create mode 100644 arch/mips/include/asm/mach-pistachio/gpio.h
 create mode 100644 arch/mips/include/asm/mach-pistachio/irq.h
 create mode 100644 arch/mips/pistachio/Makefile
 create mode 100644 arch/mips/pistachio/Platform
 create mode 100644 arch/mips/pistachio/init.c
 create mode 100644 arch/mips/pistachio/irq.c
 create mode 100644 arch/mips/pistachio/time.c

diff --git a/arch/mips/Kbuild.platforms b/arch/mips/Kbuild.platforms
index e5fc463..2298baa 100644
--- a/arch/mips/Kbuild.platforms
+++ b/arch/mips/Kbuild.platforms
@@ -23,6 +23,7 @@ platforms += netlogic
 platforms += paravirt
 platforms += pmcs-msp71xx
 platforms += pnx833x
+platforms += pistachio
 platforms += ralink
 platforms += rb532
 platforms += sgi-ip22
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index c7a1690..343b238 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -352,6 +352,33 @@ config MACH_LOONGSON1
  the ICT (Institute of Computing Technology) and the Chinese Academy
  of Sciences.
 
+config MACH_PISTACHIO
+   bool "IMG Pistachio SoC based boards"
+   select ARCH_REQUIRE_GPIOLIB
+   select BOOT_ELF32
+   select BOOT_RAW
+   select CEVT_R4K
+   select CLKSRC_MIPS_GIC
+   select COMMON_CLK
+   select CSRC_R4K
+   select DMA_MAYBE_COHERENT
+   select IRQ_CPU
+   select LIBFDT
+   select MFD_SYSCON
+   select MIPS_CPU_SCACHE
+   select MIPS_GIC
+   select PINCTRL
+   select REGULATOR
+   select SYS_HAS_CPU_MIPS32_R2
+   select SYS_SUPPORTS_32BIT_KERNEL
+   select SYS_SUPPORTS_LITTLE_ENDIAN
+   select SYS_SUPPORTS_MIPS_CPS
+   select SYS_SUPPORTS_MULTITHREADING
+   select SYS_SUPPORTS_ZBOOT
+   select USE_OF
+   help
+ This enables support for the IMG Pistachio SoC platform.
+
 config MIPS_MALTA
bool "MIPS Malta board"
select ARCH_MAY_HAVE_PC_FDC
diff --git a/arch/mips/include/asm/mach-pistachio/gpio.h 
b/arch/mips/include/asm/mach-pistachio/gpio.h
new file mode 100644
index 000..6c1649c
--- /dev/null
+++ b/arch/mips/include/asm/mach-pistachio/gpio.h
@@ -0,0 +1,21 @@
+/*
+ * Pistachio IRQ setup
+ *
+ * Copyright (C) 2014 Google, Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms and conditions of the GNU General Public License,
+ * version 2, as published by the Free Software Foundation.
+ */
+
+#ifndef __ASM_MACH_PISTACHIO_GPIO_H
+#define __ASM_MACH_PISTACHIO_GPIO_H
+
+#include 
+
+#define gpio_get_value __gpio_get_value
+#define gpio_set_value __gpio_set_value
+#define gpio_cansleep  __gpio_cansleep
+#define gpio_to_irq__gpio_to_irq
+
+#endif /* __ASM_MACH_PISTACHIO_GPIO_H */
diff --git a/arch/mips/include/asm/mach-pistachio/irq.h 
b/arch/mips/include/asm/mach-pistachio/irq.h
new file mode 100644
index 000..b94a09a
--- /dev/null
+++ b/arch/mips/include/asm/mach-pistachio/irq.h
@@ -0,0 +1,18 @@
+/*
+ * Pistachio IRQ setup
+ *
+ * Copyright (C) 2014 Google, Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms and conditions of the GNU General Public License,
+ * version 2, as published by the Free Software Foundation.
+ */
+
+#ifndef __ASM_MACH_PISTACHIO_IRQ_H
+#define __ASM_MACH_PISTACHIO_IRQ_H
+
+#define NR_IRQS 256
+
+#include_next 
+
+#endif /* __ASM_MACH_PISTACHIO_IRQ_H */
diff --git a/arch/mips/pistachio/Makefile b/arch/mips/pistachio/Makefile
new file mode 100644
index 000..32189c6
--- /dev/null
+++ b/arch/mips/pistachio/Makefile
@@ -0,0 +1 @@
+obj-y  += init.o irq.o time.o
diff --git a/arch/mips/pistachio/Platform b/arch/mips/pistachio/Platform
new file mode 100644
index 000..d80cd61
--- /dev/null
+++ b/arch/mips/pistachio/Platform
@@ -0,0 +1,8 @@
+#
+# IMG Pistachio SoC
+#
+platform-$(CONFIG_MACH_PISTACHIO)  += pistachio/
+cflags-$(CONFIG_MACH_PISTACHIO)+=  
\
+   -I$(srctree)/arch/mips/include/asm/mach-pistachio
+load-$(CONFIG_MACH_PISTACHIO)  += 0x8040
+zload-$(CONFIG_MACH_PISTACHIO) += 0x8100
diff --git a/arch/m