Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 01/14] ARM: Add page table and page defines needed by KVM
From: Christoffer Dall @ 2012-10-22  6:49 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <20121022064831.18444.73273.stgit@ubuntu>

KVM uses the stage-2 page tables and the Hyp page table format,
so we define the fields and page protection flags needed by KVM.

The nomenclature is this:
 - page_hyp:        PL2 code/data mappings
 - page_hyp_device: PL2 device mappings (vgic access)
 - page_s2:         Stage-2 code/data page mappings
 - page_s2_device:  Stage-2 device mappings (vgic access)

Reviewed-by: Marcelo Tosatti <mtosatti@redhat.com>
Christoffer Dall <c.dall@virtualopensystems.com>
---
 arch/arm/include/asm/pgtable-3level.h |   18 ++++++++++++++++++
 arch/arm/include/asm/pgtable.h        |    7 +++++++
 arch/arm/mm/mmu.c                     |   25 +++++++++++++++++++++++++
 3 files changed, 50 insertions(+)

diff --git a/arch/arm/include/asm/pgtable-3level.h b/arch/arm/include/asm/pgtable-3level.h
index b249035..eaba5a4 100644
--- a/arch/arm/include/asm/pgtable-3level.h
+++ b/arch/arm/include/asm/pgtable-3level.h
@@ -102,11 +102,29 @@
  */
 #define L_PGD_SWAPPER		(_AT(pgdval_t, 1) << 55)	/* swapper_pg_dir entry */
 
+/*
+ * 2nd stage PTE definitions for LPAE.
+ */
+#define L_PTE_S2_MT_UNCACHED	 (_AT(pteval_t, 0x5) << 2) /* MemAttr[3:0] */
+#define L_PTE_S2_MT_WRITETHROUGH (_AT(pteval_t, 0xa) << 2) /* MemAttr[3:0] */
+#define L_PTE_S2_MT_WRITEBACK	 (_AT(pteval_t, 0xf) << 2) /* MemAttr[3:0] */
+#define L_PTE_S2_RDONLY		 (_AT(pteval_t, 1) << 6)   /* HAP[1]   */
+#define L_PTE_S2_RDWR		 (_AT(pteval_t, 2) << 6)   /* HAP[2:1] */
+
+/*
+ * Hyp-mode PL2 PTE definitions for LPAE.
+ */
+#define L_PTE_HYP		L_PTE_USER
+
 #ifndef __ASSEMBLY__
 
 #define pud_none(pud)		(!pud_val(pud))
 #define pud_bad(pud)		(!(pud_val(pud) & 2))
 #define pud_present(pud)	(pud_val(pud))
+#define pmd_table(pmd)		((pmd_val(pmd) & PMD_TYPE_MASK) == \
+						 PMD_TYPE_TABLE)
+#define pmd_sect(pmd)		((pmd_val(pmd) & PMD_TYPE_MASK) == \
+						 PMD_TYPE_SECT)
 
 #define pud_clear(pudp)			\
 	do {				\
diff --git a/arch/arm/include/asm/pgtable.h b/arch/arm/include/asm/pgtable.h
index 08c1231..dfb3918 100644
--- a/arch/arm/include/asm/pgtable.h
+++ b/arch/arm/include/asm/pgtable.h
@@ -70,6 +70,9 @@ extern void __pgd_error(const char *file, int line, pgd_t);
 
 extern pgprot_t		pgprot_user;
 extern pgprot_t		pgprot_kernel;
+extern pgprot_t		pgprot_hyp_device;
+extern pgprot_t		pgprot_s2;
+extern pgprot_t		pgprot_s2_device;
 
 #define _MOD_PROT(p, b)	__pgprot(pgprot_val(p) | (b))
 
@@ -82,6 +85,10 @@ extern pgprot_t		pgprot_kernel;
 #define PAGE_READONLY_EXEC	_MOD_PROT(pgprot_user, L_PTE_USER | L_PTE_RDONLY)
 #define PAGE_KERNEL		_MOD_PROT(pgprot_kernel, L_PTE_XN)
 #define PAGE_KERNEL_EXEC	pgprot_kernel
+#define PAGE_HYP		_MOD_PROT(pgprot_kernel, L_PTE_HYP)
+#define PAGE_HYP_DEVICE		_MOD_PROT(pgprot_hyp_device, L_PTE_HYP)
+#define PAGE_S2			_MOD_PROT(pgprot_s2, L_PTE_S2_RDONLY)
+#define PAGE_S2_DEVICE		_MOD_PROT(pgprot_s2_device, L_PTE_USER | L_PTE_S2_RDONLY)
 
 #define __PAGE_NONE		__pgprot(_L_PTE_DEFAULT | L_PTE_RDONLY | L_PTE_XN)
 #define __PAGE_SHARED		__pgprot(_L_PTE_DEFAULT | L_PTE_USER | L_PTE_XN)
diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c
index 941dfb9..087d949 100644
--- a/arch/arm/mm/mmu.c
+++ b/arch/arm/mm/mmu.c
@@ -57,43 +57,61 @@ static unsigned int cachepolicy __initdata = CPOLICY_WRITEBACK;
 static unsigned int ecc_mask __initdata = 0;
 pgprot_t pgprot_user;
 pgprot_t pgprot_kernel;
+pgprot_t pgprot_hyp_device;
+pgprot_t pgprot_s2;
+pgprot_t pgprot_s2_device;
 
 EXPORT_SYMBOL(pgprot_user);
 EXPORT_SYMBOL(pgprot_kernel);
+EXPORT_SYMBOL(pgprot_hyp_device);
+EXPORT_SYMBOL(pgprot_s2);
+EXPORT_SYMBOL(pgprot_s2_device);
 
 struct cachepolicy {
 	const char	policy[16];
 	unsigned int	cr_mask;
 	pmdval_t	pmd;
 	pteval_t	pte;
+	pteval_t	pte_s2;
 };
 
+#ifdef CONFIG_ARM_LPAE
+#define s2_policy(policy)	policy
+#else
+#define s2_policy(policy)	0
+#endif
+
 static struct cachepolicy cache_policies[] __initdata = {
 	{
 		.policy		= "uncached",
 		.cr_mask	= CR_W|CR_C,
 		.pmd		= PMD_SECT_UNCACHED,
 		.pte		= L_PTE_MT_UNCACHED,
+		.pte_s2		= s2_policy(L_PTE_S2_MT_UNCACHED),
 	}, {
 		.policy		= "buffered",
 		.cr_mask	= CR_C,
 		.pmd		= PMD_SECT_BUFFERED,
 		.pte		= L_PTE_MT_BUFFERABLE,
+		.pte_s2		= s2_policy(L_PTE_S2_MT_UNCACHED),
 	}, {
 		.policy		= "writethrough",
 		.cr_mask	= 0,
 		.pmd		= PMD_SECT_WT,
 		.pte		= L_PTE_MT_WRITETHROUGH,
+		.pte_s2		= s2_policy(L_PTE_S2_MT_WRITETHROUGH),
 	}, {
 		.policy		= "writeback",
 		.cr_mask	= 0,
 		.pmd		= PMD_SECT_WB,
 		.pte		= L_PTE_MT_WRITEBACK,
+		.pte_s2		= s2_policy(L_PTE_S2_MT_WRITEBACK),
 	}, {
 		.policy		= "writealloc",
 		.cr_mask	= 0,
 		.pmd		= PMD_SECT_WBWA,
 		.pte		= L_PTE_MT_WRITEALLOC,
+		.pte_s2		= s2_policy(L_PTE_S2_MT_WRITEBACK),
 	}
 };
 
@@ -310,6 +328,7 @@ static void __init build_mem_type_table(void)
 	struct cachepolicy *cp;
 	unsigned int cr = get_cr();
 	pteval_t user_pgprot, kern_pgprot, vecs_pgprot;
+	pteval_t hyp_device_pgprot, s2_pgprot, s2_device_pgprot;
 	int cpu_arch = cpu_architecture();
 	int i;
 
@@ -421,6 +440,8 @@ static void __init build_mem_type_table(void)
 	 */
 	cp = &cache_policies[cachepolicy];
 	vecs_pgprot = kern_pgprot = user_pgprot = cp->pte;
+	s2_pgprot = cp->pte_s2;
+	hyp_device_pgprot = s2_device_pgprot = mem_types[MT_DEVICE].prot_pte;
 
 	/*
 	 * ARMv6 and above have extended page tables.
@@ -444,6 +465,7 @@ static void __init build_mem_type_table(void)
 			user_pgprot |= L_PTE_SHARED;
 			kern_pgprot |= L_PTE_SHARED;
 			vecs_pgprot |= L_PTE_SHARED;
+			s2_pgprot |= L_PTE_SHARED;
 			mem_types[MT_DEVICE_WC].prot_sect |= PMD_SECT_S;
 			mem_types[MT_DEVICE_WC].prot_pte |= L_PTE_SHARED;
 			mem_types[MT_DEVICE_CACHED].prot_sect |= PMD_SECT_S;
@@ -498,6 +520,9 @@ static void __init build_mem_type_table(void)
 	pgprot_user   = __pgprot(L_PTE_PRESENT | L_PTE_YOUNG | user_pgprot);
 	pgprot_kernel = __pgprot(L_PTE_PRESENT | L_PTE_YOUNG |
 				 L_PTE_DIRTY | kern_pgprot);
+	pgprot_s2  = __pgprot(L_PTE_PRESENT | L_PTE_YOUNG | s2_pgprot);
+	pgprot_s2_device  = __pgprot(s2_device_pgprot);
+	pgprot_hyp_device  = __pgprot(hyp_device_pgprot);
 
 	mem_types[MT_LOW_VECTORS].prot_l1 |= ecc_mask;
 	mem_types[MT_HIGH_VECTORS].prot_l1 |= ecc_mask;

^ permalink raw reply related

* [PATCH v3 00/14] KVM/ARM Implementation
From: Christoffer Dall @ 2012-10-22  6:48 UTC (permalink / raw)
  To: linux-arm-kernel

The following series implements KVM support for ARM processors,
specifically on the Cortex A-15 platform.

Work is done in collaboration between Columbia University, Virtual Open
Systems and ARM/Linaro.

The patch series applies to Linux 3.7-rc2 with kvm/next merged:
 git://git.kernel.org/pub/scm/virt/kvm/kvm.git
        branch: next (03604b3114)

This is Version 13 of the patch series, the first 10 versions were
reviewed on the KVM/ARM and KVM mailing lists. Changes can also be
pulled from:
    git://github.com/virtualopensystems/linux-kvm-arm.git
        branch: kvm-arm-v13
        branch: kvm-arm-v13-vgic
        branch: kvm-arm-v13-vgic-timers

A non-flattened edition of the patch series, which can always be merged,
can be found at:
 git://github.com/virtualopensystems/linux-kvm-arm.git kvm-arm-master

This patch series requires QEMU compatibility.  Use the branch
 git://github.com/virtualopensystems/qemu.git kvm-arm

There is also WIP QEMU patches to support virtio on ARM:
 git://github.com/virtualopensystems/qemu.git kvm-arm-virtio

Following this patch series, which implements core KVM support, are two
other patch series implementing Virtual Generic Interrupt Controller
(VGIC) support and Architected Generic Timers.  All three patch series
should be applied for full QEMU compatibility.

The implementation is broken up into a logical set of patches, the first
are preparatory patches:
  1. ARM: Add page table defines for KVM
  3. ARM: Section based HYP idmaps
  3. ARM: Factor out cpuid implementor and part_number fields

The main implementation is broken up into separate patches, the first
containing a skeleton of files, makefile changes, the basic user space
interface and KVM architecture specific stubs.  Subsequent patches
implement parts of the system as listed:
  4. Skeleton and reset hooks
  5. Hypervisor initialization
  6. Memory virtualization setup (hyp mode mappings and 2nd stage)
  7. Inject IRQs and FIQs from userspace
  8. World-switch implementation and Hyp exception vectors
  9. Emulation framework and coproc emulation
 10. Coproc user space API
 11. Demux multiplexed coproc registers
 12. User spac API to get/set VFP registers
 13. Handle guest user memory aborts
 14. Handle guest MMIO aborts

Testing:
 Tested on FAST Models and Versatile Express test-chip2.  Tested by
 running three simultaenous VMs, all running SMP, on an SMP host, each
 VM running hackbench and cyclictest and with extreme memory pressure
 applied to the host with swapping enabled to provoke page eviction.
 Also tested KSM merging and GCC inside VMs.  Fully boots both Ubuntu
 (user space Thumb-2) and Debian (user space ARM) guests.

For a guide on how to set up a testing environment and try out these
patches, see:
 http://www.virtualopensystems.com/media/pdf/kvm-arm-guide.pdf

Changes since v12:
 - Documentation updates
 - Change Hyp-ABI to function call based paradigm
 - Cleanup world-switch code
 - Unify HIFAR/HDFAR on the vcpu struct
 - Simplify vcpu register access in sofware
 - Enforce use of vcpu field accessors
 - Factor out mmio handling into separate file
 - Check for overlaps in mmio address mappings
 - Bugfix in mmio decoding
 - Complete rework of ARM mmio load/store instruction

Changes since v11:
 - Memory setup and page table defines reworked
 - We do not export unused perf bitfields anymore
 - No module support anymore and following cleanup
 - Hide vcpu register accessors
 - Fix unmap range mmu notifier race condition
 - Factored out A15 coprocs in separate file
 - Factored out world-switch assembly macros to separate file
 - Add dmux of multiplexed coprocs to user space
 - Add VFP get/set interface to user space
 - Addressed various cleanup comments from reviewers

Changes since v10:
 - Boot in Hyp mode and user HVC to initialize HVBAR
 - Support VGIC
 - Support Arch timers
 - Support Thumb-2 mmio instruction decoding
 - Transition to GET_ONE/SET_ONE register API
 - Added KVM_VCPU_GET_REG_LIST
 - New interrupt injection API
 - Don't pin guest pages anymore
 - Fix race condition in page fault handler
 - Cleanup guest instruction copying.
 - Fix race when copying SMP guest instructions
 - Inject data/prefetch aborts when guest does something strange

Changes since v9:
 - Addressed reviewer comments (see mailing list archive)
 - Limit the user of .arch_extensiion sec/virt for compilers that need them
 - VFP/Neon Support (Antonios Motakis)
 - Run exit handling under preemption and still handle guest cache ops
 - Add support for IO mapping at Hyp level (VGIC prep)
 - Add support for IO mapping at Guest level (VGIC prep)
 - Remove backdoor call to irq_svc
 - Complete rework of CP15 handling and register reset (Rusty Russell)
 - Don't use HSTR for anything else than CR 15
 - New ioctl to set emulation target core (only A15 supported for now)
 - Support KVM_GET_MSRS / KVM_SET_MSRS
 - Add page accounting and page table eviction
 - Change pgd lock to spinlock and fix sleeping in atomic bugs
 - Check kvm_condition_valid for HVC traps of undefs
 - Added a naive implementation of kvm_unmap_hva_range

Changes since v8:
 - Support cache maintenance on SMP through set/way
 - Hyp mode idmaps are now section based and happen at kernel init
 - Handle aborts in Hyp mode
 - Inject undefined exceptions into the guest on error
 - Kernel-side reset of all crucial registers
 - Specifically state which target CPU is being virtualized
 - Exit statistics in debugfs
 - Some L2CTLR cp15 emulation cleanups
 - Support spte_hva for MMU notifiers and take write faults
 - FIX: Race condition in VMID generation
 - BUG: Run exit handling code with disabled preemption
 - Save/Restore abort fault register during world switch

Changes since v7:
 - Traps accesses to ACTLR
 - Do not trap WFE execution
 - Upgrade barriers and TLB operations to inner-shareable domain
 - Restrucure hyp_pgd related code to be more opaque
 - Random SMP fixes
 - Random BUG fixes
 - Improve commenting
 - Support module loading/unloading of KVM/ARM
 - Thumb-2 support for host kernel and KVM
 - Unaligned cross-page wide guest Thumb instruction fetching
 - Support ITSTATE fields in CPSR for Thumb guests
 - Document HCR settings

Changes since v6:
 - Support for MMU notifiers to not pin user pages in memory
 - Suport build with log debugging
 - Bugfix: v6 clobbered r7 in init code
 - Simplify hyp code mapping
 - Cleanup of register access code
 - Table-based CP15 emulation from Rusty Russell
 - Various other bug fixes and cleanups

Changes since v5:
 - General bugfixes and nit fixes from reviews
 - Implemented re-use of VMIDs
 - Cleaned up the Hyp-mapping code to be readable by non-mm hackers
   (including myself)
 - Integrated preliminary SMP support in base patches
 - Lock-less interrupt injection and WFI support
 - Fixed signal-handling in while in guest (increases overall stability)

Changes since v4:
 - Addressed reviewer comments from v4
    * cleanup debug and trace code
    * remove printks
    * fixup kvm_arch_vcpu_ioctl_run
    * add trace details to mmio emulation
 - Fix from Marc Zyngier: Move kvm_guest_enter/exit into non-preemptible
   section (squashed into world-switch patch)
 - Cleanup create_hyp_mappings/remove_hyp_mappings from Marc Zyngier
   (squashed into hypervisor initialization patch)
 - Removed the remove_hyp_mappings feature. Removing hypervisor mappings
   could potentially unmap other important data shared in the same page.
 - Removed the arm_ prefix from the arch-specific files.
 - Initial SMP host/guest support

Changes since v3:
 - v4 actually works, fully boots a guest
 - Support compiling as a module
 - Use static inlines instead of macros for vcpu_reg and friends
 - Optimize kvm_vcpu_reg function
 - Use Ftrace for trace capabilities
 - Updated documentation and commenting
 - Use KVM_IRQ_LINE instead of KVM_INTERRUPT
 - Emulates load/store instructions not supported through HSR
  syndrome information.
 - Frees 2nd stage translation tables on VM teardown
 - Handles IRQ/FIQ instructions
 - Handles more CP15 accesses
 - Support guest WFI calls
 - Uses debugfs instead of /proc
 - Support compiling in Thumb mode

Changes since v2:
 - Performs world-switch code
 - Maps guest memory using 2nd stage translation
 - Emulates co-processor 15 instructions
 - Forwards I/O faults to QEMU.

---

Christoffer Dall (13):
      ARM: Add page table and page defines needed by KVM
      ARM: Section based HYP idmap
      ARM: Factor out cpuid implementor and part number
      KVM: ARM: Initial skeleton to compile KVM support
      KVM: ARM: Hypervisor inititalization
      KVM: ARM: Memory virtualization setup
      KVM: ARM: Inject IRQs and FIQs from userspace
      KVM: ARM: World-switch implementation
      KVM: ARM: Emulation framework and CP15 emulation
      KVM: ARM: User space API for getting/setting co-proc registers
      KVM: ARM: Demux CCSIDR in the userspace API
      KVM: ARM: Handle guest faults in KVM
      KVM: ARM: Handle I/O aborts

Rusty Russell (1):
      KVM: ARM: VFP userspace interface


 Documentation/virtual/kvm/api.txt           |  135 +++
 arch/arm/Kconfig                            |    2 
 arch/arm/Makefile                           |    1 
 arch/arm/include/asm/cputype.h              |   26 +
 arch/arm/include/asm/idmap.h                |    5 
 arch/arm/include/asm/kvm_arm.h              |  191 +++++
 arch/arm/include/asm/kvm_asm.h              |   84 ++
 arch/arm/include/asm/kvm_coproc.h           |   47 +
 arch/arm/include/asm/kvm_emulate.h          |   64 ++
 arch/arm/include/asm/kvm_host.h             |  159 ++++
 arch/arm/include/asm/kvm_mmio.h             |   51 +
 arch/arm/include/asm/kvm_mmu.h              |   48 +
 arch/arm/include/asm/pgtable-3level-hwdef.h |    5 
 arch/arm/include/asm/pgtable-3level.h       |   18 
 arch/arm/include/asm/pgtable.h              |    7 
 arch/arm/include/uapi/asm/kvm.h             |  125 +++
 arch/arm/kernel/asm-offsets.c               |   23 +
 arch/arm/kernel/perf_event_cpu.c            |   30 -
 arch/arm/kernel/vmlinux.lds.S               |    6 
 arch/arm/kvm/Kconfig                        |   45 +
 arch/arm/kvm/Makefile                       |   22 +
 arch/arm/kvm/arm.c                          |  964 +++++++++++++++++++++++++
 arch/arm/kvm/coproc.c                       | 1045 +++++++++++++++++++++++++++
 arch/arm/kvm/coproc.h                       |  153 ++++
 arch/arm/kvm/coproc_a15.c                   |  164 ++++
 arch/arm/kvm/emulate.c                      |  950 +++++++++++++++++++++++++
 arch/arm/kvm/guest.c                        |  222 ++++++
 arch/arm/kvm/init.S                         |  126 +++
 arch/arm/kvm/interrupts.S                   |  461 ++++++++++++
 arch/arm/kvm/interrupts_head.S              |  409 +++++++++++
 arch/arm/kvm/mmio.c                         |  152 ++++
 arch/arm/kvm/mmu.c                          |  766 ++++++++++++++++++++
 arch/arm/kvm/reset.c                        |   74 ++
 arch/arm/kvm/trace.h                        |  215 ++++++
 arch/arm/mm/idmap.c                         |   74 ++
 arch/arm/mm/mmu.c                           |   25 +
 include/uapi/linux/kvm.h                    |    8 
 mm/memory.c                                 |    2 
 38 files changed, 6868 insertions(+), 36 deletions(-)
 create mode 100644 arch/arm/include/asm/kvm_arm.h
 create mode 100644 arch/arm/include/asm/kvm_asm.h
 create mode 100644 arch/arm/include/asm/kvm_coproc.h
 create mode 100644 arch/arm/include/asm/kvm_emulate.h
 create mode 100644 arch/arm/include/asm/kvm_host.h
 create mode 100644 arch/arm/include/asm/kvm_mmio.h
 create mode 100644 arch/arm/include/asm/kvm_mmu.h
 create mode 100644 arch/arm/include/uapi/asm/kvm.h
 create mode 100644 arch/arm/kvm/Kconfig
 create mode 100644 arch/arm/kvm/Makefile
 create mode 100644 arch/arm/kvm/arm.c
 create mode 100644 arch/arm/kvm/coproc.c
 create mode 100644 arch/arm/kvm/coproc.h
 create mode 100644 arch/arm/kvm/coproc_a15.c
 create mode 100644 arch/arm/kvm/emulate.c
 create mode 100644 arch/arm/kvm/guest.c
 create mode 100644 arch/arm/kvm/init.S
 create mode 100644 arch/arm/kvm/interrupts.S
 create mode 100644 arch/arm/kvm/interrupts_head.S
 create mode 100644 arch/arm/kvm/mmio.c
 create mode 100644 arch/arm/kvm/mmu.c
 create mode 100644 arch/arm/kvm/reset.c
 create mode 100644 arch/arm/kvm/trace.h

-- 

^ permalink raw reply

* [PATCH 3/3] DOC: PWM: Adding binding document for via,vt8500-pwm
From: Thierry Reding @ 2012-10-22  6:35 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1350643135-13197-3-git-send-email-linux@prisktech.co.nz>

On Fri, Oct 19, 2012 at 11:38:55PM +1300, Tony Prisk wrote:
> Add a binding document describing the PWM controller found
> on arch-vt8500 supported SoCs.
> 
> Signed-off-by: Tony Prisk <linux@prisktech.co.nz>
> ---
>  .../devicetree/bindings/pwm/vt8500-pwm.txt         |   17 +++++++++++++++++
>  1 file changed, 17 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/pwm/vt8500-pwm.txt

I think this can be folded into the previous patch. One other comment
below.

> diff --git a/Documentation/devicetree/bindings/pwm/vt8500-pwm.txt b/Documentation/devicetree/bindings/pwm/vt8500-pwm.txt
> new file mode 100644
> index 0000000..e8ba133
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/pwm/vt8500-pwm.txt
> @@ -0,0 +1,17 @@
> +VIA/Wondermedia VT8500/WM8xxx series SoC PWM controller
> +
> +Required properties:
> +- compatible: should be "via,vt8500-pwm"
> +- reg: physical base address and length of the controller's registers
> +- #pwm-cells: should be 2.  The first cell specifies the per-chip index
> +  of the PWM to use and the second cell is the period in nanoseconds.
> +- clocks: pHandle to the PWM source clock

I think the common spelling is "phandle".

Thierry
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20121022/53c88482/attachment-0001.sig>

^ permalink raw reply

* [PATCH 2/3] PWM: vt8500: Update vt8500 PWM driver support
From: Thierry Reding @ 2012-10-22  6:34 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1350643135-13197-2-git-send-email-linux@prisktech.co.nz>

On Fri, Oct 19, 2012 at 11:38:54PM +1300, Tony Prisk wrote:
> This patch updates pwm-vt8500.c to support devicetree probing and
> make use of the common clock subsystem.
> 
> Signed-off-by: Tony Prisk <linux@prisktech.co.nz>
> ---
>  drivers/pwm/pwm-vt8500.c |   79 ++++++++++++++++++++++++++++++----------------
>  1 file changed, 51 insertions(+), 28 deletions(-)

On the whole, this looks like a great cleanup. A few minor issues
inline.

I should start with the subject: please keep lowercase pwm: as the
prefix for consistency. Uppercase PWM is used to refer to PWM devices in
prose.

Also I'd rather see the clock subsystem changes and device tree changes
in separate patches, but since both are rather intertwined I won't force
the issue.

> diff --git a/drivers/pwm/pwm-vt8500.c b/drivers/pwm/pwm-vt8500.c
> index ad14389..c2a71ee 100644
> --- a/drivers/pwm/pwm-vt8500.c
> +++ b/drivers/pwm/pwm-vt8500.c
> @@ -1,7 +1,8 @@
>  /*
>   * drivers/pwm/pwm-vt8500.c
>   *
> - *  Copyright (C) 2010 Alexey Charkov <alchark@gmail.com>
> + * Copyright (C) 2012 Tony Prisk <linux@prisktech.co.nz>
> + * Copyright (C) 2010 Alexey Charkov <alchark@gmail.com>
>   *
>   * This software is licensed under the terms of the GNU General Public
>   * License version 2, as published by the Free Software Foundation, and
> @@ -21,14 +22,24 @@
>  #include <linux/io.h>
>  #include <linux/pwm.h>
>  #include <linux/delay.h>
> +#include <linux/clk.h>
>  
>  #include <asm/div64.h>
>  
> -#define VT8500_NR_PWMS 4
> +#include <linux/of.h>
> +#include <linux/of_device.h>
> +#include <linux/of_address.h>
> +
> +/*
> + * SoC architecture allocates register space for 4 PWMs but only
> + * 2 are currently implemented.
> + */
> +#define VT8500_NR_PWMS	2
>  
>  struct vt8500_chip {
>  	struct pwm_chip chip;
>  	void __iomem *base;
> +	struct clk *clk;
>  };
>  
>  #define to_vt8500_chip(chip)	container_of(chip, struct vt8500_chip, chip)
> @@ -52,7 +63,7 @@ static int vt8500_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm,
>  	unsigned long long c;
>  	unsigned long period_cycles, prescale, pv, dc;
>  
> -	c = 25000000/2; /* wild guess --- need to implement clocks */
> +	c = clk_get_rate(vt8500->clk);
>  	c = c * period_ns;
>  	do_div(c, 1000000000);
>  	period_cycles = c;
> @@ -107,12 +118,22 @@ static struct pwm_ops vt8500_pwm_ops = {
>  	.owner = THIS_MODULE,
>  };
>  
> -static int __devinit pwm_probe(struct platform_device *pdev)
> +static const struct of_device_id vt8500_pwm_dt_ids[] = {
> +	{ .compatible = "via,vt8500-pwm", },
> +	{ /* Sentinel */ }
> +};
> +
> +static int __devinit vt8500_pwm_probe(struct platform_device *pdev)

Since you're changing this line anyway, maybe you should drop __devinit
(and __devexit for the .remove() callback). HOTPLUG is always enabled
nowadays and will go away eventually, in which case these will need to
be removed anyway.

>  {
>  	struct vt8500_chip *chip;
> -	struct resource *r;
> +	struct device_node *np = pdev->dev.of_node;
>  	int ret;
>  
> +	if (!np) {
> +		dev_err(&pdev->dev, "invalid devicetree node\n");
> +		return -EINVAL;
> +	}
> +

This effectively makes DT support mandatory. Shouldn't you be adding a
"depends on OF" into the Kconfig section in that case?

>  	chip = devm_kzalloc(&pdev->dev, sizeof(*chip), GFP_KERNEL);
>  	if (chip == NULL) {
>  		dev_err(&pdev->dev, "failed to allocate memory\n");
> @@ -123,26 +144,32 @@ static int __devinit pwm_probe(struct platform_device *pdev)
>  	chip->chip.ops = &vt8500_pwm_ops;
>  	chip->chip.base = -1;
>  	chip->chip.npwm = VT8500_NR_PWMS;
> +	chip->clk = of_clk_get(np, 0);

I thought this was supposed to work transparently across OF and !OF
configurations by using just clk_get() or devm_clk_get()? I guess that
if the driver depends on OF, then this would be moot, but we should
probably stick to the standard usage anyway.

Furthermore, of_clk_get() doesn't seem to be managed, so you'd need to
add explicit clk_put() in the error cleanup paths. One more argument in
favour of using devm_clk_get() instead.

> -	r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> -	if (r == NULL) {
> -		dev_err(&pdev->dev, "no memory resource defined\n");
> -		return -ENODEV;
> +	if (!chip->clk) {
> +		dev_err(&pdev->dev, "clock source not specified\n");
> +		return -EINVAL;
>  	}
>  
> -	chip->base = devm_request_and_ioremap(&pdev->dev, r);
> -	if (chip->base == NULL)
> +	chip->base = of_iomap(np, 0);

No need to change this. It should work with the standard calls as well.

> +	if (!chip->base) {
> +		dev_err(&pdev->dev, "memory resource not available\n");
>  		return -EADDRNOTAVAIL;
> +	}
> +
> +	clk_prepare_enable(chip->clk);

Why does the clock need to be enabled here? Shouldn't it be postponed to
the last possible moment to save power?

>  
>  	ret = pwmchip_add(&chip->chip);
> -	if (ret < 0)
> +	if (ret < 0) {
> +		dev_err(&pdev->dev, "failed to add pwmchip\n");
>  		return ret;
> +	}
>  
>  	platform_set_drvdata(pdev, chip);
>  	return ret;
>  }
>  
> -static int __devexit pwm_remove(struct platform_device *pdev)
> +static int __devexit vt8500_pwm_remove(struct platform_device *pdev)
>  {
>  	struct vt8500_chip *chip;
>  
> @@ -150,28 +177,24 @@ static int __devexit pwm_remove(struct platform_device *pdev)
>  	if (chip == NULL)
>  		return -ENODEV;
>  
> +	clk_disable_unprepare(chip->clk);
> +

Again, shouldn't it be more efficient power-wise to disable this as soon
as the last PWM device is disabled?

>  	return pwmchip_remove(&chip->chip);
>  }
>  
> -static struct platform_driver pwm_driver = {
> +static struct platform_driver vt8500_pwm_driver = {
> +	.probe		= vt8500_pwm_probe,
> +	.remove		= __devexit_p(vt8500_pwm_remove),

__devexit_p can also be removed.

>  	.driver		= {
>  		.name	= "vt8500-pwm",
>  		.owner	= THIS_MODULE,
> +		.of_match_table = vt8500_pwm_dt_ids,
>  	},
> -	.probe		= pwm_probe,
> -	.remove		= __devexit_p(pwm_remove),
>  };
>  
> -static int __init pwm_init(void)
> -{
> -	return platform_driver_register(&pwm_driver);
> -}
> -arch_initcall(pwm_init);
> -
> -static void __exit pwm_exit(void)
> -{
> -	platform_driver_unregister(&pwm_driver);
> -}
> -module_exit(pwm_exit);
> +module_platform_driver(vt8500_pwm_driver);
>  
> -MODULE_LICENSE("GPL");
> +MODULE_DESCRIPTION("VT8500 PWM Driver");
> +MODULE_AUTHOR("Tony Prisk <linux@prisktech.co.nz>");
> +MODULE_LICENSE("GPL v2");

IANAL, but I think you need the approval of all authors of this code
before changing the license. But I see that the file header actually
says that this code is GPL v2, so maybe this change could be considered
a bugfix. =)

> +MODULE_DEVICE_TABLE(of, vt8500_pwm_dt_ids);

I think it is customary to put this right after the device table
definition.

> -- 
> 1.7.9.5
> 
> 
> 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20121022/9ea2d26e/attachment.sig>

^ permalink raw reply

* [PATCH 2/3] RTC: omap-rtc: enable pm_runtime
From: Hiremath, Vaibhav @ 2012-10-22  5:59 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <50845249.2000007@gmail.com>

On Mon, Oct 22, 2012 at 01:21:37, Daniel Mack wrote:
> On 19.10.2012 12:58, Mohammed, Afzal wrote:
> > Hi Daniel,
> > 
> > On Thu, Oct 18, 2012 at 22:03:13, Hiremath, Vaibhav wrote:
> >> On Thu, Oct 18, 2012 at 21:49:44, Daniel Mack wrote:
> >>> On 18.10.2012 18:12, Vaibhav Hiremath wrote:
> > 
> >>>> It would be really helpful if you could test these patches and ack them.
> > 
> >>> Ok, will do tomorrow. What's missing there is support for writing to the
> >>> OMAP_RTC_OSC_REG (path 3/3 in my series). Would like me to rebase the
> >>> functionality? I need thatkind of setup for my board ...
> > 
> >> This is bit tricky and required more discussion before merging it, 
> >> let me reopen the old discussion which I had started some time back -
> >>
> >>
> >> RTC OSC clock is required to configure clocksource systemtimer for the 
> >> kernel, and it is important when you get into PM related features.
> >>
> >> Please refer the below commit for more reference,
> >>
> >> http://marc.info/?l=u-boot&m=135057734713796&w=2
> > 
> > Newer version (v4) of omap rtc patches for am335x has been
> > posted, "rtc: omap dt support (for am33xx)".
> > In case you can test, please do it over the new series.
> > 
> > You would need also need DT patch that adds DT node to
> > test (it has been separated from the series as it is
> > felt that it should not be part of same series),
> > "arm/dts: am33xx rtc node"
> 
> Agreed. I tested your patches and they do basically the same thing than
> mine. You can take my
> 
>   Tested-by: Daniel Mack <zonque@gmail.com>
> 

Thanks Daniel for testing these patches.

> on all patches in this series except for 2/5 which I didn't test as I
> don't have any Davinci platform.
> 
> > If you are using mainline uboot, you would need the fix as
> > mentioned by Vaibhav H (as in the link he provided above),
> > expecting it to reach uboot mainline soon.
> > 
> > If the above is being attempted to achieve in Kernel it
> > would cause 2-3 seconds delay in boot time (else it had
> > to be made a module), please refer link provided by
> > Vaibhav H for more details.
> > 
> > else you can do in current mainline uboot,
> > 
> > mw.l 0x44e3e06c 0x83e70b13
> > mw.l 0x44e3e070 0x95a4f1e0
> > mw.b 0x44e3e054 0x48
> >
> > and then boot kernel.
> 
> I'm surprised that survives the kernel boot, but I'll give it a try. In
> case you want to add that logic to the kernel as well, please copy me in
> the discussion :)
> 
> 

Certainly...

Some background information for your reference,
We had some discussion in the past on this, and we decided to make this as a 
fallback mechanism considering following scenarios - 

 - System built with 32k crystal OSC, connected to RTC module

 - System without 32k crystal OSC, as RTC is not used.

 - Boot-Loader dependency for RTC clock enable (required for system-timer)

So the fallback mechanism would be something similar -

http://arago-project.org/git/projects/?p=linux-am33x.git;a=commit;h=58abec6ac010f4f8818caa4a52d16c4802e14acc


Thanks,
Vaibhav

> Thanks,
> Daniel
> 
> 

^ permalink raw reply

* [PATCH 3/5] ARM: OMAP2+: powerdomain/PRM: move the low-level powerdomain functions into PRM
From: Hiremath, Vaibhav @ 2012-10-22  5:57 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <alpine.DEB.2.00.1210201747550.27264@utopia.booyaka.com>

On Sat, Oct 20, 2012 at 23:20:18, Paul Walmsley wrote:
> 
> Hi Rajendra, Russ, Santosh,
> 
> thanks for your Reviewed-bys and acks and comments.  Have folded them into 
> the series here.  Russ, the file headers have been updated per your 
> comments.  Also while there, the copyrights from the 
> {clock,power}domainxxxx.c files were copied in, along with Rajendra's 
> authorship line.
> 

Sorry for delayed response,

I have just tested it on Beaglebone platform without any issues. I tested 
your branch 
"prm_cm_split_cleanup_3.8" + gpmc patch from Jon (already in linus/master).

So to this compete patch-series,

Reviewed-Acked-Tested-By: Vaibhav Hiremath <hvaibhav@ti.com>

Thanks,
Vaibhav

> 
> - Paul
> 

^ permalink raw reply

* [RFC PATCH v3 00/16] DMA Engine support for AM33XX
From: Bedia, Vaibhav @ 2012-10-22  5:53 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <20121019164615.GH25164@beef>

On Fri, Oct 19, 2012 at 22:16:15, Porter, Matt wrote:
> On Fri, Oct 19, 2012 at 12:02:42PM +0000, Bedia, Vaibhav wrote:
> > On Fri, Oct 19, 2012 at 16:45:58, Porter, Matt wrote:
> > > On Fri, Oct 19, 2012 at 10:26:20AM +0000, Bedia, Vaibhav wrote:
> > [...]
> > > > 
> > > > I didn't see all the patches that you posted on edma-dmaengine-v3
> > > > but I do seem them on edma-dmaengine-am33xx-v3 branch.
> > > 
> > > I see I referenced the wrong branch in the cover letter. Thanks for
> > > testing and noticing this. Sorry to make you hunt for the correct
> > > branch in that repo. ;) 
> > > 
> > 
> > No problem.
> > 
> > > https://github.com/ohporter/linux/tree/edma-dmaengine-am33xx-v3
> > > is indeed the correct branch for those wanting to pull this in or
> > > grab some of the not-to-be-merged drivers I used for testing.
> > > 
> > > > I added a couple of patches to enable earlyprintk and build the DTB
> > > > appended kernel image uImage-dtb.am335x-evm
> > > > 
> > > > Here's what i see
> > > > 
> > > > [...]
> > > 
> > > <snip>
> > > 
> > > > [    0.175354] edma: probe of 49000000.edma failed with error -16
> > > 
> > > I missed an uninitialized pdata case in the bug fixes mentioned in
> > > the changelog and the folks previously failing the same way didn't
> > > hit the case I suspect you are hitting. Can you try this and let me
> > > know how it works?
> > > 
> > 
> > That doesn't help :(
> 
> Ok, so I dumped my Linaro toolchain which was masking this issue that
> you got unlucky with on EVM, whereas I was lucky. Switching toolchains I
> was able to reproduce the problem. Pantelis Antoniou suggested some
> changes and the following fixes this issue for me...verified on both
> BeagleBone and EVM. Let me know if that works on your end and I'll
> incorporate some version of it in the next update.

Heh I would not have suspected the toolchain so early ;)

> 
> diff --git a/arch/arm/common/edma.c b/arch/arm/common/edma.c
> index b761b7a..6ed394f 100644
> --- a/arch/arm/common/edma.c
> +++ b/arch/arm/common/edma.c
> @@ -1598,6 +1598,8 @@ static struct of_dma_filter_info edma_filter_info = {
>  static int __init edma_probe(struct platform_device *pdev)
>  {
>  	struct edma_soc_info	**info = pdev->dev.platform_data;
> +	struct edma_soc_info	*ninfo[EDMA_MAX_CC] = {NULL, NULL};
> +	struct edma_soc_info	tmpinfo;
>  	s8			(*queue_priority_mapping)[2];
>  	s8			(*queue_tc_mapping)[2];
>  	int			i, j, off, ln, found = 0;
> @@ -1614,15 +1616,13 @@ static int __init edma_probe(struct platform_device *pdev)
>  	char			irq_name[10];
>  	struct device_node	*node = pdev->dev.of_node;
>  	struct device		*dev = &pdev->dev;
> -	struct edma_soc_info	*pdata;
>  	int			ret;
>  
>  	if (node) {
> -		pdata = devm_kzalloc(dev,
> -				     sizeof(struct edma_soc_info),
> -				     GFP_KERNEL);
> -		edma_of_parse_dt(dev, node, pdata);
> -		info = &pdata;
> +		info = ninfo;
> +		edma_of_parse_dt(dev, node, &tmpinfo);
> +		info[0] = &tmpinfo;
> +
>  		dma_cap_set(DMA_SLAVE, edma_filter_info.dma_cap);
>  		of_dma_controller_register(dev->of_node,
>  					   of_dma_simple_xlate,
> 

With the above diff, the kernel boots fine on the EVM.

> > Looking at the original crash log, I suspect something is not correct
> > with the irq portion, probably in the DT or the driver. 
> > 
> > "genirq: Flags mismatch irq 28. 00000000 (edma) vs. 00000000 (edma)"
> > 
> > The warning below that is coming due to fail case in edma_probe not tracking
> > the request_irq status properly and but IMO that's a separate issue.
> 
> It is a separate issue, indeed. My ideal goal was to avoid changing
> anything in this existing davinci dma implementation, that's why the
> error paths were unmodified. Since I'm having to rework a few more things
> I'll look at those and generate an improved version.
> 
> Russ Dill also made some good simplification/cleanup suggestions for the
> of parsing on irc which I'll incorporate in the next version.

Ok, sounds good.

Regards,
Vaibhav

^ permalink raw reply

* [PATCH] usb: phy: samsung: Introducing usb phy driver for hsotg
From: Praveen Paneri @ 2012-10-22  5:43 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <20121020191919.GA555@elf.ucw.cz>

Hi,

On Sun, Oct 21, 2012 at 12:49 AM, Pavel Machek <pavel@ucw.cz> wrote:
> Hi!
>
>> > +#define S3C_PHYPWR                         (0x00)
> ...
>> > +#define S3C_PHYCLK                         (0x04)
>> > +
>> > +#define S3C_PHYCLK_MODE_SERIAL                     (1 << 6)
>> > +#define S3C_PHYCLK_EXT_OSC                 (1 << 5)
>> > +#define S3C_PHYCLK_COMMON_ON_N                     (1 << 4)
>> > +#define S3C_PHYCLK_ID_PULL                 (1 << 2)
>> > +#define S3C_PHYCLK_CLKSEL_MASK                     (0x3 << 0)
>> > +#define S3C_PHYCLK_CLKSEL_SHIFT                    (0)
>> > +#define S3C_PHYCLK_CLKSEL_48M                      (0x0 << 0)
>> > +#define S3C_PHYCLK_CLKSEL_12M                      (0x2 << 0)
>> > +#define S3C_PHYCLK_CLKSEL_24M                      (0x3 << 0)
>
> I believe these 0x 's should be removed. Ouch and << 0 is interesting,
> too, just remove it.
Yes it makes sense to maintain a uniform pattern across all the
definition. How about maintaining hex values everywhere instead of
dropping 0x's? It will make it easier to add big values to the
definitions tomorrow, if needed.
About "<< 0", IMHO people must have started using it to maintain a
parallelism with other definitions. I do not mind changing it if you
still feel that it's very much needed
thanks :)

Praveen
>
>                                                                         Pavel
> --
> (english) http://www.livejournal.com/~pavelmachek
> (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
> --
> To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
> the body of a message to majordomo at vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* [PATCH v2] ARM: SMP_TWD: make setup()/stop() reentrant
From: Shawn Guo @ 2012-10-22  5:13 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1350640589-31821-1-git-send-email-linus.walleij@linaro.org>

On Fri, Oct 19, 2012 at 11:56:29AM +0200, Linus Walleij wrote:
> This makes the SMP_TWD clock .setup()/.stop() pair reentrant by
> not re-fetching the clk and re-registering the clock event every
> time .setup() is called. We also make sure to call the
> clk_enable()/clk_disable() pair on subsequent calls.
> 
> As it has been brought to my knowledge that this pair is going
> to be called from atomic contexts for CPU clusters coming and
> going, the clk_prepare()/clk_unprepare() calls cannot be called
> on subsequent .setup()/.stop() iterations.
> 
> The patch assumes that the code will make sure that
> twd_set_mode() is called through .set_mode() on the clock
> event *after* the .setup() call, so that the timer registers
> are fully re-programmed after a new .setup() cycle.
> 
> Cc: Shawn Guo <shawn.guo@linaro.org>
> Reported-by: Peter Chen <peter.chen@freescale.com>
> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
> ---
> Peter/Shawn: can you please respond with a Tested-by from your
> system(s) to indicate if this works as expected?

I have seen two problems with the patch.

1. twd_timer_setup() is called on per-cpu path, and initial_setup_called
   should be a per-cpu variable.

2. When secondary cores get off-line, the clockevent devices for
   the cores will be released.  So when they become online, the
   clockevent devices should be registered again.

I can only have my system work as expected with the following changes.

Shawn

8<----

diff --git a/arch/arm/kernel/smp_twd.c b/arch/arm/kernel/smp_twd.c
index 5c2d85b..b826bf0 100644
--- a/arch/arm/kernel/smp_twd.c
+++ b/arch/arm/kernel/smp_twd.c
@@ -31,7 +31,7 @@ static void __iomem *twd_base;

 static struct clk *twd_clk;
 static unsigned long twd_timer_rate;
-static bool initial_setup_called;
+static DEFINE_PER_CPU(bool, initial_setup_called);

 static struct clock_event_device __percpu **twd_evt;
 static int twd_ppi;
@@ -275,20 +275,22 @@ static struct clk *twd_get_clock(void)
 static int __cpuinit twd_timer_setup(struct clock_event_device *clk)
 {
        struct clock_event_device **this_cpu_clk;
+       int cpu = smp_processor_id();

        /*
         * If the basic setup has been done before, don't bother
         * with yet again looking up the clock and register the clock
         * source.
         */
-       if (initial_setup_called) {
+       if (per_cpu(initial_setup_called, cpu)) {
                if (!IS_ERR(twd_clk))
                        clk_enable(twd_clk);
                __raw_writel(0, twd_base + TWD_TIMER_CONTROL);
+               clockevents_register_device(*__this_cpu_ptr(twd_evt));
                enable_percpu_irq(clk->irq, 0);
                return 0;
        }
-       initial_setup_called = true;
+       per_cpu(initial_setup_called, cpu) = true;

        twd_clk = twd_get_clock();

^ permalink raw reply related

* Which kirkwood does your DT board use?
From: Andrew Lunn @ 2012-10-22  5:10 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <alpine.DEB.2.00.1210201305070.10589@marmot.wormnet.eu>

> DNS-320:-
> Kirkwood: MV88F6281-A1, TCLK=166666667
> 
> DNS-325:-
> Kirkwood: MV88F6281-A1, TCLK=200000000
> 
> "compatible" currently says "marvell,kirkwood-88f6281" for both. Is
> this the right string to use or should it be 88f6281-a1?

As far as i know, there is no code difference for different stepping
versions of the CPU. So "marvell,kirkwood-88f6281" is good.

	 Thanks
		Andrew

^ permalink raw reply

* 3.7-rc-1 Release Causing application failure for compilation
From: Prabhakar Lad @ 2012-10-22  5:09 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <20121018183930.GA4048@tarshish>

Hi Baruch,

On Fri, Oct 19, 2012 at 12:09 AM, Baruch Siach <baruch@tkos.co.il> wrote:
> Hello Prabhakar Lad,
>
> On Thu, Oct 18, 2012 at 09:49:34PM +0530, Prabhakar Lad wrote:
>> I have updated to 3.7-rc1 kernel version with latest head with
>> commit-id 43c422eda99b894f18d1cca17bcd2401efaf7bd0
>> but when I try to cross compile the Application I am getting following errors.
>>
>> /home/plad/ti/linus/linus/include/linux/types.h:14:26: error:
>> conflicting types for 'fd_set'
>> /home/plad/CodeSourcery/Sourcery_G++_Lite/bin/../arm-none-linux-gnueabi/libc/usr/include/sys/select.h:78:5:
>> note: previous declaration of 'fd_set' was here
>> /home/plad/ti/linus/linus/include/linux/types.h:15:25: error:
>
> [snip]
>
>> I use the codesourcery toolchain for cross compiling the applications
>> for ARM. The same compiler is used to  build the uImage for ARM, but
>> when I try building the apps I see this issue. Can any help me out in
>> fixing this.
>
> It seems that you are including kernel headers directly in your userspace
> code. Don't do that. Types defined in kernel headers conflict with types
> defined in your toolchain's kernel headers. Instead, just use the headers that
> are part of your toolchain, which in turn include kernel headers that your
> toolchain was built with.
>
Thanks for the reply, got it fixed :)

Regards,
--Prabhakar Lad

> baruch
>
> --
>      http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
> =}------------------------------------------------ooO--U--Ooo------------{=
>    - baruch at tkos.co.il - tel: +972.2.679.5364, http://www.tkos.co.il -

^ permalink raw reply

* [PATCH V3] ARM: Kirkwood: new board USI Topkick
From: Andrew Lunn @ 2012-10-22  5:01 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1350872135-5204-1-git-send-email-jason@lakedaemon.net>

On Mon, Oct 22, 2012 at 02:15:35AM +0000, Jason Cooper wrote:
> This is a new kirkwood box made by Universal Scientific Industrial, Inc.
> The product description is here:
> 
> http://www.usish.com/english/products_topkick1281p2.php
> 
> It is very similar to the dreamplug and other plug devices, with the
> exception that it has room for a 2.5" SATA HDD internally.
> 
> Signed-off-by: Jason Cooper <jason@lakedaemon.net>
> ---
> Changes since V2:
>  - corrected comments missed during copy/paste
>  - sorted topkick dtb Makefile entry alphabetically
> 
> Changes since V1:
>  - changes nr-ports to 1 for sata0
>  - included board in defconfig
>  - trimmed #includes
>  - added mvsdio init call
> 
>  arch/arm/boot/dts/Makefile                 |  1 +
>  arch/arm/boot/dts/kirkwood-topkick.dts     | 85 ++++++++++++++++++++++++++++++
>  arch/arm/configs/kirkwood_defconfig        |  1 +
>  arch/arm/mach-kirkwood/Kconfig             |  7 +++
>  arch/arm/mach-kirkwood/Makefile            |  1 +
>  arch/arm/mach-kirkwood/board-dt.c          |  4 ++
>  arch/arm/mach-kirkwood/board-usi_topkick.c | 82 ++++++++++++++++++++++++++++
>  arch/arm/mach-kirkwood/common.h            |  6 +++
>  8 files changed, 187 insertions(+)
>  create mode 100644 arch/arm/boot/dts/kirkwood-topkick.dts
>  create mode 100644 arch/arm/mach-kirkwood/board-usi_topkick.c
> 
> diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
> index c1ce813..a2b6520 100644
> --- a/arch/arm/boot/dts/Makefile
> +++ b/arch/arm/boot/dts/Makefile
> @@ -37,6 +37,7 @@ dtb-$(CONFIG_ARCH_KIRKWOOD) += kirkwood-dns320.dtb \
>  	kirkwood-km_kirkwood.dtb \
>  	kirkwood-lschlv2.dtb \
>  	kirkwood-lsxhl.dtb \
> +	kirkwood-topkick.dtb \
>  	kirkwood-ts219-6281.dtb \
>  	kirkwood-ts219-6282.dtb
>  dtb-$(CONFIG_ARCH_MSM) += msm8660-surf.dtb \
> diff --git a/arch/arm/boot/dts/kirkwood-topkick.dts b/arch/arm/boot/dts/kirkwood-topkick.dts
> new file mode 100644
> index 0000000..c0de5a7
> --- /dev/null
> +++ b/arch/arm/boot/dts/kirkwood-topkick.dts
> @@ -0,0 +1,85 @@
> +/dts-v1/;
> +
> +/include/ "kirkwood.dtsi"
> +
> +/ {
> +	model = "Univeral Scientific Industrial Co. Topkick-1281P2";
> +	compatible = "usi,topkick-1281P2", "usi,topkick", "marvell,kirkwood-88f6282", "marvell,kirkwood";
> +
> +	memory {
> +		device_type = "memory";
> +		reg = <0x00000000 0x10000000>;
> +	};
> +
> +	chosen {
> +		bootargs = "console=ttyS0,115200n8 earlyprintk";
> +	};
> +
> +	ocp at f1000000 {
> +		serial at 12000 {
> +			clock-frequency = <200000000>;
> +			status = "ok";
> +		};
> +
> +		nand at 3000000 {
> +			status = "okay";
> +
> +			partition at 0 {
> +				label = "u-boot";
> +				reg = <0x0000000 0x180000>;
> +			};
> +
> +			partition at 180000 {
> +				label = "u-boot env";
> +				reg = <0x0180000 0x20000>;
> +			};
> +
> +			partition at 200000 {
> +				label = "uImage";
> +				reg = <0x0200000 0x600000>;
> +			};
> +
> +			partition at 800000 {
> +				label = "uInitrd";
> +				reg = <0x0800000 0x1000000>;
> +			};
> +
> +			partition at 1800000 {
> +				label = "rootfs";
> +				reg = <0x1800000 0xe800000>;
> +			};
> +		};
> +
> +		sata at 80000 {
> +			status = "okay";
> +			nr-ports = <1>;
> +		};
> +	};
> +
> +	gpio-leds {
> +		compatible = "gpio-leds";
> +
> +		disk {
> +			label = "topkick:yellow:disk";
> +			gpios = <&gpio0 21 1>;
> +			linux,default-trigger = "ide-disk";
> +		};
> +		system2 {
> +			label = "topkick:red:system";
> +			gpios = <&gpio1 5 1>;
> +		};
> +		system {
> +			label = "topkick:blue:system";
> +			gpios = <&gpio1 6 1>;
> +			default-state = "on";
> +		};
> +		wifi {
> +			label = "topkick:green:wifi";
> +			gpios = <&gpio1 7 1>;
> +		};
> +		wifi2 {
> +			label = "topkick:yellow:wifi";
> +			gpios = <&gpio1 16 1>;
> +		};
> +	};
> +};
> diff --git a/arch/arm/configs/kirkwood_defconfig b/arch/arm/configs/kirkwood_defconfig
> index 74eee0c..72d6c28 100644
> --- a/arch/arm/configs/kirkwood_defconfig
> +++ b/arch/arm/configs/kirkwood_defconfig
> @@ -27,6 +27,7 @@ CONFIG_MACH_GOFLEXNET_DT=y
>  CONFIG_MACH_LSXL_DT=y
>  CONFIG_MACH_IOMEGA_IX2_200_DT=y
>  CONFIG_MACH_KM_KIRKWOOD_DT=y
> +CONFIG_MACH_TOPKICK_DT=y
>  CONFIG_MACH_TS219=y
>  CONFIG_MACH_TS41X=y
>  CONFIG_MACH_DOCKSTAR=y
> diff --git a/arch/arm/mach-kirkwood/Kconfig b/arch/arm/mach-kirkwood/Kconfig
> index 50bca50..b8b5c22 100644
> --- a/arch/arm/mach-kirkwood/Kconfig
> +++ b/arch/arm/mach-kirkwood/Kconfig
> @@ -130,6 +130,13 @@ config MACH_KM_KIRKWOOD_DT
>  	  Say 'Y' here if you want your kernel to support the
>  	  Keymile Kirkwood Reference Desgin, using Flattened Device Tree.
>  
> +config MACH_TOPKICK_DT
> +	bool "USI Topkick (Flattened Device Tree)"
> +	select ARCH_KIRKWOOD_DT
> +	help
> +	  Say 'Y' here if you want your kernel to support the
> +	  USI Topkick, using Flattened Device Tree
> +
>  config MACH_TS219
>  	bool "QNAP TS-110, TS-119, TS-119P+, TS-210, TS-219, TS-219P and TS-219P+ Turbo NAS"
>  	help
> diff --git a/arch/arm/mach-kirkwood/Makefile b/arch/arm/mach-kirkwood/Makefile
> index 294779f..bd463df 100644
> --- a/arch/arm/mach-kirkwood/Makefile
> +++ b/arch/arm/mach-kirkwood/Makefile
> @@ -31,3 +31,4 @@ obj-$(CONFIG_MACH_GOFLEXNET_DT)		+= board-goflexnet.o
>  obj-$(CONFIG_MACH_LSXL_DT)		+= board-lsxl.o
>  obj-$(CONFIG_MACH_IOMEGA_IX2_200_DT)	+= board-iomega_ix2_200.o
>  obj-$(CONFIG_MACH_KM_KIRKWOOD_DT)	+= board-km_kirkwood.o
> +obj-$(CONFIG_MACH_TOPKICK_DT)		+= board-usi_topkick.o
> diff --git a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt.c
> index 70c5a28..33e9217 100644
> --- a/arch/arm/mach-kirkwood/board-dt.c
> +++ b/arch/arm/mach-kirkwood/board-dt.c
> @@ -96,6 +96,9 @@ static void __init kirkwood_dt_init(void)
>  	if (of_machine_is_compatible("keymile,km_kirkwood"))
>  		km_kirkwood_init();
>  
> +	if (of_machine_is_compatible("usi,topkick"))
> +		usi_topkick_init();
> +
>  	of_platform_populate(NULL, kirkwood_dt_match_table,
>  			     kirkwood_auxdata_lookup, NULL);
>  }
> @@ -112,6 +115,7 @@ static const char *kirkwood_dt_board_compat[] = {
>  	"buffalo,lsxl",
>  	"iom,ix2-200",
>  	"keymile,km_kirkwood",
> +	"usi,topkick",
>  	NULL
>  };
>  
> diff --git a/arch/arm/mach-kirkwood/board-usi_topkick.c b/arch/arm/mach-kirkwood/board-usi_topkick.c
> new file mode 100644
> index 0000000..e2ec9d8
> --- /dev/null
> +++ b/arch/arm/mach-kirkwood/board-usi_topkick.c
> @@ -0,0 +1,82 @@
> +/*
> + * Copyright 2012 (C), Jason Cooper <jason@lakedaemon.net>
> + *
> + * arch/arm/mach-kirkwood/board-usi_topkick.c
> + *
> + * USI Topkick Init for drivers not converted to flattened device tree yet.
> + *
> + * 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.
> + */
> +
> +#include <linux/kernel.h>
> +#include <linux/init.h>
> +#include <linux/mv643xx_eth.h>
> +#include <linux/gpio.h>
> +#include <linux/platform_data/mmc-mvsdio.h>
> +#include "common.h"
> +#include "mpp.h"
> +
> +static struct mv643xx_eth_platform_data topkick_ge00_data = {
> +	.phy_addr	= MV643XX_ETH_PHY_ADDR(0),
> +};
> +
> +static struct mvsdio_platform_data topkick_mvsdio_data = {
> +	/* unfortunately the CD signal has not been connected */
> +};
> +
> +/*
> + * GPIO LED layout
> + *
> + *       /-SYS_LED(2)
> + *       |
> + *       |   /-DISK_LED
> + *       |   |
> + *       |   |   /-WLAN_LED(2)
> + *       |   |   |
> + * [SW] [*] [*] [*]
> + */
> +
> +/*
> + * Switch positions
> + *
> + *     /-SW_LEFT
> + *     |
> + *     |   /-SW_IDLE
> + *     |   |
> + *     |   |   /-SW_RIGHT
> + *     |   |   |
> + * PS [L] [I] [R] LEDS
> + */
> +
> +static unsigned int topkick_mpp_config[] __initdata = {
> +	MPP21_GPIO,	/* DISK_LED           (low active) - yellow */
> +	MPP36_GPIO,	/* SATA0 power enable (high active) */
> +	MPP37_GPIO,	/* SYS_LED2           (low active) - red */
> +	MPP38_GPIO,	/* SYS_LED            (low active) - blue */
> +	MPP39_GPIO,	/* WLAN_LED           (low active) - green */
> +	MPP43_GPIO,	/* SW_LEFT            (low active) */
> +	MPP44_GPIO,     /* SW_RIGHT           (low active) */
> +	MPP45_GPIO,	/* SW_IDLE            (low active) */
> +	MPP46_GPIO,     /* SW_LEFT            (low active) */
> +	MPP48_GPIO,	/* WLAN_LED2          (low active) - yellow */
> +	0
> +};
> +
> +#define TOPKICK_SATA0_PWR_ENABLE 36
> +
> +void __init usi_topkick_init(void)
> +{
> +	/*
> +	 * Basic setup. Needs to be called early.
> +	 */
> +	kirkwood_mpp_conf(topkick_mpp_config);
> +
> +	/* SATA0 power enable */
> +	gpio_set_value(TOPKICK_SATA0_PWR_ENABLE, 1);
> +
> +	kirkwood_ehci_init();
> +	kirkwood_ge00_init(&topkick_ge00_data);
> +	kirkwood_sdio_init(&topkick_mvsdio_data);
> +}
> diff --git a/arch/arm/mach-kirkwood/common.h b/arch/arm/mach-kirkwood/common.h
> index bcffd7c..46b47d1 100644
> --- a/arch/arm/mach-kirkwood/common.h
> +++ b/arch/arm/mach-kirkwood/common.h
> @@ -112,6 +112,12 @@ void km_kirkwood_init(void);
>  static inline void km_kirkwood_init(void) {};
>  #endif
>  
> +#ifdef CONFIG_MACH_TOPKICK_DT
> +void usi_topkick_init(void);
> +#else
> +static inline void usi_topkick_init(void) {};
> +#endif
> +
>  /* early init functions not converted to fdt yet */
>  char *kirkwood_id(void);
>  void kirkwood_l2_init(void);
> -- 
> 1.7.12.4
> 

Hi Jason

Looks good now.

Acked-by: Andrew Lunn <andrew@lunn.ch>

It would be nice if somebody could add a 

Tested-by: 

since a few of us have this hardware, thanks to donations from
Marvell.

How do you want to handle USB conversion to DT, and hopefully soon
pinctrl? 

	 Andrew

^ permalink raw reply

* [RFC 00/11] Convert Kirkwood to pinctrl
From: Andrew Lunn @ 2012-10-22  4:54 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <5084650F.9050208@gmail.com>

> >However, i _think_ Sebastian had a different opinion to your two
> >yes's. Maybe its just for Dove?
> >
> >I hope Sebastian will comment soon.
> 
> Andrew, Thomas,
> 
> we had long discussions about this some time ago. I agree to both
> of Thomas' "yes" above as you convinced me that this is the best
> way of merging plat-orion and mach-mvebu.

O.K, great.

> 
> Do you want to add dove pinctrl to your patch set? If yes, when
> do you want to post v1 of this RFC?

Maybe we should split this into three patchsets.

1) Enable pinctl and gpio for both Dove and Kirkwood
2) Convert all the kirkwood boards
3) Convert all the Dove boards.

The conversion of kirkwood could take some time, since i would like a
tested-by: for each board. I think you have all the current Dove
boards, so could test very quickly. So this split of patchsets should
not hold you up much.

I will post the first two patches in my current set today, so you can
extend it with Dove.

       Andrew

^ permalink raw reply

* [PATCH] ARM: PCI: fix missing unlock on error
From: Wei Yongjun @ 2012-10-22  4:53 UTC (permalink / raw)
  To: linux-arm-kernel

From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

Add the missing unlock on the error handle path in function
nanoengine_read_config() and nanoengine_write_config().

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
---
 arch/arm/mach-sa1100/pci-nanoengine.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-sa1100/pci-nanoengine.c b/arch/arm/mach-sa1100/pci-nanoengine.c
index ff02e2d..6ff07d7 100644
--- a/arch/arm/mach-sa1100/pci-nanoengine.c
+++ b/arch/arm/mach-sa1100/pci-nanoengine.c
@@ -67,8 +67,10 @@ static int nanoengine_read_config(struct pci_bus *bus, unsigned int devfn, int w
 	spin_lock_irqsave(&nano_lock, flags);
 
 	ret = nanoengine_get_pci_address(bus, devfn, where, &address);
-	if (ret != PCIBIOS_SUCCESSFUL)
+	if (ret != PCIBIOS_SUCCESSFUL) {
+		spin_unlock_irqrestore(&nano_lock, flags);
 		return ret;
+	}
 	v = __raw_readl(address);
 
 	spin_unlock_irqrestore(&nano_lock, flags);
@@ -95,8 +97,10 @@ static int nanoengine_write_config(struct pci_bus *bus, unsigned int devfn, int
 	spin_lock_irqsave(&nano_lock, flags);
 
 	ret = nanoengine_get_pci_address(bus, devfn, where, &address);
-	if (ret != PCIBIOS_SUCCESSFUL)
+	if (ret != PCIBIOS_SUCCESSFUL) {
+		spin_unlock_irqrestore(&nano_lock, flags);
 		return ret;
+	}
 	v = __raw_readl(address);
 	switch (size) {
 	case 1:

^ permalink raw reply related

* [PATCH] ARM: PCI: fix missing unlock on error
From: Wei Yongjun @ 2012-10-22  4:46 UTC (permalink / raw)
  To: linux-arm-kernel

From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

Add the missing unlock on the error handle path in function
nanoengine_read_config() and nanoengine_write_config().

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
---
 arch/arm/mach-sa1100/pci-nanoengine.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-sa1100/pci-nanoengine.c b/arch/arm/mach-sa1100/pci-nanoengine.c
index ff02e2d..6ff07d7 100644
--- a/arch/arm/mach-sa1100/pci-nanoengine.c
+++ b/arch/arm/mach-sa1100/pci-nanoengine.c
@@ -67,8 +67,10 @@ static int nanoengine_read_config(struct pci_bus *bus, unsigned int devfn, int w
 	spin_lock_irqsave(&nano_lock, flags);
 
 	ret = nanoengine_get_pci_address(bus, devfn, where, &address);
-	if (ret != PCIBIOS_SUCCESSFUL)
+	if (ret != PCIBIOS_SUCCESSFUL) {
+		spin_unlock_irqrestore(&nano_lock, flags);
 		return ret;
+	}
 	v = __raw_readl(address);
 
 	spin_unlock_irqrestore(&nano_lock, flags);
@@ -95,8 +97,10 @@ static int nanoengine_write_config(struct pci_bus *bus, unsigned int devfn, int
 	spin_lock_irqsave(&nano_lock, flags);
 
 	ret = nanoengine_get_pci_address(bus, devfn, where, &address);
-	if (ret != PCIBIOS_SUCCESSFUL)
+	if (ret != PCIBIOS_SUCCESSFUL) {
+		spin_unlock_irqrestore(&nano_lock, flags);
 		return ret;
+	}
 	v = __raw_readl(address);
 	switch (size) {
 	case 1:

^ permalink raw reply related

* [PATCH] ARM: tegra30: clocks: add AHB and APB clocks
From: Prashant Gaikwad @ 2012-10-22  4:38 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1350628693-1190-1-git-send-email-josephl@nvidia.com>

On Friday 19 October 2012 12:08 PM, Joseph Lo wrote:
> Adding the AHB and APB bus clock control interface for Tegra30.
>
> Signed-off-by: Joseph Lo<josephl@nvidia.com>
> ---
>   arch/arm/mach-tegra/common.c              |    4 +
>   arch/arm/mach-tegra/tegra30_clocks.c      |  106 +++++++++++++++++++++++++++++
>   arch/arm/mach-tegra/tegra30_clocks.h      |    1 +
>   arch/arm/mach-tegra/tegra30_clocks_data.c |   46 +++++++++++++
>   4 files changed, 157 insertions(+), 0 deletions(-)

<snip>

> +
> +static long tegra30_bus_clk_round_rate(struct clk_hw *hw, unsigned long rate,
> +				unsigned long *prate)
> +{
> +	unsigned long parent_rate = *prate;
> +	s64 divider;
> +
> +	if (rate>= parent_rate)
> +		return rate;
> +

return parent_rate?

> +	divider = parent_rate;
> +	divider += rate - 1;
> +	do_div(divider, rate);
> +
> +	if (divider<  0)
> +		return divider;
> +
> +	if (divider>  4)
> +		divider = 4;
> +	do_div(parent_rate, divider);
> +
> +	return parent_rate;
> +}
>

^ permalink raw reply

* [PATCH v2 1/3] ARM: Kirkwood: Remove unused includes
From: Jason Cooper @ 2012-10-22  3:09 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1350732196-26781-1-git-send-email-andrew@lunn.ch>

On Sat, Oct 20, 2012 at 01:23:14PM +0200, Andrew Lunn wrote:
> With the gradual conversion of C code to DT, there are a number of
> include files which are no longer needed. Remove them.
> 
> Signed-off-by: Andrew Lunn <andrew@lunn.ch>
> ---
>  arch/arm/mach-kirkwood/board-dockstar.c       |   13 -------------
>  arch/arm/mach-kirkwood/board-dreamplug.c      |   15 ---------------
>  arch/arm/mach-kirkwood/board-goflexnet.c      |   13 -------------
>  arch/arm/mach-kirkwood/board-ib62x0.c         |    6 ------
>  arch/arm/mach-kirkwood/board-iconnect.c       |    8 --------
>  arch/arm/mach-kirkwood/board-iomega_ix2_200.c |    2 --
>  arch/arm/mach-kirkwood/board-lsxl.c           |    8 --------
>  arch/arm/mach-kirkwood/board-ts219.c          |    3 ---
>  8 files changed, 68 deletions(-)

Whole series applied to:

git://git.infradead.org/users/jcooper/linux.git kirkwood/cleanup

thx,

Jason.

^ permalink raw reply

* [PATCH 2/2] ARM: kirkwood: use gpio-fan DT binding on lsxl
From: Jason Cooper @ 2012-10-22  3:07 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1350776094-16778-2-git-send-email-michael@walle.cc>

On Sun, Oct 21, 2012 at 01:34:54AM +0200, Michael Walle wrote:
> Remove board specific gpio-fan driver registration. Moved into device tree.
> 
> Signed-off-by: Michael Walle <michael@walle.cc>
> ---
>  arch/arm/boot/dts/kirkwood-lsxl.dtsi |   11 ++++++++
>  arch/arm/mach-kirkwood/board-lsxl.c  |   47 ----------------------------------
>  2 files changed, 11 insertions(+), 47 deletions(-)

Applied to:

git://git.infradead.org/users/jcooper/linux.git kirkwood/boards

thx,

Jason.

^ permalink raw reply

* [PATCH 1/2] ARM: kirkwood: cleanup lsxl board includes
From: Jason Cooper @ 2012-10-22  3:06 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1350776094-16778-1-git-send-email-michael@walle.cc>

On Sun, Oct 21, 2012 at 01:34:53AM +0200, Michael Walle wrote:
> Remove unneeded includes. These are leftovers from platform device
> registrations.
> 
> Signed-off-by: Michael Walle <michael@walle.cc>
> ---
>  arch/arm/mach-kirkwood/board-lsxl.c |    8 --------
>  1 files changed, 0 insertions(+), 8 deletions(-)

Applied to:

git://git.infradead.org/users/jcooper/linux.git kirkwood/cleanup

thx,

Jason.

^ permalink raw reply

* [PATCH v4 5/5] zynq: move static peripheral mappings
From: Josh Cartwright @ 2012-10-22  2:15 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <cover.1351466765.git.josh.cartwright@ni.com>

Shifting them up into the vmalloc region prevents the following warning,
when booting a zynq qemu target with more than 512mb of RAM:

  BUG: mapping for 0xe0000000 at 0xe0000000 out of vmalloc space

In addition, it allows for reuse of these mappings when the proper
drivers issue requests via ioremap().

There are currently unknown issues with the early uart mapping.  For
now, the uart will be mapped to a known working address.

Signed-off-by: Josh Cartwright <josh.cartwright@ni.com>
Cc: John Linn <john.linn@xilinx.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
---
 arch/arm/mach-zynq/common.c                |  6 +++---
 arch/arm/mach-zynq/include/mach/zynq_soc.h | 25 +++++++++++++++----------
 2 files changed, 18 insertions(+), 13 deletions(-)

diff --git a/arch/arm/mach-zynq/common.c b/arch/arm/mach-zynq/common.c
index ba48f06..ba8d14f 100644
--- a/arch/arm/mach-zynq/common.c
+++ b/arch/arm/mach-zynq/common.c
@@ -73,12 +73,12 @@ static struct map_desc io_desc[] __initdata = {
 	{
 		.virtual	= TTC0_VIRT,
 		.pfn		= __phys_to_pfn(TTC0_PHYS),
-		.length		= SZ_4K,
+		.length		= TTC0_SIZE,
 		.type		= MT_DEVICE,
 	}, {
 		.virtual	= SCU_PERIPH_VIRT,
 		.pfn		= __phys_to_pfn(SCU_PERIPH_PHYS),
-		.length		= SZ_8K,
+		.length		= SCU_PERIPH_SIZE,
 		.type		= MT_DEVICE,
 	},
 
@@ -86,7 +86,7 @@ static struct map_desc io_desc[] __initdata = {
 	{
 		.virtual	= UART0_VIRT,
 		.pfn		= __phys_to_pfn(UART0_PHYS),
-		.length		= SZ_4K,
+		.length		= UART0_SIZE,
 		.type		= MT_DEVICE,
 	},
 #endif
diff --git a/arch/arm/mach-zynq/include/mach/zynq_soc.h b/arch/arm/mach-zynq/include/mach/zynq_soc.h
index 218283a..1b8bf0e 100644
--- a/arch/arm/mach-zynq/include/mach/zynq_soc.h
+++ b/arch/arm/mach-zynq/include/mach/zynq_soc.h
@@ -15,27 +15,32 @@
 #ifndef __MACH_XILINX_SOC_H__
 #define __MACH_XILINX_SOC_H__
 
+#include <asm/pgtable.h>
+
 #define PERIPHERAL_CLOCK_RATE		2500000
 
-/* For now, all mappings are flat (physical = virtual)
+/* Static peripheral mappings are mapped at the top of the vmalloc region.  The
+ * early uart mapping causes intermediate problems/failure at certain
+ * addresses, including the very top of the vmalloc region.  Map it at an
+ * address that is known to work.
  */
-#define UART0_PHYS			0xE0000000
-#define UART0_VIRT			UART0_PHYS
+#define UART0_PHYS		0xE0000000
+#define UART0_SIZE		SZ_4K
+#define UART0_VIRT		0xF0001000
 
-#define TTC0_PHYS			0xF8001000
-#define TTC0_VIRT			TTC0_PHYS
+#define TTC0_PHYS		0xF8001000
+#define TTC0_SIZE		SZ_4K
+#define TTC0_VIRT		(VMALLOC_END - TTC0_SIZE)
 
-#define SCU_PERIPH_PHYS			0xF8F00000
-#define SCU_PERIPH_VIRT			SCU_PERIPH_PHYS
+#define SCU_PERIPH_PHYS		0xF8F00000
+#define SCU_PERIPH_SIZE		SZ_8K
+#define SCU_PERIPH_VIRT		(TTC0_VIRT - SCU_PERIPH_SIZE)
 
 /* The following are intended for the devices that are mapped early */
 
 #define TTC0_BASE			IOMEM(TTC0_VIRT)
 #define SCU_PERIPH_BASE			IOMEM(SCU_PERIPH_VIRT)
 
-/*
- * Mandatory for CONFIG_LL_DEBUG, UART is mapped virtual = physical
- */
 #define LL_UART_PADDR	UART0_PHYS
 #define LL_UART_VADDR	UART0_VIRT
 
-- 
1.8.0

^ permalink raw reply related

* [PATCH V3] ARM: Kirkwood: new board USI Topkick
From: Jason Cooper @ 2012-10-22  2:15 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1350679752-11931-1-git-send-email-jason@lakedaemon.net>

This is a new kirkwood box made by Universal Scientific Industrial, Inc.
The product description is here:

http://www.usish.com/english/products_topkick1281p2.php

It is very similar to the dreamplug and other plug devices, with the
exception that it has room for a 2.5" SATA HDD internally.

Signed-off-by: Jason Cooper <jason@lakedaemon.net>
---
Changes since V2:
 - corrected comments missed during copy/paste
 - sorted topkick dtb Makefile entry alphabetically

Changes since V1:
 - changes nr-ports to 1 for sata0
 - included board in defconfig
 - trimmed #includes
 - added mvsdio init call

 arch/arm/boot/dts/Makefile                 |  1 +
 arch/arm/boot/dts/kirkwood-topkick.dts     | 85 ++++++++++++++++++++++++++++++
 arch/arm/configs/kirkwood_defconfig        |  1 +
 arch/arm/mach-kirkwood/Kconfig             |  7 +++
 arch/arm/mach-kirkwood/Makefile            |  1 +
 arch/arm/mach-kirkwood/board-dt.c          |  4 ++
 arch/arm/mach-kirkwood/board-usi_topkick.c | 82 ++++++++++++++++++++++++++++
 arch/arm/mach-kirkwood/common.h            |  6 +++
 8 files changed, 187 insertions(+)
 create mode 100644 arch/arm/boot/dts/kirkwood-topkick.dts
 create mode 100644 arch/arm/mach-kirkwood/board-usi_topkick.c

diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index c1ce813..a2b6520 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -37,6 +37,7 @@ dtb-$(CONFIG_ARCH_KIRKWOOD) += kirkwood-dns320.dtb \
 	kirkwood-km_kirkwood.dtb \
 	kirkwood-lschlv2.dtb \
 	kirkwood-lsxhl.dtb \
+	kirkwood-topkick.dtb \
 	kirkwood-ts219-6281.dtb \
 	kirkwood-ts219-6282.dtb
 dtb-$(CONFIG_ARCH_MSM) += msm8660-surf.dtb \
diff --git a/arch/arm/boot/dts/kirkwood-topkick.dts b/arch/arm/boot/dts/kirkwood-topkick.dts
new file mode 100644
index 0000000..c0de5a7
--- /dev/null
+++ b/arch/arm/boot/dts/kirkwood-topkick.dts
@@ -0,0 +1,85 @@
+/dts-v1/;
+
+/include/ "kirkwood.dtsi"
+
+/ {
+	model = "Univeral Scientific Industrial Co. Topkick-1281P2";
+	compatible = "usi,topkick-1281P2", "usi,topkick", "marvell,kirkwood-88f6282", "marvell,kirkwood";
+
+	memory {
+		device_type = "memory";
+		reg = <0x00000000 0x10000000>;
+	};
+
+	chosen {
+		bootargs = "console=ttyS0,115200n8 earlyprintk";
+	};
+
+	ocp at f1000000 {
+		serial at 12000 {
+			clock-frequency = <200000000>;
+			status = "ok";
+		};
+
+		nand at 3000000 {
+			status = "okay";
+
+			partition at 0 {
+				label = "u-boot";
+				reg = <0x0000000 0x180000>;
+			};
+
+			partition at 180000 {
+				label = "u-boot env";
+				reg = <0x0180000 0x20000>;
+			};
+
+			partition at 200000 {
+				label = "uImage";
+				reg = <0x0200000 0x600000>;
+			};
+
+			partition at 800000 {
+				label = "uInitrd";
+				reg = <0x0800000 0x1000000>;
+			};
+
+			partition at 1800000 {
+				label = "rootfs";
+				reg = <0x1800000 0xe800000>;
+			};
+		};
+
+		sata at 80000 {
+			status = "okay";
+			nr-ports = <1>;
+		};
+	};
+
+	gpio-leds {
+		compatible = "gpio-leds";
+
+		disk {
+			label = "topkick:yellow:disk";
+			gpios = <&gpio0 21 1>;
+			linux,default-trigger = "ide-disk";
+		};
+		system2 {
+			label = "topkick:red:system";
+			gpios = <&gpio1 5 1>;
+		};
+		system {
+			label = "topkick:blue:system";
+			gpios = <&gpio1 6 1>;
+			default-state = "on";
+		};
+		wifi {
+			label = "topkick:green:wifi";
+			gpios = <&gpio1 7 1>;
+		};
+		wifi2 {
+			label = "topkick:yellow:wifi";
+			gpios = <&gpio1 16 1>;
+		};
+	};
+};
diff --git a/arch/arm/configs/kirkwood_defconfig b/arch/arm/configs/kirkwood_defconfig
index 74eee0c..72d6c28 100644
--- a/arch/arm/configs/kirkwood_defconfig
+++ b/arch/arm/configs/kirkwood_defconfig
@@ -27,6 +27,7 @@ CONFIG_MACH_GOFLEXNET_DT=y
 CONFIG_MACH_LSXL_DT=y
 CONFIG_MACH_IOMEGA_IX2_200_DT=y
 CONFIG_MACH_KM_KIRKWOOD_DT=y
+CONFIG_MACH_TOPKICK_DT=y
 CONFIG_MACH_TS219=y
 CONFIG_MACH_TS41X=y
 CONFIG_MACH_DOCKSTAR=y
diff --git a/arch/arm/mach-kirkwood/Kconfig b/arch/arm/mach-kirkwood/Kconfig
index 50bca50..b8b5c22 100644
--- a/arch/arm/mach-kirkwood/Kconfig
+++ b/arch/arm/mach-kirkwood/Kconfig
@@ -130,6 +130,13 @@ config MACH_KM_KIRKWOOD_DT
 	  Say 'Y' here if you want your kernel to support the
 	  Keymile Kirkwood Reference Desgin, using Flattened Device Tree.
 
+config MACH_TOPKICK_DT
+	bool "USI Topkick (Flattened Device Tree)"
+	select ARCH_KIRKWOOD_DT
+	help
+	  Say 'Y' here if you want your kernel to support the
+	  USI Topkick, using Flattened Device Tree
+
 config MACH_TS219
 	bool "QNAP TS-110, TS-119, TS-119P+, TS-210, TS-219, TS-219P and TS-219P+ Turbo NAS"
 	help
diff --git a/arch/arm/mach-kirkwood/Makefile b/arch/arm/mach-kirkwood/Makefile
index 294779f..bd463df 100644
--- a/arch/arm/mach-kirkwood/Makefile
+++ b/arch/arm/mach-kirkwood/Makefile
@@ -31,3 +31,4 @@ obj-$(CONFIG_MACH_GOFLEXNET_DT)		+= board-goflexnet.o
 obj-$(CONFIG_MACH_LSXL_DT)		+= board-lsxl.o
 obj-$(CONFIG_MACH_IOMEGA_IX2_200_DT)	+= board-iomega_ix2_200.o
 obj-$(CONFIG_MACH_KM_KIRKWOOD_DT)	+= board-km_kirkwood.o
+obj-$(CONFIG_MACH_TOPKICK_DT)		+= board-usi_topkick.o
diff --git a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt.c
index 70c5a28..33e9217 100644
--- a/arch/arm/mach-kirkwood/board-dt.c
+++ b/arch/arm/mach-kirkwood/board-dt.c
@@ -96,6 +96,9 @@ static void __init kirkwood_dt_init(void)
 	if (of_machine_is_compatible("keymile,km_kirkwood"))
 		km_kirkwood_init();
 
+	if (of_machine_is_compatible("usi,topkick"))
+		usi_topkick_init();
+
 	of_platform_populate(NULL, kirkwood_dt_match_table,
 			     kirkwood_auxdata_lookup, NULL);
 }
@@ -112,6 +115,7 @@ static const char *kirkwood_dt_board_compat[] = {
 	"buffalo,lsxl",
 	"iom,ix2-200",
 	"keymile,km_kirkwood",
+	"usi,topkick",
 	NULL
 };
 
diff --git a/arch/arm/mach-kirkwood/board-usi_topkick.c b/arch/arm/mach-kirkwood/board-usi_topkick.c
new file mode 100644
index 0000000..e2ec9d8
--- /dev/null
+++ b/arch/arm/mach-kirkwood/board-usi_topkick.c
@@ -0,0 +1,82 @@
+/*
+ * Copyright 2012 (C), Jason Cooper <jason@lakedaemon.net>
+ *
+ * arch/arm/mach-kirkwood/board-usi_topkick.c
+ *
+ * USI Topkick Init for drivers not converted to flattened device tree yet.
+ *
+ * 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.
+ */
+
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/mv643xx_eth.h>
+#include <linux/gpio.h>
+#include <linux/platform_data/mmc-mvsdio.h>
+#include "common.h"
+#include "mpp.h"
+
+static struct mv643xx_eth_platform_data topkick_ge00_data = {
+	.phy_addr	= MV643XX_ETH_PHY_ADDR(0),
+};
+
+static struct mvsdio_platform_data topkick_mvsdio_data = {
+	/* unfortunately the CD signal has not been connected */
+};
+
+/*
+ * GPIO LED layout
+ *
+ *       /-SYS_LED(2)
+ *       |
+ *       |   /-DISK_LED
+ *       |   |
+ *       |   |   /-WLAN_LED(2)
+ *       |   |   |
+ * [SW] [*] [*] [*]
+ */
+
+/*
+ * Switch positions
+ *
+ *     /-SW_LEFT
+ *     |
+ *     |   /-SW_IDLE
+ *     |   |
+ *     |   |   /-SW_RIGHT
+ *     |   |   |
+ * PS [L] [I] [R] LEDS
+ */
+
+static unsigned int topkick_mpp_config[] __initdata = {
+	MPP21_GPIO,	/* DISK_LED           (low active) - yellow */
+	MPP36_GPIO,	/* SATA0 power enable (high active) */
+	MPP37_GPIO,	/* SYS_LED2           (low active) - red */
+	MPP38_GPIO,	/* SYS_LED            (low active) - blue */
+	MPP39_GPIO,	/* WLAN_LED           (low active) - green */
+	MPP43_GPIO,	/* SW_LEFT            (low active) */
+	MPP44_GPIO,     /* SW_RIGHT           (low active) */
+	MPP45_GPIO,	/* SW_IDLE            (low active) */
+	MPP46_GPIO,     /* SW_LEFT            (low active) */
+	MPP48_GPIO,	/* WLAN_LED2          (low active) - yellow */
+	0
+};
+
+#define TOPKICK_SATA0_PWR_ENABLE 36
+
+void __init usi_topkick_init(void)
+{
+	/*
+	 * Basic setup. Needs to be called early.
+	 */
+	kirkwood_mpp_conf(topkick_mpp_config);
+
+	/* SATA0 power enable */
+	gpio_set_value(TOPKICK_SATA0_PWR_ENABLE, 1);
+
+	kirkwood_ehci_init();
+	kirkwood_ge00_init(&topkick_ge00_data);
+	kirkwood_sdio_init(&topkick_mvsdio_data);
+}
diff --git a/arch/arm/mach-kirkwood/common.h b/arch/arm/mach-kirkwood/common.h
index bcffd7c..46b47d1 100644
--- a/arch/arm/mach-kirkwood/common.h
+++ b/arch/arm/mach-kirkwood/common.h
@@ -112,6 +112,12 @@ void km_kirkwood_init(void);
 static inline void km_kirkwood_init(void) {};
 #endif
 
+#ifdef CONFIG_MACH_TOPKICK_DT
+void usi_topkick_init(void);
+#else
+static inline void usi_topkick_init(void) {};
+#endif
+
 /* early init functions not converted to fdt yet */
 char *kirkwood_id(void);
 void kirkwood_l2_init(void);
-- 
1.7.12.4

^ permalink raw reply related

* [PATCH V2] ARM: Kirkwood: new board USI Topkick
From: Jason Cooper @ 2012-10-22  2:03 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <20121021064053.GG21046@lunn.ch>

On Sun, Oct 21, 2012 at 08:40:53AM +0200, Andrew Lunn wrote:
> On Sat, Oct 20, 2012 at 08:09:24PM +0000, Jason Cooper wrote:
> > +static struct mvsdio_platform_data topkick_mvsdio_data = {
> > +	/* unfortunately the CD signal has not been connected */
> > +};
> 
> Is this just cut/paste, or has it been verified that CD is not
> connected?

Both.  ;-)  There is no card slot on the topkick.  I'll have to go back
and test the dreamplug.

thx,

Jason.

^ permalink raw reply

* [GIT PULL] Renesas ARM-based SoC defconfig for v3.8
From: Simon Horman @ 2012-10-22  1:51 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <20121022003350.GL2509@verge.net.au>

On Mon, Oct 22, 2012 at 09:33:51AM +0900, Simon Horman wrote:
> On Fri, Oct 19, 2012 at 08:18:50AM +0000, Arnd Bergmann wrote:
> > On Friday 19 October 2012, Simon Horman wrote:
> > > On Thu, Oct 18, 2012 at 05:13:10PM +0900, Simon Horman wrote:
> > > I have made a limited amount of progress on this trying to create a
> > > defconfig that will work on both the Marzen and Armadillo 800 EVA boards.
> > > 
> > > * Serial console appears to work, although for the Marzen at
> > >   least enabling earlyprintk seems to require the bootloader to specify
> > >   e.g.  console=ttySC2,115200 earlyprintk
> > > 
> > >   This is done by fully specifying bootargs in U-Boot.
> > >   The boodloaders on the Marzen board has an ampty bootargs by default.
> > >
> > >   I guess I can live without earlyprink by default,
> > >   though it does seem to be a regression in the user experience.
> > 
> > Right. So who is using the defconfig for these boards? Usually most
> > people using it actually have their own configuration files that are
> > tuned for their needs, and you often also need to change the command
> > line in order to configure the root partition etc.
> 
> I imagine they are primarily used by developers, like myself, but
> to be honest I am unsure. Ideally I would like the defconfig to be as
> useful as possible out of the box. But I agree that most users probably
> end up making some customisations, e.g. to the location of the rootfs.
> 
> > > * A more significant problem seems to be the use of CONFIG_MEMORY_START
> > >   to define PLAT_PHYS_OFFSET in arch/arm/mach-shmobile/include/mach/memory.h
> > > 
> > >   I'm not sure that I see an easy way to get around this one.
> > 
> > ARM_PATCH_PHYS_VIRT should take care of this, have you tried it?

I believe that this leaves mach-shmobile with three areas
where CONFIG_MEMORY_START/PLAT_PHYS_OFFSET is used.

* arch/arm/mach-shmobile/headsmp.S

  This uses PLAT_PHYS_OFFSET.

  I believe this can be replaced with a run-time calculation. Though I
  haven't thought about the details yet.

* arch/arm/boot/compressed/head-shmobile.S

  This makes use of CONFIG_MEMORY_START.

  This is only used if CONFIG_ZBOOT_ROM is set.

  I'm unsure if this can be replaced with a run-time calculation or not.
  But regardless it is only used if CONFIG_ZBOOT_ROM is set, which is not
  the default at this time.


* arch/arm/mach-shmobile/Makefile.boot

 This makes use of CONFIG_MEMORY_START to set zreladdr.

 I believe that the solution to this is to make use of CONFIG_AUTO_ZRELADDR.
 However, it is not yet clear to me how that can be used in conjunction
 with a uImage.  As I understand it the boot loader on many of our boards,
 including the Marzen board which is my first target for this work, boot
 uImage imagess.

^ permalink raw reply

* [GIT PULL] Renesas ARM-based SoC defconfig for v3.8
From: Simon Horman @ 2012-10-22  0:33 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <201210190818.51359.arnd@arndb.de>

On Fri, Oct 19, 2012 at 08:18:50AM +0000, Arnd Bergmann wrote:
> On Friday 19 October 2012, Simon Horman wrote:
> > On Thu, Oct 18, 2012 at 05:13:10PM +0900, Simon Horman wrote:
> > I have made a limited amount of progress on this trying to create a
> > defconfig that will work on both the Marzen and Armadillo 800 EVA boards.
> > 
> > * Serial console appears to work, although for the Marzen at
> >   least enabling earlyprintk seems to require the bootloader to specify
> >   e.g.  console=ttySC2,115200 earlyprintk
> > 
> >   This is done by fully specifying bootargs in U-Boot.
> >   The boodloaders on the Marzen board has an ampty bootargs by default.
> >
> >   I guess I can live without earlyprink by default,
> >   though it does seem to be a regression in the user experience.
> 
> Right. So who is using the defconfig for these boards? Usually most
> people using it actually have their own configuration files that are
> tuned for their needs, and you often also need to change the command
> line in order to configure the root partition etc.

I imagine they are primarily used by developers, like myself, but
to be honest I am unsure. Ideally I would like the defconfig to be as
useful as possible out of the box. But I agree that most users probably
end up making some customisations, e.g. to the location of the rootfs.

> > * A more significant problem seems to be the use of CONFIG_MEMORY_START
> >   to define PLAT_PHYS_OFFSET in arch/arm/mach-shmobile/include/mach/memory.h
> > 
> >   I'm not sure that I see an easy way to get around this one.
> 
> ARM_PATCH_PHYS_VIRT should take care of this, have you tried it?

Thanks, I will look into that.

^ permalink raw reply

* [PATCH] ARM: EXYNOS: exynos4-dt: Set .smp field of machine descriptor
From: Kukjin Kim @ 2012-10-22  0:29 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <CAH9JG2W-Tg5ZwzwuXg3-56KhiLwQS3rGktweRG8XwdVMda=HBg@mail.gmail.com>

Kyungmin Park wrote:
> 
> + Arnd, Olof,
> 
> Tomasz,
> I think it's better to add arm-soc maintainers at CC when send the
patches.
> Samsung patches doesn't handled or merged with proper time.
> 

I did just now. Sorry for late.

[...]

> > Ping. I think this should be considered a fix.
> >
Tomasz, yes I applied this in my -fix. Note this will be sent to upstream
with other Samsung fixes during 3.7-rc, probably in a couple of days.

Thanks for your reminder.

Best regards,
Kgene.
--
Kukjin Kim <kgene.kim@samsung.com>, Senior Engineer,
SW Solution Development Team, Samsung Electronics Co., Ltd.

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox