* [PATCH v2 03/10] ARM: KVM: Initial VGIC MMIO support code
From: Christoffer Dall @ 2012-10-01 9:07 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20121001090716.49038.90056.stgit@ubuntu>
From: Marc Zyngier <marc.zyngier@arm.com>
Wire the initial in-kernel MMIO support code for the VGIC, used
for the distributor emulation.
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Christoffer Dall <c.dall@virtualopensystems.com>
---
arch/arm/include/asm/kvm_vgic.h | 6 +-
arch/arm/kvm/Makefile | 1
arch/arm/kvm/vgic.c | 138 +++++++++++++++++++++++++++++++++++++++
3 files changed, 144 insertions(+), 1 deletion(-)
create mode 100644 arch/arm/kvm/vgic.c
diff --git a/arch/arm/include/asm/kvm_vgic.h b/arch/arm/include/asm/kvm_vgic.h
index e1fd530..a87ec6c 100644
--- a/arch/arm/include/asm/kvm_vgic.h
+++ b/arch/arm/include/asm/kvm_vgic.h
@@ -30,7 +30,11 @@ struct kvm_vcpu;
struct kvm_run;
struct kvm_exit_mmio;
-#ifndef CONFIG_KVM_ARM_VGIC
+#ifdef CONFIG_KVM_ARM_VGIC
+bool vgic_handle_mmio(struct kvm_vcpu *vcpu, struct kvm_run *run,
+ struct kvm_exit_mmio *mmio);
+
+#else
static inline int kvm_vgic_hyp_init(void)
{
return 0;
diff --git a/arch/arm/kvm/Makefile b/arch/arm/kvm/Makefile
index ea5b282..89608c0 100644
--- a/arch/arm/kvm/Makefile
+++ b/arch/arm/kvm/Makefile
@@ -20,3 +20,4 @@ obj-$(CONFIG_KVM_ARM_HOST) += $(addprefix ../../../virt/kvm/, kvm_main.o coalesc
obj-$(CONFIG_KVM_ARM_HOST) += arm.o guest.o mmu.o emulate.o reset.o
obj-$(CONFIG_KVM_ARM_HOST) += coproc.o coproc_a15.o
+obj-$(CONFIG_KVM_ARM_VGIC) += vgic.o
diff --git a/arch/arm/kvm/vgic.c b/arch/arm/kvm/vgic.c
new file mode 100644
index 0000000..26ada3b
--- /dev/null
+++ b/arch/arm/kvm/vgic.c
@@ -0,0 +1,138 @@
+/*
+ * Copyright (C) 2012 ARM Ltd.
+ * Author: Marc Zyngier <marc.zyngier@arm.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#include <linux/kvm.h>
+#include <linux/kvm_host.h>
+#include <linux/interrupt.h>
+#include <linux/io.h>
+#include <asm/kvm_emulate.h>
+
+#define ACCESS_READ_VALUE (1 << 0)
+#define ACCESS_READ_RAZ (0 << 0)
+#define ACCESS_READ_MASK(x) ((x) & (1 << 0))
+#define ACCESS_WRITE_IGNORED (0 << 1)
+#define ACCESS_WRITE_SETBIT (1 << 1)
+#define ACCESS_WRITE_CLEARBIT (2 << 1)
+#define ACCESS_WRITE_VALUE (3 << 1)
+#define ACCESS_WRITE_MASK(x) ((x) & (3 << 1))
+
+/**
+ * vgic_reg_access - access vgic register
+ * @mmio: pointer to the data describing the mmio access
+ * @reg: pointer to the virtual backing of the vgic distributor struct
+ * @offset: least significant 2 bits used for word offset
+ * @mode: ACCESS_ mode (see defines above)
+ *
+ * Helper to make vgic register access easier using one of the access
+ * modes defined for vgic register access
+ * (read,raz,write-ignored,setbit,clearbit,write)
+ */
+static void vgic_reg_access(struct kvm_exit_mmio *mmio, u32 *reg,
+ u32 offset, int mode)
+{
+ int word_offset = offset & 3;
+ int shift = word_offset * 8;
+ u32 mask;
+ u32 regval;
+
+ /*
+ * Any alignment fault should have been delivered to the guest
+ * directly (ARM ARM B3.12.7 "Prioritization of aborts").
+ */
+
+ mask = (~0U) >> (word_offset * 8);
+ if (reg)
+ regval = *reg;
+ else {
+ BUG_ON(mode != (ACCESS_READ_RAZ | ACCESS_WRITE_IGNORED));
+ regval = 0;
+ }
+
+ if (mmio->is_write) {
+ u32 data = (*((u32 *)mmio->data) & mask) << shift;
+ switch (ACCESS_WRITE_MASK(mode)) {
+ case ACCESS_WRITE_IGNORED:
+ return;
+
+ case ACCESS_WRITE_SETBIT:
+ regval |= data;
+ break;
+
+ case ACCESS_WRITE_CLEARBIT:
+ regval &= ~data;
+ break;
+
+ case ACCESS_WRITE_VALUE:
+ regval = (regval & ~(mask << shift)) | data;
+ break;
+ }
+ *reg = regval;
+ } else {
+ switch (ACCESS_READ_MASK(mode)) {
+ case ACCESS_READ_RAZ:
+ regval = 0;
+ /* fall through */
+
+ case ACCESS_READ_VALUE:
+ *((u32 *)mmio->data) = (regval >> shift) & mask;
+ }
+ }
+}
+
+/* All this should be handled by kvm_bus_io_*()... FIXME!!! */
+struct mmio_range {
+ unsigned long base;
+ unsigned long len;
+ bool (*handle_mmio)(struct kvm_vcpu *vcpu, struct kvm_exit_mmio *mmio,
+ u32 offset);
+};
+
+static const struct mmio_range vgic_ranges[] = {
+ {}
+};
+
+static const
+struct mmio_range *find_matching_range(const struct mmio_range *ranges,
+ struct kvm_exit_mmio *mmio,
+ unsigned long base)
+{
+ const struct mmio_range *r = ranges;
+ unsigned long addr = mmio->phys_addr - base;
+
+ while (r->len) {
+ if (addr >= r->base &&
+ (addr + mmio->len) <= (r->base + r->len))
+ return r;
+ r++;
+ }
+
+ return NULL;
+}
+
+/**
+ * vgic_handle_mmio - handle an in-kernel MMIO access
+ * @vcpu: pointer to the vcpu performing the access
+ * @mmio: pointer to the data describing the access
+ *
+ * returns true if the MMIO access has been performed in kernel space,
+ * and false if it needs to be emulated in user space.
+ */
+bool vgic_handle_mmio(struct kvm_vcpu *vcpu, struct kvm_run *run, struct kvm_exit_mmio *mmio)
+{
+ return KVM_EXIT_MMIO;
+}
^ permalink raw reply related
* [PATCH v2 02/10] ARM: KVM: Initial VGIC infrastructure support
From: Christoffer Dall @ 2012-10-01 9:07 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20121001090716.49038.90056.stgit@ubuntu>
From: Marc Zyngier <marc.zyngier@arm.com>
Wire the basic framework code for VGIC support. Nothing to enable
yet.
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Christoffer Dall <c.dall@virtualopensystems.com>
---
arch/arm/include/asm/kvm_host.h | 7 ++++
arch/arm/include/asm/kvm_vgic.h | 65 +++++++++++++++++++++++++++++++++++++++
arch/arm/kvm/arm.c | 21 ++++++++++++-
arch/arm/kvm/interrupts.S | 4 ++
arch/arm/kvm/mmu.c | 3 ++
virt/kvm/kvm_main.c | 5 ++-
6 files changed, 102 insertions(+), 3 deletions(-)
create mode 100644 arch/arm/include/asm/kvm_vgic.h
diff --git a/arch/arm/include/asm/kvm_host.h b/arch/arm/include/asm/kvm_host.h
index 69a8680..d65faea 100644
--- a/arch/arm/include/asm/kvm_host.h
+++ b/arch/arm/include/asm/kvm_host.h
@@ -22,6 +22,7 @@
#include <asm/kvm.h>
#include <asm/kvm_asm.h>
#include <asm/fpstate.h>
+#include <asm/kvm_vgic.h>
#define KVM_MAX_VCPUS NR_CPUS
#define KVM_MEMORY_SLOTS 32
@@ -52,6 +53,9 @@ struct kvm_arch {
/* VTTBR value associated with above pgd and vmid */
u64 vttbr;
+
+ /* Interrupt controller */
+ struct vgic_dist vgic;
};
#define KVM_NR_MEM_OBJS 40
@@ -87,6 +91,9 @@ struct kvm_vcpu_arch {
struct vfp_hard_struct vfp_guest;
struct vfp_hard_struct *vfp_host;
+ /* VGIC state */
+ struct vgic_cpu vgic_cpu;
+
/*
* Anything that is not used directly from assembly code goes
* here.
diff --git a/arch/arm/include/asm/kvm_vgic.h b/arch/arm/include/asm/kvm_vgic.h
new file mode 100644
index 0000000..e1fd530
--- /dev/null
+++ b/arch/arm/include/asm/kvm_vgic.h
@@ -0,0 +1,65 @@
+/*
+ * Copyright (C) 2012 ARM Ltd.
+ * Author: Marc Zyngier <marc.zyngier@arm.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef __ASM_ARM_KVM_VGIC_H
+#define __ASM_ARM_KVM_VGIC_H
+
+struct vgic_dist {
+};
+
+struct vgic_cpu {
+};
+
+struct kvm;
+struct kvm_vcpu;
+struct kvm_run;
+struct kvm_exit_mmio;
+
+#ifndef CONFIG_KVM_ARM_VGIC
+static inline int kvm_vgic_hyp_init(void)
+{
+ return 0;
+}
+
+static inline int kvm_vgic_init(struct kvm *kvm)
+{
+ return 0;
+}
+
+static inline void kvm_vgic_vcpu_init(struct kvm_vcpu *vcpu) {}
+static inline void kvm_vgic_sync_to_cpu(struct kvm_vcpu *vcpu) {}
+static inline void kvm_vgic_sync_from_cpu(struct kvm_vcpu *vcpu) {}
+
+static inline int kvm_vgic_vcpu_pending_irq(struct kvm_vcpu *vcpu)
+{
+ return 0;
+}
+
+static inline bool vgic_handle_mmio(struct kvm_vcpu *vcpu, struct kvm_run *run,
+ struct kvm_exit_mmio *mmio)
+{
+ return false;
+}
+
+static inline int irqchip_in_kernel(struct kvm *kvm)
+{
+ return 0;
+}
+#endif
+
+#endif
diff --git a/arch/arm/kvm/arm.c b/arch/arm/kvm/arm.c
index 8764dd0..cf13340 100644
--- a/arch/arm/kvm/arm.c
+++ b/arch/arm/kvm/arm.c
@@ -183,6 +183,9 @@ int kvm_dev_ioctl_check_extension(long ext)
{
int r;
switch (ext) {
+#ifdef CONFIG_KVM_ARM_VGIC
+ case KVM_CAP_IRQCHIP:
+#endif
case KVM_CAP_USER_MEMORY:
case KVM_CAP_DESTROY_MEMORY_REGION_WORKS:
case KVM_CAP_ONE_REG:
@@ -301,6 +304,10 @@ int kvm_arch_vcpu_init(struct kvm_vcpu *vcpu)
{
/* Force users to call KVM_ARM_VCPU_INIT */
vcpu->arch.target = -1;
+
+ /* Set up VGIC */
+ kvm_vgic_vcpu_init(vcpu);
+
return 0;
}
@@ -360,7 +367,7 @@ int kvm_arch_vcpu_ioctl_set_mpstate(struct kvm_vcpu *vcpu,
*/
int kvm_arch_vcpu_runnable(struct kvm_vcpu *v)
{
- return !!v->arch.irq_lines;
+ return !!v->arch.irq_lines || kvm_vgic_vcpu_pending_irq(v);
}
int kvm_arch_vcpu_in_guest_mode(struct kvm_vcpu *v)
@@ -629,6 +636,8 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu, struct kvm_run *run)
update_vttbr(vcpu->kvm);
+ kvm_vgic_sync_to_cpu(vcpu);
+
local_irq_disable();
/*
@@ -641,6 +650,7 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu, struct kvm_run *run)
if (ret <= 0 || need_new_vmid_gen(vcpu->kvm)) {
local_irq_enable();
+ kvm_vgic_sync_from_cpu(vcpu);
continue;
}
@@ -679,6 +689,8 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu, struct kvm_run *run)
* Back from guest
*************************************************************/
+ kvm_vgic_sync_from_cpu(vcpu);
+
ret = handle_exit(vcpu, run, ret);
}
@@ -942,6 +954,13 @@ static int init_hyp_mode(void)
}
}
+ /*
+ * Init HYP view of VGIC
+ */
+ err = kvm_vgic_hyp_init();
+ if (err)
+ goto out_free_mappings;
+
return 0;
out_free_vfp:
free_percpu(kvm_host_vfp_state);
diff --git a/arch/arm/kvm/interrupts.S b/arch/arm/kvm/interrupts.S
index 90347d2..914c7f2 100644
--- a/arch/arm/kvm/interrupts.S
+++ b/arch/arm/kvm/interrupts.S
@@ -104,6 +104,8 @@ ENTRY(__kvm_vcpu_run)
store_mode_state sp, irq
store_mode_state sp, fiq
+ restore_vgic_state r0
+
@ Store hardware CP15 state and load guest state
read_cp15_state
write_cp15_state 1, r0
@@ -221,6 +223,8 @@ after_vfp_restore:
read_cp15_state 1, r1
write_cp15_state
+ save_vgic_state r1
+
load_mode_state sp, fiq
load_mode_state sp, irq
load_mode_state sp, und
diff --git a/arch/arm/kvm/mmu.c b/arch/arm/kvm/mmu.c
index 0ab6ea3..5394a52 100644
--- a/arch/arm/kvm/mmu.c
+++ b/arch/arm/kvm/mmu.c
@@ -830,6 +830,9 @@ static int io_mem_abort(struct kvm_vcpu *vcpu, struct kvm_run *run,
if (mmio.is_write)
memcpy(mmio.data, vcpu_reg(vcpu, rd), mmio.len);
+ if (vgic_handle_mmio(vcpu, run, &mmio))
+ return 1;
+
kvm_prepare_mmio(run, &mmio);
return 0;
}
diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
index c353b45..e7b0c68 100644
--- a/virt/kvm/kvm_main.c
+++ b/virt/kvm/kvm_main.c
@@ -1883,12 +1883,13 @@ static long kvm_vcpu_ioctl(struct file *filp,
if (vcpu->kvm->mm != current->mm)
return -EIO;
-#if defined(CONFIG_S390) || defined(CONFIG_PPC)
+#if defined(CONFIG_S390) || defined(CONFIG_PPC) || defined(CONFIG_ARM)
/*
* Special cases: vcpu ioctls that are asynchronous to vcpu execution,
* so vcpu_load() would break it.
*/
- if (ioctl == KVM_S390_INTERRUPT || ioctl == KVM_INTERRUPT)
+ if (ioctl == KVM_S390_INTERRUPT || ioctl == KVM_INTERRUPT ||
+ ioctl == KVM_IRQ_LINE)
return kvm_arch_vcpu_ioctl(filp, ioctl, arg);
#endif
^ permalink raw reply related
* [PATCH v2 01/10] ARM: KVM: Keep track of currently running vcpus
From: Christoffer Dall @ 2012-10-01 9:07 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20121001090716.49038.90056.stgit@ubuntu>
From: Marc Zyngier <marc.zyngier@arm.com>
When an interrupt occurs for the guest, it is sometimes necessary
to find out which vcpu was running at that point.
Keep track of which vcpu is being tun in kvm_arch_vcpu_ioctl_run(),
and allow the data to be retrived using either:
- kvm_arm_get_running_vcpu(): returns the vcpu running at this point
on the current CPU. Can only be used in a non-preemptable context.
- kvm_arm_get_running_vcpus(): returns the per-CPU variable holding
the the running vcpus, useable for per-CPU interrupts.
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Christoffer Dall <c.dall@virtualopensystems.com>
---
arch/arm/include/asm/kvm_host.h | 9 +++++++++
arch/arm/kvm/arm.c | 30 ++++++++++++++++++++++++++++++
2 files changed, 39 insertions(+)
diff --git a/arch/arm/include/asm/kvm_host.h b/arch/arm/include/asm/kvm_host.h
index e4b5352..69a8680 100644
--- a/arch/arm/include/asm/kvm_host.h
+++ b/arch/arm/include/asm/kvm_host.h
@@ -151,4 +151,13 @@ static inline int kvm_test_age_hva(struct kvm *kvm, unsigned long hva)
{
return 0;
}
+
+struct kvm_vcpu *kvm_arm_get_running_vcpu(void);
+struct kvm_vcpu __percpu **kvm_get_running_vcpus(void);
+
+int kvm_arm_copy_coproc_indices(struct kvm_vcpu *vcpu, u64 __user *uindices);
+unsigned long kvm_arm_num_coproc_regs(struct kvm_vcpu *vcpu);
+struct kvm_one_reg;
+int kvm_arm_coproc_get_reg(struct kvm_vcpu *vcpu, const struct kvm_one_reg *);
+int kvm_arm_coproc_set_reg(struct kvm_vcpu *vcpu, const struct kvm_one_reg *);
#endif /* __ARM_KVM_HOST_H__ */
diff --git a/arch/arm/kvm/arm.c b/arch/arm/kvm/arm.c
index 50e9585..8764dd0 100644
--- a/arch/arm/kvm/arm.c
+++ b/arch/arm/kvm/arm.c
@@ -53,11 +53,38 @@ static DEFINE_PER_CPU(unsigned long, kvm_arm_hyp_stack_page);
static struct vfp_hard_struct __percpu *kvm_host_vfp_state;
static unsigned long hyp_default_vectors;
+/* Per-CPU variable containing the currently running vcpu. */
+static DEFINE_PER_CPU(struct kvm_vcpu *, kvm_arm_running_vcpu);
+
/* The VMID used in the VTTBR */
static atomic64_t kvm_vmid_gen = ATOMIC64_INIT(1);
static u8 kvm_next_vmid;
static DEFINE_SPINLOCK(kvm_vmid_lock);
+static void kvm_arm_set_running_vcpu(struct kvm_vcpu *vcpu)
+{
+ BUG_ON(preemptible());
+ __get_cpu_var(kvm_arm_running_vcpu) = vcpu;
+}
+
+/**
+ * kvm_arm_get_running_vcpu - get the vcpu running on the current CPU.
+ * Must be called from non-preemptible context
+ */
+struct kvm_vcpu *kvm_arm_get_running_vcpu(void)
+{
+ BUG_ON(preemptible());
+ return __get_cpu_var(kvm_arm_running_vcpu);
+}
+
+/**
+ * kvm_arm_get_running_vcpus - get the per-CPU array on currently running vcpus.
+ */
+struct kvm_vcpu __percpu **kvm_get_running_vcpus(void)
+{
+ return &kvm_arm_running_vcpu;
+}
+
int kvm_arch_hardware_enable(void *garbage)
{
return 0;
@@ -296,10 +323,13 @@ void kvm_arch_vcpu_load(struct kvm_vcpu *vcpu, int cpu)
cpumask_clear_cpu(cpu, &vcpu->arch.require_dcache_flush);
flush_cache_all(); /* We'd really want v7_flush_dcache_all() */
}
+
+ kvm_arm_set_running_vcpu(vcpu);
}
void kvm_arch_vcpu_put(struct kvm_vcpu *vcpu)
{
+ kvm_arm_set_running_vcpu(NULL);
}
int kvm_arch_vcpu_ioctl_set_guest_debug(struct kvm_vcpu *vcpu,
^ permalink raw reply related
* [PATCH v2 00/10] KVM/ARM Implementation
From: Christoffer Dall @ 2012-10-01 9:07 UTC (permalink / raw)
To: linux-arm-kernel
The following series implements KVM support for ARM processors,
specifically on the Cortex A-15 platform. We feel this is ready to be
merged.
Work is done in collaboration between Columbia University, Virtual Open
Systems and ARM/Linaro.
The patch series applies to Linux 3.6 with a number of merges:
1. git://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms.git
branch: hyp-mode-boot-next (e5a04cb0b4a)
2. git://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms.git
branch: timers-next (437814c44c)
3. git://git.kernel.org/pub/scm/virt/kvm/kvm.git
branch: next (1e08ec4a)
This is Version 12 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-v12
branch: kvm-arm-v12-vgic
branch: kvm-arm-v12-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
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 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.
---
Marc Zyngier (10):
ARM: KVM: Keep track of currently running vcpus
ARM: KVM: Initial VGIC infrastructure support
ARM: KVM: Initial VGIC MMIO support code
ARM: KVM: VGIC distributor handling
ARM: KVM: VGIC virtual CPU interface management
ARM: KVM: VGIC interrupt injection
ARM: KVM: VGIC control interface world switch
ARM: KVM: VGIC initialisation code
ARM: KVM: vgic: reduce the number of vcpu kick
ARM: KVM: Add VGIC configuration option
arch/arm/include/asm/kvm_arm.h | 12
arch/arm/include/asm/kvm_host.h | 16 +
arch/arm/include/asm/kvm_vgic.h | 301 +++++++++++
arch/arm/kernel/asm-offsets.c | 12
arch/arm/kvm/Kconfig | 7
arch/arm/kvm/Makefile | 1
arch/arm/kvm/arm.c | 101 +++-
arch/arm/kvm/interrupts.S | 4
arch/arm/kvm/interrupts_head.S | 68 ++
arch/arm/kvm/mmu.c | 3
arch/arm/kvm/vgic.c | 1115 +++++++++++++++++++++++++++++++++++++++
virt/kvm/kvm_main.c | 5
12 files changed, 1640 insertions(+), 5 deletions(-)
create mode 100644 arch/arm/include/asm/kvm_vgic.h
create mode 100644 arch/arm/kvm/vgic.c
--
^ permalink raw reply
* Booting vanilla kernel on the beaglebone
From: Vaibhav Hiremath @ 2012-10-01 8:59 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <201209302114.52140.tim01@iss.tu-darmstadt.de>
On 10/1/2012 12:44 AM, Tim Sander wrote:
> Hi Richard
>> Does any vanilla kernel even boot on this board?
>> If so, which ones, and how?
> http://processors.wiki.ti.com/index.php/Sitara_Linux_Upstream_Status#AM335x_Linux_Status
>
> It seems we are not there yet :-(.
>
I still need to update with latest status, will do it shortly.
Thanks,
Vaibhav
> Best regards
> Tim
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
>
^ permalink raw reply
* rcu self-detected stall messages on OMAP3, 4 boards
From: Linus Walleij @ 2012-10-01 8:55 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20120922215923.GA13161@linux.vnet.ibm.com>
On Sat, Sep 22, 2012 at 11:59 PM, Paul E. McKenney
<paulmck@linux.vnet.ibm.com> wrote:
> rcu: Fix day-one dyntick-idle stall-warning bug
As mentioned in another thread this solves the same problem for ux500.
Reported/Tested-by: Linus Walleij <linus.walleij@linaro.org>
But now it appears that this commit didn't make it into v3.6 so
it definately needs to be tagged with Cc: stable at kernel.org
before it gets merged since the stall warnings are kinda scary.
Yours,
Linus Walleij
^ permalink raw reply
* [PATCH 2/4] ARM: OMAP: DMA: Move plat/dma hearder to platform_data/dma-omap
From: Vutla, Lokesh @ 2012-10-01 8:51 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20120929165744.GD4840@atomide.com>
On Sat, Sep 29, 2012 at 10:27 PM, Tony Lindgren <tony@atomide.com> wrote:
> * Jon Hunter <jon-hunter@ti.com> [120928 12:36]:
>>
>> On 09/28/2012 10:54 AM, Russell King - ARM Linux wrote:
>> > On Fri, Sep 28, 2012 at 08:05:38AM -0700, Tony Lindgren wrote:
>> >> * Shilimkar, Santosh <santosh.shilimkar@ti.com> [120928 08:02]:
>> >>> On Fri, Sep 28, 2012 at 8:25 PM, Tony Lindgren <tony@atomide.com> wrote:
>> >>>>
>> >>>> * Lokesh Vutla <lokeshvutla@ti.com> [120928 06:41]:
>> >>>>> Move plat/dma.h header to platform_data/dma-omap.h as
>> >>>>> part of the single zImage work.
>> >>>>
>> >>>> Hmm there's no platform data in this header, just
>> >>>> exported things for drivers to use. So it should not
>> >>>> be placed into platform_data.
>> >>>>
>> >>>> Maybe it should be #include <asm/mach/dma-omap.h> for now?
>> >>>>
>> >>> I wasn't sure either when the file was placed under platform-data.
>> >>> I agree for now we can keep it mach layer but than means OMAP1 and
>> >>> OMAP2+ DMA header and source code needs to be split. That
>> >>> is not so straight forward.
>> >>
>> >> No need for that, the path I'm suggesting is located under
>> >> arch/arm/include/asm/mach, it's not same as include <mach/dma-omap.h>.
>> >>
>> >>> With DMA engine conversion hopefully, we might get rid of the
>> >>> header eventually, but for now not sure whether we should
>> >>> go ahead and follow the splitting part.
>> >>>
>> >>> Thoughts ?
>> >>
>> >> No need for splitting anything :)
>> >>
>> >> The other possible location would be just include <linux/dma-omap.h>,
>> >> but as we all know that will be going away, <asm/mach/dma-omap.h>
>> >> is probably better.
>> >
>> > No, not asm/mach/anything, please. Let's try to get headers into the
>> > right place second time around.
>> >
>> > This header appears to contain:
>> >
>> > 1. definitions for DMA signals, used by drivers.
>> >
>> > This can be eliminated by using DT, platform data, or IORESOURCE_DMA
>> > (that's in preference order) which then means that these definitions
>> > can live in a header file in arch/arm/mach-omap*/ if at all.
>> >
>> > 2. data definitions and structures used by drivers using the legacy OMAP
>> > DMA API.
>> >
>> > So, it doesn't contain platform data (as said above). It's not an
>> > API definition between core ARM code and ARM platform code, so that
>> > rules out arch/arm/include/asm/mach. Obviously arch/arm/include/asm
>> > is out of the question too.
>> >
>> > I don't think we have a clear cut place for this to live - and lets
>> > be clear that this file will eventually be going away _anyway_ when
>> > OMAP is converted 100% to DMA engine.
>> >
>> > So, where to put the file? At the moment, I don't know, it doesn't
>> > seem to have an obvious home other than where it currently is, which
>> > then gets in the way of the single kernel work.
>>
>> I am having the same problem with the OMAP dmtimer platform driver that
>> the legacy DMA driver has. It is slightly worse as currently it is pure
>> custom platform driver. Obviously long-term it would be best to create a
>> generic timer driver in drivers/timer/ that other devices and
>> architectures could use but we are a long way from that.
>>
>> I know that this is ugly and has probably already been shot-down, but as
>> a short-term fix, has creating arch/arm/plat-omap/include/plat-omap been
>> NAK'ed for such problematic drivers?
>
> Sounds like that's the way to go then. What we did not want to do is
> just move all the files blindly there, but for these files that
> seems like the way to go until they are just regular device drivers.
Ok, Ill follow this. ll move plat/dma.h to plat-omap/dma-omap.h
Thanks
Lokesh
>
> Regards,
>
> Tony
^ permalink raw reply
* [PATCH 1/6] usb: dwc3-omap: use of_platform API to create dwc3 core pdev
From: Felipe Balbi @ 2012-10-01 8:50 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <CAAe_U6JX8nqhZU-m+0Cfh1-xEkZhXNf2ecYcg_JX9mx5fv1b3A@mail.gmail.com>
Hi,
On Fri, Sep 28, 2012 at 07:01:04PM +0530, ABRAHAM, KISHON VIJAY wrote:
> Hi,
>
> On Fri, Sep 28, 2012 at 6:27 PM, Felipe Balbi <balbi@ti.com> wrote:
> > Hi,
> >
> > On Fri, Sep 28, 2012 at 06:23:10PM +0530, Kishon Vijay Abraham I wrote:
> >> Used of_platform_populate() to populate dwc3 core platform_device
> >> from device tree data. Since now the allocation of unique device id is
> >> handled be of_*, removed the call to dwc3_get_device_id.
> >>
> >> Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
> >
> > I think it's best if you split the use of device_for_each_child() from
> > this patch. So first do the device_for_each_child() part, then later use
> > of_platform_populate().
>
> I think it's better to have it both together as of_platform_populate
> will create the device and the device_for_each_child() part will
> delete it on error conditions and during driver removal.
> In this patch the first device_for_each_child() comes in error
> condition and it is not needed if we have not created the device using
> of_platform_populate.
We are already parent of a device and we already handle child removal
manually. You can change the current implementation to use
device_for_each_child() and on a later patch introduce
of_platform_populate().
--
balbi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20121001/947d0b43/attachment.sig>
^ permalink raw reply
* [PATCH v2] leds: leds-gpio: adopt pinctrl support
From: Linus Walleij @ 2012-10-01 8:24 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <331ABD5ECB02734CA317220B2BBEABC13EA3E24E@DBDE01.ent.ti.com>
On Mon, Oct 1, 2012 at 9:03 AM, AnilKumar, Chimata <anilkumar@ti.com> wrote:
> I have gone through the "Don Aisheng" patch series, which
> adds "pinctrl_dt_add_gpio_ranges" support but not accepted
> yet. With this patch series we can overcome the driver changes.
OK then this is the direction we need to go.
> 4. The current pinctrl driver has support for these APIs
> pinctrl_request_gpio(), pinctrl_free_gpio(),
> pinctrl_gpio_direction_input/output()
> no API for slew rate control, pulled down/up control
> how can we handle this?
You are not supposed to handle that from the GPIO level
of the API. That is supposed to be handled by pinctrl.
These two subsystems are orthogonal, with the exception
of the above calls. If you need to pass more information
between the GPIO and pinctrl interfaces it usually means
you're doing something wrong.
The reason why pinctrl was created in the first place
was that Grant didn't like that we started to shoehorn all
kind of pin control into the GPIO subsystem.
> 5. pinctrl-single driver has to modify to provide separate handles
> for pinmux and pinconfig. And we need separate pin configuration
> bit masks and values/flags to take care of pull-up/down, slew rate,
> receiver in/out and mux mode control.
OK that is typical pinctrl driver implementation work.
I hope Tony can advice on this?
> 6. This is for my understanding, on which node do we have to add
> pinctrl data i.e., pin mux-mode data. In leds-gpio node (mostly not)
> and if it is in gpio node then how can we pass pinmux data with
> the existing API pinctrl_request_gpio(gpio);? Here we are passing
> only gpio number.
So with the pinctrl_request_gpio() call you are requesting a single
pin to be used as GPIO, nothing else.
No additional data should be passed with that call.
Implementing it is up to the pinctrl driver, the pinctrl subsystem
API does not say anything about how this should be done, but
there are a few examples.
The pinctrl maps of muxes and config from the pin control
subsystem are for entire devices, and the single-pin GPIO
reservation API is orthogonal to this, please consult
Documentation/pinctrl.txt if you are uncertain about what
I mean with this, I've really tried to explain it there.
The docs were recently amended to reflect some corner-case
GPIO uses, see e.g.:
http://marc.info/?l=linux-arm-kernel&m=134763067415678&w=2
> Few more driver patches are pending along with this (leds-gpio DT
> data additions according to this patch, similarly other drivers
> like matrix keypad and volume keys)
OK so the threshold is that we need to get it right for the first
one and then the others will look good too.
Yours,
Linus Walleij
^ permalink raw reply
* [PATCH] ARM: ux500: support the HREFP520 board variant
From: Linus Walleij @ 2012-10-01 7:40 UTC (permalink / raw)
To: linux-arm-kernel
From: Linus Walleij <linus.walleij@linaro.org>
This adds support for another board registered for the old machine
type system. Mainly doing this because it is all that is required
to get that board working, everything else stays the same.
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
This is basically just another U8500 MOP500 variant, so while I
know the fine DT work is going on, this is still some legacy
business.
---
arch/arm/mach-ux500/board-mop500.c | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/arch/arm/mach-ux500/board-mop500.c b/arch/arm/mach-ux500/board-mop500.c
index dd629b7..4f77208 100644
--- a/arch/arm/mach-ux500/board-mop500.c
+++ b/arch/arm/mach-ux500/board-mop500.c
@@ -1,6 +1,5 @@
-
/*
- * Copyright (C) 2008-2009 ST-Ericsson
+ * Copyright (C) 2008-2012 ST-Ericsson
*
* Author: Srinidhi KASAGAR <srinidhi.kasagar@stericsson.com>
*
@@ -722,6 +721,16 @@ MACHINE_START(U8500, "ST-Ericsson MOP500 platform")
.init_late = ux500_init_late,
MACHINE_END
+MACHINE_START(U8520, "ST-Ericsson U8520 Platform HREFP520")
+ .atag_offset = 0x100,
+ .map_io = u8500_map_io,
+ .init_irq = ux500_init_irq,
+ .timer = &ux500_timer,
+ .handle_irq = gic_handle_irq,
+ .init_machine = mop500_init_machine,
+ .init_late = ux500_init_late,
+MACHINE_END
+
MACHINE_START(HREFV60, "ST-Ericsson U8500 Platform HREFv60+")
.atag_offset = 0x100,
.map_io = u8500_map_io,
--
1.7.11.3
^ permalink raw reply related
* [PATCH v2] leds: leds-gpio: adopt pinctrl support
From: AnilKumar, Chimata @ 2012-10-01 7:03 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <CACRpkdbSY-aH_Vf3Q4h-ufz35m6=vVXCEecGGS-WOsG7vmPZ0g@mail.gmail.com>
+Don Aisheng
On Tue, Sep 11, 2012 at 01:10:12, Linus Walleij wrote:
> On Sat, Sep 1, 2012 at 10:16 AM, AnilKumar Ch <anilkumar@ti.com> wrote:
>
> > Adopt pinctrl support to leds-gpio driver based on leds-gpio
> > device pointer, pinctrl driver configure SoC pins to GPIO
> > mode according to definitions provided in .dts file.
> >
> > Signed-off-by: AnilKumar Ch <anilkumar@ti.com>
>
> So looking back at this after Stephen posed a real good
> question, when you say "configure SoC pins to GPIO
> mode", does that mean anything else than to mux them into
> GPIO mode?
>
pinctrl-single.c driver sets mux mode as well as pin configuration
like pull-up/pull-down, input/output and slew rate.
> In that case, have you considered augmenting
> pinctrl-single.c to implement .gpio_request_enable()
> .gpio_disable_free() and maybe also .gpio_set_direction()
> in its struct pinmux_ops pinmux backend?
>
> If not, why?
Recently, I have gone through the details on implementing
gpio_request_enable in pinctrl-single driver. To add this
functionality we have to add gpio_range's to pinctrl driver.
AM335x EVM supports total 128 GPIO pins (4 banks) and these
are randomly distributed across AM33XX SoC pins.
These are the concerns/questions I have:-
1. I haven't added yet but it will come to more than 30-40
pinctrl_gpio_range entries
2. If the silicon package is changed then these will change.
3. If the GPIO driver is common for multiple SoCs then these
entries will be more & more over SoC specific and driver has
to change every time the gpio_range changes.
I have gone through the "Don Aisheng" patch series, which
adds "pinctrl_dt_add_gpio_ranges" support but not accepted
yet. With this patch series we can overcome the driver changes.
4. The current pinctrl driver has support for these APIs
pinctrl_request_gpio(), pinctrl_free_gpio(),
pinctrl_gpio_direction_input/output()
no API for slew rate control, pulled down/up control
how can we handle this?
5. pinctrl-single driver has to modify to provide separate handles
for pinmux and pinconfig. And we need separate pin configuration
bit masks and values/flags to take care of pull-up/down, slew rate,
receiver in/out and mux mode control.
6. This is for my understanding, on which node do we have to add
pinctrl data i.e., pin mux-mode data. In leds-gpio node (mostly not)
and if it is in gpio node then how can we pass pinmux data with
the existing API pinctrl_request_gpio(gpio);? Here we are passing
only gpio number.
Few more driver patches are pending along with this (leds-gpio DT
data additions according to this patch, similarly other drivers
like matrix keypad and volume keys)
Thanks
AnilKumar
^ permalink raw reply
* [RFC PATCH 00/16] pinctrl: samsung: Usability and extensibiltiy improvements
From: Linus Walleij @ 2012-10-01 6:58 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1348842527-22460-1-git-send-email-t.figa@samsung.com>
On Fri, Sep 28, 2012 at 4:28 PM, Tomasz Figa <t.figa@samsung.com> wrote:
> This RFC series is a work on improving usability and extensibiltiy of the
> pinctrl-samsung driver. It consists of three main parts:
> - moving SoC-specific data to device tree
> - converting the driver to use one GPIO chip and one IRQ domain per pin bank
> - introducing generic wake-up interrupt capability description
Overall this looks good to me.
Yours,
Linus Walleij
^ permalink raw reply
* Booting vanilla kernel on the beaglebone
From: Vaibhav Hiremath @ 2012-10-01 6:57 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20120930082802.GA15392@netboy.at.omicron.at>
On 9/30/2012 1:58 PM, Richard Cochran wrote:
>
> I just received by very own beaglebone, and I would like to add PTP
> hardware clock support for the CPTS unit, but I naturally want to do
> this with the latest mainstream kernel and not the hacked up arago 3.2
> kernel that ships with the board.
>
> Does any vanilla kernel even boot on this board?
> If so, which ones, and how?
>
> I have tried a few variations of kernel/u-boot without any luck.
> The u-boot that came with the board is
>
> U-Boot 2011.09-00000-gf63b270-dirty (Apr 24 2012 - 09:51:01)
> arm-angstrom-linux-gnueabi-gcc (GCC) 4.5.4 20120305 (prerelease)
> GNU ld (GNU Binutils) 2.20.1.20100303
>
> and I also tried the latest version:
>
> U-Boot 2012.10-rc1-00148-g4668a08 (Sep 30 2012 - 09:35:20)
> arm-none-linux-gnueabi-gcc (Sourcery G++ Lite 2009q1-203) 4.3.3
> GNU ld (Sourcery G++ Lite 2009q1-203) 2.19.51.20090205
>
Mainline u-boot boots up fine on BeagleBone, I just tried it on my Bone
(A5 version)
U-Boot SPL 2012.10-rc1-00148-g4668a08 (Oct 01 2012 - 11:34:06)
OMAP SD/MMC: 0
reading u-boot.img
reading u-boot.img
U-Boot 2012.10-rc1-00148-g4668a08 (Oct 01 2012 - 11:34:06)
I2C: ready
DRAM: 256 MiB
WARNING: Caches not enabled
MMC: OMAP SD/MMC: 0, OMAP SD/MMC: 1
Using default environment
Net: cpsw
Hit any key to stop autoboot: 0
U-Boot#
As far as kernel is concerned, All the required patches have been merged
for v3.7, so if you use linux-next/master branch, you should be able to
boot without any issues. You just need to apply one minor patch which is
left behind - https://patchwork.kernel.org/patch/1499411/
I have just tested it to cross-check and it boots up fine with
linux-next/master branch. I have pasted boot log below for your reference.
U-Boot#
U-Boot# mmc rescan 0
U-Boot# fatload mmc 0 80000000 am335x-evm.dtb
reading am335x-evm.dtb
5172 bytes read
U-Boot# fatload mmc 0 81000000 uImage
reading uImage
3835400 bytes read
U-Boot# fatload mmc 0 82000000 ramdisk-pm.gz
reading ramdisk-pm.gz
2022580 bytes read
U-Boot# setenv bootargs console=ttyO0,115200n8 mem=256M root=/dev/ram rw
initrd=0x82000000,16MB ramdisk_size=65536 earlyprintk=serial
U-Boot# bootm 81000000 - 80000000
## Booting kernel from Legacy Image at 81000000 ...
Image Name: Linux-3.6.0-rc7-next-20120928-00
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 3835336 Bytes = 3.7 MiB
Load Address: 80008000
Entry Point: 80008000
Verifying Checksum ... OK
## Flattened Device Tree blob at 80000000
Booting using the fdt blob at 0x80000000
Loading Kernel Image ... OK
OK
Loading Device Tree to 8fe67000, end 8fe6b433 ... OK
Starting kernel ...
[ 0.000000] Booting Linux on physical CPU 0
[ 0.000000] Linux version 3.6.0-rc7-next-20120928-00001-g820ede3
(a0393758 at psplinux064) (gcc version 4.5.3 20110311 (prerelease) (GCC) )
#2 SMP Mon Oct 1 12:10:14 IST 2012
[ 0.000000] CPU: ARMv7 Processor [413fc082] revision 2 (ARMv7),
cr=10c53c7d
[ 0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing
instruction cache
[ 0.000000] Machine: Generic AM33XX (Flattened Device Tree), model:
TI AM335x EVM
[ 0.000000] Memory policy: ECC disabled, Data cache writeback
[ 0.000000] AM335X ES1.0 (neon )
[ 0.000000] PERCPU: Embedded 9 pages/cpu @c0eff000 s12928 r8192
d15744 u36864
[ 0.000000] Built 1 zonelists in Zone order, mobility grouping on.
Total pages: 64768
[ 0.000000] Kernel command line: console=ttyO0,115200n8 mem=256M
root=/dev/ram rw initrd=0x82000000,16MB ramdisk_size=65536
earlyprintk=serial
[ 0.000000] PID hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.000000] Dentry cache hash table entries: 32768 (order: 5, 131072
bytes)
[ 0.000000] Inode-cache hash table entries: 16384 (order: 4, 65536 bytes)
[ 0.000000] Memory: 255MB = 255MB total
[ 0.000000] Memory: 229120k/229120k available, 33024k reserved, 0K
highmem
[ 0.000000] Virtual kernel memory layout:
[ 0.000000] vector : 0xffff0000 - 0xffff1000 ( 4 kB)
[ 0.000000] fixmap : 0xfff00000 - 0xfffe0000 ( 896 kB)
[ 0.000000] vmalloc : 0xd0800000 - 0xff000000 ( 744 MB)
[ 0.000000] lowmem : 0xc0000000 - 0xd0000000 ( 256 MB)
[ 0.000000] pkmap : 0xbfe00000 - 0xc0000000 ( 2 MB)
[ 0.000000] modules : 0xbf000000 - 0xbfe00000 ( 14 MB)
[ 0.000000] .text : 0xc0008000 - 0xc06c09a0 (6883 kB)
[ 0.000000] .init : 0xc06c1000 - 0xc0711280 ( 321 kB)
[ 0.000000] .data : 0xc0712000 - 0xc079bdf0 ( 552 kB)
[ 0.000000] .bss : 0xc079be14 - 0xc0cf67f4 (5483 kB)
[ 0.000000] Hierarchical RCU implementation.
[ 0.000000] RCU restricting CPUs from NR_CPUS=2 to nr_cpu_ids=1.
[ 0.000000] NR_IRQS:16 nr_irqs:16 16
[ 0.000000] IRQ: Found an INTC at 0xfa200000 (revision 5.0) with 128
interrupts
[ 0.000000] Total of 128 interrupts on 1 active controller
[ 0.000000] OMAP clockevent source: GPTIMER1 at 24000000 Hz
[ 0.000000] sched_clock: 32 bits at 24MHz, resolution 41ns, wraps
every 178956ms
[ 0.000000] OMAP clocksource: GPTIMER2 at 24000000 Hz
[ 0.000000] Console: colour dummy device 80x30
[ 0.000000] Lock dependency validator: Copyright (c) 2006 Red Hat,
Inc., Ingo Molnar
[ 0.000000] ... MAX_LOCKDEP_SUBCLASSES: 8
[ 0.000000] ... MAX_LOCK_DEPTH: 48
[ 0.000000] ... MAX_LOCKDEP_KEYS: 8191
[ 0.000000] ... CLASSHASH_SIZE: 4096
[ 0.000000] ... MAX_LOCKDEP_ENTRIES: 16384
[ 0.000000] ... MAX_LOCKDEP_CHAINS: 32768
[ 0.000000] ... CHAINHASH_SIZE: 16384
[ 0.000000] memory used by lock dependency info: 3695 kB
[ 0.000000] per task-struct memory footprint: 1152 bytes
[ 0.001114] Calibrating delay loop... 364.48 BogoMIPS (lpj=1425408)
[ 0.107577] pid_max: default: 32768 minimum: 301
[ 0.108244] Security Framework initialized
[ 0.108450] Mount-cache hash table entries: 512
[ 0.119655] CPU: Testing write buffer coherency: ok
[ 0.120768] CPU0: thread -1, cpu 0, socket -1, mpidr 0
[ 0.120857] Setting up static identity map for 0x804d25a0 - 0x804d2610
[ 0.124171] Brought up 1 CPUs
[ 0.124204] SMP: Total of 1 processors activated (364.48 BogoMIPS).
[ 0.148451] pinctrl core: initialized pinctrl subsystem
[ 0.156712] regulator-dummy: no parameters
[ 0.159226] NET: Registered protocol family 16
[ 0.160198] DMA: preallocated 256 KiB pool for atomic coherent
allocations
[ 0.160221] ------------[ cut here ]------------
[ 0.160262] WARNING: at arch/arm/mach-omap2/gpmc.c:866
gpmc_init+0x24c/0x294()
[ 0.160277] Modules linked in:
[ 0.160338] [<c001af1c>] (unwind_backtrace+0x0/0xf0) from
[<c0041690>] (warn_slowpath_common+0x4c/0x64)
[ 0.160367] [<c0041690>] (warn_slowpath_common+0x4c/0x64) from
[<c00416c4>] (warn_slowpath_null+0x1c/0x24)
[ 0.160392] [<c00416c4>] (warn_slowpath_null+0x1c/0x24) from
[<c06cb24c>] (gpmc_init+0x24c/0x294)
[ 0.160420] [<c06cb24c>] (gpmc_init+0x24c/0x294) from [<c0008774>]
(do_one_initcall+0x34/0x180)
[ 0.160449] [<c0008774>] (do_one_initcall+0x34/0x180) from
[<c06c18f8>] (kernel_init+0xfc/0x1cc)
[ 0.160486] [<c06c18f8>] (kernel_init+0xfc/0x1cc) from [<c0013460>]
(ret_from_kernel_thread+0x10/0x18)
[ 0.160731] ---[ end trace 1b75b31a2719ed1c ]---
[ 0.189123] OMAP GPIO hardware version 0.1
[ 0.205603] No ATAGs?
[ 0.205632] hw-breakpoint: debug architecture 0x4 unsupported.
[ 0.291385] bio: create slab <bio-0> at 0
[ 0.397985] omap-dma-engine omap-dma-engine: OMAP DMA engine driver
[ 0.399616] vbat: 5000 mV
[ 0.407763] SCSI subsystem initialized
[ 0.410699] usbcore: registered new interface driver usbfs
[ 0.411336] usbcore: registered new interface driver hub
[ 0.412976] usbcore: registered new device driver usb
[ 0.418185] omap_i2c 44e0b000.i2c: bus 0 rev2.4.0 at 400 kHz
[ 0.430606] Switching to clocksource gp_timer
[ 0.586397] NET: Registered protocol family 2
[ 0.589163] TCP established hash table entries: 8192 (order: 4, 65536
bytes)
[ 0.589666] TCP bind hash table entries: 8192 (order: 6, 294912 bytes)
[ 0.594582] TCP: Hash tables configured (established 8192 bind 8192)
[ 0.594874] TCP: reno registered
[ 0.594915] UDP hash table entries: 256 (order: 2, 20480 bytes)
[ 0.595365] UDP-Lite hash table entries: 256 (order: 2, 20480 bytes)
[ 0.596388] NET: Registered protocol family 1
[ 0.598087] RPC: Registered named UNIX socket transport module.
[ 0.598116] RPC: Registered udp transport module.
[ 0.598132] RPC: Registered tcp transport module.
[ 0.598148] RPC: Registered tcp NFSv4.1 backchannel transport module.
[ 0.599356] Trying to unpack rootfs image as initramfs...
[ 0.601938] rootfs image is not initramfs (no cpio magic); looks like
an initrd
[ 0.742658] Freeing initrd memory: 16384K
[ 0.742860] NetWinder Floating Point Emulator V0.97 (double precision)
[ 0.948778] VFS: Disk quotas dquot_6.5.2
[ 0.949078] Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
[ 0.952492] NFS: Registering the id_resolver key type
[ 0.953097] Key type id_resolver registered
[ 0.953128] Key type id_legacy registered
[ 0.953331] jffs2: version 2.2. (NAND) (SUMMARY) ? 2001-2006 Red
Hat, Inc.
[ 0.954050] msgmni has been set to 479
[ 0.958799] io scheduler noop registered
[ 0.958833] io scheduler deadline registered
[ 0.958931] io scheduler cfq registered (default)
[ 0.962805] Serial: 8250/16550 driver, 4 ports, IRQ sharing enabled
[ 0.970634] omap_uart 44e09000.serial: did not get pins for uart0
error: -19
[ 0.971303] 44e09000.serial: ttyO0 at MMIO 0x44e09000 (irq = 88) is a
OMAP UART0
[ 1.629186] console [ttyO0] enabled
[ 1.671775] brd: module loaded
[ 1.700068] loop: module loaded
[ 1.710335] mtdoops: mtd device (mtddev=name/number) must be supplied
[ 1.719012] OneNAND driver initializing
[ 1.730808] usbcore: registered new interface driver asix
[ 1.737454] usbcore: registered new interface driver cdc_ether
[ 1.744674] usbcore: registered new interface driver smsc95xx
[ 1.751319] usbcore: registered new interface driver net1080
[ 1.758157] usbcore: registered new interface driver cdc_subset
[ 1.765191] usbcore: registered new interface driver zaurus
[ 1.771989] usbcore: registered new interface driver cdc_ncm
[ 1.780711] usbcore: registered new interface driver cdc_wdm
[ 1.786876] Initializing USB Mass Storage driver...
[ 1.792825] usbcore: registered new interface driver usb-storage
[ 1.799313] USB Mass Storage support registered.
[ 1.804890] usbcore: registered new interface driver usbtest
[ 1.812962] mousedev: PS/2 mouse device common for all mice
[ 1.824234] i2c /dev entries driver
[ 1.830793] Driver for 1-wire Dallas network protocol.
[ 1.840350] omap_wdt: OMAP Watchdog Timer Rev 0x01: initial timeout
60 sec
[ 1.854020] usbcore: registered new interface driver usbhid
[ 1.859914] usbhid: USB HID core driver
[ 1.865820] oprofile: no performance counters
[ 1.873548] oprofile: using timer interrupt.
[ 1.879162] TCP: cubic registered
[ 1.882682] Initializing XFRM netlink socket
[ 1.887434] NET: Registered protocol family 17
[ 1.892324] NET: Registered protocol family 15
[ 1.897507] Key type dns_resolver registered
[ 1.902263] VFP support v0.3: implementor 41 architecture 3 part 30
variant c rev 3
[ 1.910520] ThumbEE CPU extension supported.
[ 1.927674] clock: disabling unused clocks to save power
[ 1.941037] drivers/rtc/hctosys.c: unable to open rtc device (rtc0)
[ 1.951940] RAMDISK: gzip image found at block 0
[ 2.424389] VFS: Mounted root (ext2 filesystem) on device 1:0.
[ 2.431470] Freeing init memory: 320K
mount: mounting none on /var/shm failed: No such file or directory
::
:: Enabling hot-plug : [SUCCESS]
::
::
: Populating /dev : [SUCCESS]
[SUCCESS]
::
::
:: Setting PATH
::
: syslogd : [SUCCESS]
: telnetd : [SUCCESS]
Please press Enter to activate this console.
::
:: Setting shell environment ...
::
: Path
: Aliases
: Touch Screen
::
:: Done
::
[root at arago /]#
> Thanks,
> Richard
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
>
^ permalink raw reply
* [PATCH 1/1] Fix segfault in DTC
From: David Gibson @ 2012-10-01 6:46 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <50692B7A.8000405@wwwdotorg.org>
On Sun, Sep 30, 2012 at 11:34:50PM -0600, Stephen Warren wrote:
> On 09/29/2012 05:53 PM, David Gibson wrote:
> > On Fri, Sep 28, 2012 at 01:05:33PM -0600, Stephen Warren wrote:
> >> On 09/28/2012 12:53 PM, Jon Loeliger wrote:
> >>>>>
> >>>>> Yeah, seems like the kernel DTC is quite old.
> >>>>
> >>>> FYI, I'm working on a patch to the kernel to bring in the latest dtc.
> >>>
> >>> Awesome. Thank you.
> >>>
> >>>> I've run a regression test vs. the old dtc in the kernel ...
> >>>
> >>> Which is the icky step. Again, thank you.
> >>>
> >>>> ... and found that
> >>>> some of the PowerPC .dts files don't compile with the new dtc (but did
> >>>> with the old), all due to non-existent labels/paths being referenced.
> >>>> I'll try and track down whether this is a regression in dtc, or simply
> >>>> buggy .dts files that weren't noticed before.
> >>>
> >>> I think you should just smack the PowerPC guys. :-)
> >>
> >> For the record in this thread, it was a regression I introduced into dtc
> >> - the patch I just sent was for this.
> >
> > I would be nice to add a testcase for this regression into dtc.
>
> The issue here was caused by uninitialized memory, so it would, I think,
> be basically impossible to create a test-case that would be guaranteed
> to fail because of this; it'd depend on the internal details of the
> malloc library and how/when it re-used previously free()d memory blocks.
It doesn't have to be guaranteed to fail to be useful. Plus, we
already have the infrastructure to run the tests under valgrind, which
would catch it.
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
^ permalink raw reply
* [PATCH 11/12] pinctrl: samsung: use __devinit section for init code
From: Linus Walleij @ 2012-10-01 6:15 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1348868177-21205-12-git-send-email-arnd@arndb.de>
On Fri, Sep 28, 2012 at 11:36 PM, Arnd Bergmann <arnd@arndb.de> wrote:
> The samsung pinctrl driver has a probe function that is
> __devinit and that calls a lot of other functions that are
> marked __init, which kbuild complains about.
>
> Marking everything __devinit means that the code does not
> discarded when CONFIG_HOTPLUG is set, which is a little
> more wasteful, but also more consistent
>
> Without this patch, building exynos_defconfig results in:
>
> WARNING: drivers/pinctrl/built-in.o(.devinit.text+0x124): Section mismatch in reference from the function samsung_pinctrl_probe() to the function .init.text:samsung_gpiolib_register()
> The function __devinit samsung_pinctrl_probe() references
> a function __init samsung_gpiolib_register().
> If samsung_gpiolib_register is only used by samsung_pinctrl_probe then
> annotate samsung_gpiolib_register with a matching annotation.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> Cc: Thomas Abraham <thomas.abraham@linaro.org>
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Cc: Stephen Warren <swarren@nvidia.com>
> Cc: Kukjin Kim <kgene.kim@samsung.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
I think the Samsing pinctrl driver has landed into next from some
branch in ARM SoC so you probably know better than me
where this thing should be merged...
Yours,
Linus Walleij
^ permalink raw reply
* [PATCH 1/1] Fix segfault in DTC
From: Stephen Warren @ 2012-10-01 5:34 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20120929235342.GA23078@truffula.fritz.box>
On 09/29/2012 05:53 PM, David Gibson wrote:
> On Fri, Sep 28, 2012 at 01:05:33PM -0600, Stephen Warren wrote:
>> On 09/28/2012 12:53 PM, Jon Loeliger wrote:
>>>>>
>>>>> Yeah, seems like the kernel DTC is quite old.
>>>>
>>>> FYI, I'm working on a patch to the kernel to bring in the latest dtc.
>>>
>>> Awesome. Thank you.
>>>
>>>> I've run a regression test vs. the old dtc in the kernel ...
>>>
>>> Which is the icky step. Again, thank you.
>>>
>>>> ... and found that
>>>> some of the PowerPC .dts files don't compile with the new dtc (but did
>>>> with the old), all due to non-existent labels/paths being referenced.
>>>> I'll try and track down whether this is a regression in dtc, or simply
>>>> buggy .dts files that weren't noticed before.
>>>
>>> I think you should just smack the PowerPC guys. :-)
>>
>> For the record in this thread, it was a regression I introduced into dtc
>> - the patch I just sent was for this.
>
> I would be nice to add a testcase for this regression into dtc.
The issue here was caused by uninitialized memory, so it would, I think,
be basically impossible to create a test-case that would be guaranteed
to fail because of this; it'd depend on the internal details of the
malloc library and how/when it re-used previously free()d memory blocks.
^ permalink raw reply
* [PATCH V6 2/2] video: drm: exynos: Add device tree support
From: Leela Krishna Amudala @ 2012-10-01 5:29 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <505BF79A.8060802@wwwdotorg.org>
Hello Stephen Warren,
The binding names that I use in my dts file should match with the
names given in http://lists.freedesktop.org/archives/dri-devel/2012-July/024875.html
right?
I think that is the only thing I have to take care, and as I'm not
using "struct drm_display_mode" in my driver its my wish whether to
use the helper function or not.
Please clarify me if I miss something.
Best Regards,
Leela Krishna Amudala.
On Fri, Sep 21, 2012 at 10:44 AM, Stephen Warren <swarren@wwwdotorg.org> wrote:
> On 09/21/2012 05:22 AM, Leela Krishna Amudala wrote:
>> This patch adds device tree based discovery support for exynos DRM-FIMD
>> driver which includes driver modification to handle platform data in
>> both the cases with DT and non-DT, Also adds the documentation for bindings.
>
>> diff --git a/Documentation/devicetree/bindings/drm/exynos/fimd.txt b/Documentation/devicetree/bindings/drm/exynos/fimd.txt
> ...
>> + - samsung,fimd-display: This property should specify the phandle of the
>> + display device node which holds the video interface timing with the
>> + below mentioned properties.
>> +
>> + - lcd-htiming: Specifies the horizontal timing for the overlay. The
>> + horizontal timing includes four parameters in the following order.
>> +
>> + - horizontal back porch (in number of lcd clocks)
>> + - horizontal front porch (in number of lcd clocks)
>> + - hsync pulse width (in number of lcd clocks)
>> + - Display panels X resolution.
>> +
>> + - lcd-vtiming: Specifies the vertical timing for the overlay. The
>> + vertical timing includes four parameters in the following order.
>> +
>> + - vertical back porch (in number of lcd lines)
>> + - vertical front porch (in number of lcd lines)
>> + - vsync pulse width (in number of lcd clocks)
>> + - Display panels Y resolution.
>
> Should this not use the new videomode timings that are under discussion at:
>
> http://lists.freedesktop.org/archives/dri-devel/2012-July/024875.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 6/6] usb: dwc3: core: add dt support for dwc3 core
From: ABRAHAM, KISHON VIJAY @ 2012-10-01 5:10 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <5068779A.20402@mvista.com>
Hi,
On Sun, Sep 30, 2012 at 10:17 PM, Sergei Shtylyov <sshtylyov@mvista.com> wrote:
> Hello.
>
>
> On 28-09-2012 14:53, Kishon Vijay Abraham I wrote:
>
>> Added dwc3 support for dwc3 core and update the documentation with
>> device tree binding information.
>>
>> Signed-off-by: Kishon Vijay Abraham I<kishon@ti.com>
>
> [...]
>
>
>> diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c
>> index 08a5738..0c17a7a 100644
>> --- a/drivers/usb/dwc3/core.c
>> +++ b/drivers/usb/dwc3/core.c
>
> [...]
>
>> @@ -602,11 +601,22 @@ static int __devexit dwc3_remove(struct
>> platform_device *pdev)
>> return 0;
>> }
>>
>> +#ifdef CONFIG_OF
>> +static const struct of_device_id of_dwc3_matach[] = {
>
>
> I guess you meant 'of_dwc3_match' here and below?
indeed.. will re-post the patch..
Thanks
Kishon
^ permalink raw reply
* [PATCH 3/4] ARM: OMAP: Move omap_reserve() locally to mach-omap1/2
From: Vutla, Lokesh @ 2012-10-01 5:01 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20120930180542.GF4840@atomide.com>
On Sun, Sep 30, 2012 at 11:35 PM, Tony Lindgren <tony@atomide.com> wrote:
> * Shilimkar, Santosh <santosh.shilimkar@ti.com> [120930 01:21]:
>> On Sun, Sep 30, 2012 at 1:09 AM, Russell King - ARM Linux
>> <linux@arm.linux.org.uk> wrote:
>> >
>> > On Fri, Sep 28, 2012 at 07:10:08PM +0530, Lokesh Vutla wrote:
>> > > omap_reserve() is a stub for omap1. So creating a
>> > > stub locally in mach-omap1. And moving the definition
>> > > to mach-omap2.
>> > > This helps in moving plat/omap_secure.h local to
>> > > mach-omap2
>> > >
>> > > Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
>> > > Acked-by : Santosh Shilimkar <santosh.shilimkar@ti.com>
>> > > ---
>> > > arch/arm/mach-omap1/common.h | 3 +++
>> > > arch/arm/mach-omap2/common.c | 20 ++++++++++++++++++++
>> > > arch/arm/mach-omap2/common.h | 1 +
>> > > arch/arm/plat-omap/common.c | 17 -----------------
>> > > arch/arm/plat-omap/include/plat/common.h | 1 -
>> > > 5 files changed, 24 insertions(+), 18 deletions(-)
>> > >
>> > > diff --git a/arch/arm/mach-omap1/common.h b/arch/arm/mach-omap1/common.h
>> > > index c2552b2..f7b01f1 100644
>> > > --- a/arch/arm/mach-omap1/common.h
>> > > +++ b/arch/arm/mach-omap1/common.h
>> > > @@ -90,4 +90,7 @@ extern int ocpi_enable(void);
>> > > static inline int ocpi_enable(void) { return 0; }
>> > > #endif
>> > >
>> > > +static inline void omap_reserve(void)
>> > > +{ }
>> >
>> > This is the wrong approach. If OMAP1 doesn't need to do any reservation,
>> > then OMAP1 platforms should not be calling omap_reserve() and OMAP1 should
>> > not have this defined.
>> >
>> > Just because OMAP2 does something one way does not mean OMAP1 needs to
>> > copy it in every detail.
>>
>> This patch just updated the code as is. I mean the empty reserve
>> callback already
>> exist before this patch.
>>
>> But I do agree with you. I think we can drop the reserve callback completly from
>> OMAP1 board files and then its easier to just make the omap_reserve() local to
>> OMAP2+ machines.
>>
>> Tony,
>> Are you ok in dropping OMAP1 reserve callback from all OMAP1 machines ?
>
> Sure if it's not doing anything.
Ok, Ill drop omap_reserve() callback from all OMAP1 machines and
repost the patches..
Thanks
Lokesh
>
> Regards,
>
> Tony
^ permalink raw reply
* [PATCH] [ARM] Build failure CONFIG_ARCH_KIRKWOOD_DT relies on CACHE_FEROCEON_L2
From: Jason Gunthorpe @ 2012-10-01 4:43 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <CAOesGMgpDs60jGsV4Wu-A7M+ThXh7YVkgb_mPgMJfPwNa_QbSw@mail.gmail.com>
On Sun, Sep 30, 2012 at 07:44:10PM -0700, Olof Johansson wrote:
> > void __init kirkwood_l2_init(void)
> > {
> > +#ifdef CONFIG_CACHE_FEROCEON_L2
> > #ifdef CONFIG_CACHE_FEROCEON_L2_WRITETHROUGH
>
> Aren't these added ifdefs completely redundant? L2_WRITETHROUGH is
> dependent on the outer options anyway.
No, the complete new function is:
void __init kirkwood_l2_init(void)
{
#ifdef CONFIG_CACHE_FEROCEON_L2
#ifdef CONFIG_CACHE_FEROCEON_L2_WRITETHROUGH
writel(readl(L2_CONFIG_REG) | L2_WRITETHROUGH, L2_CONFIG_REG);
feroceon_l2_init(1);
#else
writel(readl(L2_CONFIG_REG) & ~L2_WRITETHROUGH, L2_CONFIG_REG);
feroceon_l2_init(0);
#endif
#endif
}
So you hit the #else clause and link fails on feroceon_l2_init because
of:
obj-$(CONFIG_CACHE_FEROCEON_L2) += cache-feroceon-l2.o
Jason
^ permalink raw reply
* [PATCH 4/4] mfd: ab8500: add devicetree support for charging algorithm
From: Rajanikanth H.V @ 2012-10-01 4:08 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1349064513-31301-1-git-send-email-rajanikanth.hv@stericsson.com>
From: "Rajanikanth H.V" <rajanikanth.hv@stericsson.com>
This patch adds device tree support for charging algorithm
driver
Signed-off-by: Rajanikanth H.V <rajanikanth.hv@stericsson.com>
---
.../bindings/power_supply/ab8500/chargalg.txt | 36 ++++++++++++
drivers/mfd/ab8500-core.c | 1 +
drivers/power/abx500_chargalg.c | 58 ++++++++++++++++----
3 files changed, 83 insertions(+), 12 deletions(-)
create mode 100644 Documentation/devicetree/bindings/power_supply/ab8500/chargalg.txt
diff --git a/Documentation/devicetree/bindings/power_supply/ab8500/chargalg.txt b/Documentation/devicetree/bindings/power_supply/ab8500/chargalg.txt
new file mode 100644
index 0000000..73b7ccc
--- /dev/null
+++ b/Documentation/devicetree/bindings/power_supply/ab8500/chargalg.txt
@@ -0,0 +1,36 @@
+=== AB8500 Charging Algorithm Driver ===
+
+Charging algorithm is logical part of energy-management-module
+which implements the state machine to handle charing status w.r.t
+VBUS and main charger, battery-state, over-voltage protection,
+'battery-temperature' status.
+Charging algorithm also implements subset of power-supply properties.
+Ref: enum power_supply_property, include/linux/power_supply.h
+
+This module does not directly interact with h/w, it primarily depends
+on fuel-gauge and runtime battery status information.
+
+The properties below describes the node for Charging Algorithm
+module:
+
+Required Properties:
+- compatible = "stericsson,ab8500-chargalg"
+- interface-name:
+ Name of the controller/driver which is part of energy-management-module
+- supplied-to:
+ This property shall have dependent nodes which represent other
+ energy-management-module.
+ example:
+ ab8500-btemp {
+ /* dependent energy management module */
+ supplied-to = <&ab8500_fuel_gauge>;
+ };
+
+Other dependent node is:
+ ab8500_battery_info: ab8500_bat_type {
+ };
+ This node will provide information on 'thermistor interface' and
+ 'battery technology type' used.
+
+ref: further details.
+ Documentation/devicetree/bindings/power_supply/ab8500/fg.txt
diff --git a/drivers/mfd/ab8500-core.c b/drivers/mfd/ab8500-core.c
index 0c81138..0ab3506 100644
--- a/drivers/mfd/ab8500-core.c
+++ b/drivers/mfd/ab8500-core.c
@@ -1059,6 +1059,7 @@ static struct mfd_cell __devinitdata ab8500_bm_devs[] = {
},
{
.name = "ab8500-chargalg",
+ .of_compatible = "stericsson,ab8500-chargalg",
.num_resources = ARRAY_SIZE(ab8500_chargalg_resources),
.resources = ab8500_chargalg_resources,
},
diff --git a/drivers/power/abx500_chargalg.c b/drivers/power/abx500_chargalg.c
index ba548e4..8d83580 100644
--- a/drivers/power/abx500_chargalg.c
+++ b/drivers/power/abx500_chargalg.c
@@ -21,6 +21,7 @@
#include <linux/completion.h>
#include <linux/workqueue.h>
#include <linux/kobject.h>
+#include <linux/of.h>
#include <linux/mfd/abx500.h>
#include <linux/mfd/abx500/ux500_chargalg.h>
#include <linux/mfd/abx500/ab8500-bm.h>
@@ -1795,27 +1796,56 @@ static int __devexit abx500_chargalg_remove(struct platform_device *pdev)
flush_scheduled_work();
power_supply_unregister(&di->chargalg_psy);
platform_set_drvdata(pdev, NULL);
- kfree(di);
return 0;
}
static int __devinit abx500_chargalg_probe(struct platform_device *pdev)
{
- struct abx500_bm_plat_data *plat_data;
int ret = 0;
+ struct abx500_chargalg *di;
+ struct device_node *np = pdev->dev.of_node;
+ struct abx500_bm_plat_data *plat_data = pdev->dev.platform_data;
- struct abx500_chargalg *di =
- kzalloc(sizeof(struct abx500_chargalg), GFP_KERNEL);
- if (!di)
+ di = devm_kzalloc(&pdev->dev, sizeof(*di), GFP_KERNEL);
+ if (!di) {
+ dev_err(&pdev->dev, "%s no mem for ab8500_chargalg\n", __func__);
return -ENOMEM;
+ }
+ if (np) {
+ if (!plat_data) {
+ plat_data =
+ devm_kzalloc(&pdev->dev, sizeof(*plat_data),
+ GFP_KERNEL);
+ if (!plat_data) {
+ dev_err(&pdev->dev,
+ "%s no mem for plat_data\n", __func__);
+ return -ENOMEM;
+ }
+ plat_data->bmdev_pdata = devm_kzalloc(&pdev->dev,
+ sizeof(*plat_data->bmdev_pdata), GFP_KERNEL);
+ if (!plat_data->bmdev_pdata) {
+ dev_err(&pdev->dev,
+ "%s no mem for pdata->chargalg\n",
+ __func__);
+ return -ENOMEM;
+ }
+ }
+ ret = bmdevs_of_probe(&pdev->dev, np, plat_data);
+ if (ret < 0) {
+ dev_err(&pdev->dev, "failed to get platform data\n");
+ return ret;
+ }
+ }
+ if (!plat_data) {
+ dev_err(&pdev->dev, "No platform data\n");
+ return -EINVAL;
+ }
/* get device struct */
- di->dev = &pdev->dev;
-
- plat_data = pdev->dev.platform_data;
+ di->dev = &pdev->dev;
di->pdata = plat_data->bmdev_pdata;
- di->bat = plat_data->battery;
+ di->bat = plat_data->battery;
/* chargalg supply */
di->chargalg_psy.name = "abx500_chargalg";
@@ -1844,7 +1874,7 @@ static int __devinit abx500_chargalg_probe(struct platform_device *pdev)
create_singlethread_workqueue("abx500_chargalg_wq");
if (di->chargalg_wq == NULL) {
dev_err(di->dev, "failed to create work queue\n");
- goto free_device_info;
+ return -ENOMEM;
}
/* Init work for chargalg */
@@ -1885,12 +1915,15 @@ free_psy:
power_supply_unregister(&di->chargalg_psy);
free_chargalg_wq:
destroy_workqueue(di->chargalg_wq);
-free_device_info:
- kfree(di);
return ret;
}
+static const struct of_device_id ab8500_chargalg_match[] = {
+ {.compatible = "stericsson,ab8500-chargalg",},
+ {},
+};
+
static struct platform_driver abx500_chargalg_driver = {
.probe = abx500_chargalg_probe,
.remove = __devexit_p(abx500_chargalg_remove),
@@ -1899,6 +1932,7 @@ static struct platform_driver abx500_chargalg_driver = {
.driver = {
.name = "abx500-chargalg",
.owner = THIS_MODULE,
+ .of_match_table = ab8500_chargalg_match,
},
};
--
1.7.9.5
^ permalink raw reply related
* [PATCH 3/4] mfd: ab8500: add devicetree support for charger
From: Rajanikanth H.V @ 2012-10-01 4:08 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1349064513-31301-1-git-send-email-rajanikanth.hv@stericsson.com>
From: "Rajanikanth H.V" <rajanikanth.hv@stericsson.com>
This patch adds device tree support for charger driver
Signed-off-by: Rajanikanth H.V <rajanikanth.hv@stericsson.com>
---
Documentation/devicetree/bindings/mfd/ab8500.txt | 14 +++++
.../bindings/power_supply/ab8500/charger.txt | 44 ++++++++++++++
arch/arm/boot/dts/dbx5x0.dtsi | 11 ++++
drivers/mfd/ab8500-core.c | 1 +
drivers/power/ab8500_charger.c | 61 +++++++++++++++-----
5 files changed, 118 insertions(+), 13 deletions(-)
create mode 100644 Documentation/devicetree/bindings/power_supply/ab8500/charger.txt
diff --git a/Documentation/devicetree/bindings/mfd/ab8500.txt b/Documentation/devicetree/bindings/mfd/ab8500.txt
index 47d232e..4b45a73 100644
--- a/Documentation/devicetree/bindings/mfd/ab8500.txt
+++ b/Documentation/devicetree/bindings/mfd/ab8500.txt
@@ -36,6 +36,20 @@ ab8500-btemp : : vtvout : Battery Temperature
: BTEMP_HIGH : : BtempLow < Btemp < BtempMedium,if battery temperature is between -10 and 0?C
: BTEMP_LOW_MEDIUM : : BtempMedium < Btemp < BtempHigh,if battery temperature is between 0?C and?MaxTemp
: BTEMP_MEDIUM_HIGH : : Btemp > BtempHigh, if battery temperature is higher than ?MaxTemp?
+ab8500-charger : : vddadc : Charger interface
+ : MAIN_CH_UNPLUG_DET : : main charger unplug detection management (not in 8505)
+ : MAIN_CHARGE_PLUG_DET : : main charger plug detection management (not in 8505)
+ : MAIN_EXT_CH_NOT_OK : : main charger not OK
+ : MAIN_CH_TH_PROT_R : : Die temp is above main charger
+ : MAIN_CH_TH_PROT_F : : Die temp is below main charger
+ : VBUS_DET_F : : VBUS falling detected
+ : VBUS_DET_R : : VBUS rising detected
+ : USB_LINK_STATUS : : USB link status has changed
+ : USB_CH_TH_PROT_R : : Die temp is above usb charger
+ : USB_CH_TH_PROT_F : : Die temp is below usb charger
+ : USB_CHARGER_NOT_OKR : : allowed USB charger not ok detection
+ : VBUS_OVV : : Overvoltage on Vbus ball detected (USB charge is stopped)
+ : CH_WD_EXP : : Charger watchdog detected
ab8500-gpadc : HW_CONV_END : vddadc : Analogue to Digital Converter
SW_CONV_END : :
ab8500-gpio : : : GPIO Controller
diff --git a/Documentation/devicetree/bindings/power_supply/ab8500/charger.txt b/Documentation/devicetree/bindings/power_supply/ab8500/charger.txt
new file mode 100644
index 0000000..b78d565
--- /dev/null
+++ b/Documentation/devicetree/bindings/power_supply/ab8500/charger.txt
@@ -0,0 +1,44 @@
+=== AB8500 Charger Driver ===
+
+Batter charger module is part of energy-management-module,
+the other components of this module are:
+main-charger, usb-combo-charger and fuel-gauge.
+
+The properties below describes the node for charger driver.
+
+Required Properties:
+- compatible = "stericsson,ab8500-charger"
+- interface-name:
+ Name of the controller/driver which is part of energy-management-module
+- supplied-to:
+ This property shall have dependent nodes which represent other
+ energy-management-module.
+ e.g:
+ ab8500-charger{
+ /* dependent energy management modules */
+ supplied-to = <
+ &ab8500_chargalg
+ &ab8500_fuel_gauge
+ &ab8500_battery_temp>;
+ };
+- vddadc-supply:
+ Supply for USB and Main charger
+ e.g.
+ ab8500-charger{
+ vddadc-supply = <&ab8500_ldo_tvout_reg>;
+ }
+- autopower_cfg:
+ Boolean value depicting the presence of 'automatic pwron after pwrloss'
+ e.g:
+ ab8500-charger{
+ autopower_cfg;
+ };
+
+dependent node:
+ ab8500_battery_info: ab8500_bat_type {
+ };
+ This node provide information on 'thermistor interface' and
+ 'battery technology type' used.
+
+ref: further details.
+ Documentation/devicetree/bindings/power_supply/ab8500/fg.txt
diff --git a/arch/arm/boot/dts/dbx5x0.dtsi b/arch/arm/boot/dts/dbx5x0.dtsi
index 9f5fde8..0848ae4 100644
--- a/arch/arm/boot/dts/dbx5x0.dtsi
+++ b/arch/arm/boot/dts/dbx5x0.dtsi
@@ -378,6 +378,17 @@
supplied-to = <&ab8500_chargalg &ab8500_fuel_gauge>;
};
+ ab8500_charger: ab8500_charger_if {
+ compatible = "stericsson,ab8500-charger";
+ interface-name = "ab8500_charger";
+ battery-info = <&ab8500_battery_info>;
+ supplied-to = <
+ &ab8500_chargalg
+ &ab8500_fuel_gauge
+ &ab8500_battery_temp>;
+ vddadc-supply = <&ab8500_ldo_tvout_reg>;
+ };
+
ab8500_usb: ab8500_usb_if {
compatible = "stericsson,ab8500-usb";
interface-name = "ab8500_usb";
diff --git a/drivers/mfd/ab8500-core.c b/drivers/mfd/ab8500-core.c
index 0173417..0c81138 100644
--- a/drivers/mfd/ab8500-core.c
+++ b/drivers/mfd/ab8500-core.c
@@ -1041,6 +1041,7 @@ static struct mfd_cell __devinitdata abx500_common_devs[] = {
static struct mfd_cell __devinitdata ab8500_bm_devs[] = {
{
.name = "ab8500-charger",
+ .of_compatible = "stericsson,ab8500-charger",
.num_resources = ARRAY_SIZE(ab8500_charger_resources),
.resources = ab8500_charger_resources,
},
diff --git a/drivers/power/ab8500_charger.c b/drivers/power/ab8500_charger.c
index 5ff0d83..456cd78 100644
--- a/drivers/power/ab8500_charger.c
+++ b/drivers/power/ab8500_charger.c
@@ -23,6 +23,7 @@
#include <linux/err.h>
#include <linux/workqueue.h>
#include <linux/kobject.h>
+#include <linux/of.h>
#include <linux/mfd/abx500/ab8500.h>
#include <linux/mfd/abx500.h>
#include <linux/mfd/abx500/ab8500-bm.h>
@@ -2526,7 +2527,6 @@ static int __devexit ab8500_charger_remove(struct platform_device *pdev)
power_supply_unregister(&di->usb_chg.psy);
power_supply_unregister(&di->ac_chg.psy);
platform_set_drvdata(pdev, NULL);
- kfree(di);
return 0;
}
@@ -2535,17 +2535,44 @@ static int __devinit ab8500_charger_probe(struct platform_device *pdev)
{
int irq, i, charger_status, ret = 0;
struct abx500_bm_plat_data *plat_data = pdev->dev.platform_data;
+ struct device_node *np = pdev->dev.of_node;
struct ab8500_charger *di;
+ di = devm_kzalloc(&pdev->dev, sizeof(*di), GFP_KERNEL);
+ if (!di) {
+ dev_err(&pdev->dev, "%s no mem for ab8500_charger\n", __func__);
+ return -ENOMEM;
+ }
+ if (np) {
+ if (!plat_data) {
+ plat_data =
+ devm_kzalloc(&pdev->dev, sizeof(*plat_data),
+ GFP_KERNEL);
+ if (!plat_data) {
+ dev_err(&pdev->dev,
+ "%s no mem for plat_data\n", __func__);
+ return -ENOMEM;
+ }
+ plat_data->bmdev_pdata = devm_kzalloc(&pdev->dev,
+ sizeof(*plat_data->bmdev_pdata), GFP_KERNEL);
+ if (!plat_data->bmdev_pdata) {
+ dev_err(&pdev->dev,
+ "%s no mem for pdata->btemp\n",
+ __func__);
+ return -ENOMEM;
+ }
+ }
+ ret = bmdevs_of_probe(&pdev->dev, np, plat_data);
+ if (ret < 0) {
+ dev_err(&pdev->dev, "failed to get platform data\n");
+ return ret;
+ }
+ }
if (!plat_data) {
dev_err(&pdev->dev, "No platform data\n");
return -EINVAL;
}
- di = kzalloc(sizeof(*di), GFP_KERNEL);
- if (!di)
- return -ENOMEM;
-
/* get parent data */
di->dev = &pdev->dev;
di->parent = dev_get_drvdata(pdev->dev.parent);
@@ -2558,16 +2585,21 @@ static int __devinit ab8500_charger_probe(struct platform_device *pdev)
di->pdata = plat_data->bmdev_pdata;
if (!di->pdata) {
dev_err(di->dev, "no charger platform data supplied\n");
- ret = -EINVAL;
- goto free_device_info;
+ return -EINVAL;
}
+ if (of_property_read_bool(np,
+ "autopower_cfg") == false){
+ dev_warn(di->dev, "missing property autopower_cfg\n");
+ di->pdata->autopower_cfg = false;
+ } else
+ di->pdata->autopower_cfg = true;
+
/* get battery specific platform data */
di->bat = plat_data->battery;
if (!di->bat) {
dev_err(di->dev, "no battery platform data supplied\n");
- ret = -EINVAL;
- goto free_device_info;
+ return -EINVAL;
}
di->autopower = false;
@@ -2614,7 +2646,7 @@ static int __devinit ab8500_charger_probe(struct platform_device *pdev)
create_singlethread_workqueue("ab8500_charger_wq");
if (di->charger_wq == NULL) {
dev_err(di->dev, "failed to create work queue\n");
- goto free_device_info;
+ return -ENOMEM;
}
/* Init work for HW failure check */
@@ -2666,7 +2698,6 @@ static int __devinit ab8500_charger_probe(struct platform_device *pdev)
goto free_charger_wq;
}
-
/* Initialize OVV, and other registers */
ret = ab8500_charger_init_hw_registers(di);
if (ret) {
@@ -2756,12 +2787,15 @@ free_regulator:
regulator_put(di->regu);
free_charger_wq:
destroy_workqueue(di->charger_wq);
-free_device_info:
- kfree(di);
return ret;
}
+static const struct of_device_id ab8500_charger_match[] = {
+ {.compatible = "stericsson,ab8500-charger",},
+ {},
+};
+
static struct platform_driver ab8500_charger_driver = {
.probe = ab8500_charger_probe,
.remove = __devexit_p(ab8500_charger_remove),
@@ -2770,6 +2804,7 @@ static struct platform_driver ab8500_charger_driver = {
.driver = {
.name = "ab8500-charger",
.owner = THIS_MODULE,
+ .of_match_table = ab8500_charger_match,
},
};
--
1.7.9.5
^ permalink raw reply related
* [PATCH 2/4] mfd: ab8500: add devicetree support for Btemp
From: Rajanikanth H.V @ 2012-10-01 4:08 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1349064513-31301-1-git-send-email-rajanikanth.hv@stericsson.com>
From: "Rajanikanth H.V" <rajanikanth.hv@stericsson.com>
This patch adds device tree support for
battery-temperature-monitor-driver
Signed-off-by: Rajanikanth H.V <rajanikanth.hv@stericsson.com>
---
Documentation/devicetree/bindings/mfd/ab8500.txt | 7 ++-
.../bindings/power_supply/ab8500/btemp.txt | 29 +++++++++++
arch/arm/boot/dts/dbx5x0.dtsi | 7 +++
drivers/mfd/ab8500-core.c | 1 +
drivers/power/Kconfig | 6 ---
drivers/power/ab8500_bmdata.c | 4 +-
drivers/power/ab8500_btemp.c | 53 +++++++++++++++-----
7 files changed, 86 insertions(+), 21 deletions(-)
create mode 100644 Documentation/devicetree/bindings/power_supply/ab8500/btemp.txt
diff --git a/Documentation/devicetree/bindings/mfd/ab8500.txt b/Documentation/devicetree/bindings/mfd/ab8500.txt
index 762dc11..47d232e 100644
--- a/Documentation/devicetree/bindings/mfd/ab8500.txt
+++ b/Documentation/devicetree/bindings/mfd/ab8500.txt
@@ -30,7 +30,12 @@ ab8500-fg : : vddadc : Fuel Gauge
: LOW_BAT_F : : LOW threshold battery voltage
: CC_INT_CALIB : : Counter Counter Internal Calibration
: CCEOC : : Coulomb Counter End of Conversion
- : : :
+ab8500-btemp : : vtvout : Battery Temperature
+ : BAT_CTRL_INDB : : Battery Removal Indicator
+ : BTEMP_LOW : : Btemp < BtempLow, if battery temperature is lower than -10?C
+ : BTEMP_HIGH : : BtempLow < Btemp < BtempMedium,if battery temperature is between -10 and 0?C
+ : BTEMP_LOW_MEDIUM : : BtempMedium < Btemp < BtempHigh,if battery temperature is between 0?C and?MaxTemp
+ : BTEMP_MEDIUM_HIGH : : Btemp > BtempHigh, if battery temperature is higher than ?MaxTemp?
ab8500-gpadc : HW_CONV_END : vddadc : Analogue to Digital Converter
SW_CONV_END : :
ab8500-gpio : : : GPIO Controller
diff --git a/Documentation/devicetree/bindings/power_supply/ab8500/btemp.txt b/Documentation/devicetree/bindings/power_supply/ab8500/btemp.txt
new file mode 100644
index 0000000..f58c697
--- /dev/null
+++ b/Documentation/devicetree/bindings/power_supply/ab8500/btemp.txt
@@ -0,0 +1,29 @@
+=== AB8500 Battery Temperature Monitor Driver ===
+
+Battery temperature monitoring support is part of energy-
+management-module, the other components of this module
+are: main-charger, usb-combo-charger and fuel-gauge.
+
+The properties below describes the node for battery
+temperature monitor driver.
+
+Required Properties:
+- compatible = "stericsson,ab8500-btemp"
+- interface-name:
+ Name of the controller/driver which is part of energy-management-module
+- supplied-to:
+ This property shall have dependent nodes which represent other
+ energy-management-module.
+ example:
+ ab8500-btemp {
+ /* dependent energy management modules */
+ supplied-to = <&ab8500_chargalg &ab8500_fuel_gauge>;
+ };
+Other dependent node for battery temperature is:
+ ab8500_battery_info: ab8500_bat_type {
+ };
+ This node will provide information on 'thermistor interface' and
+ 'battery technology type' used.
+
+ref: further details.
+ Documentation/devicetree/bindings/power_supply/ab8500/fg.txt
diff --git a/arch/arm/boot/dts/dbx5x0.dtsi b/arch/arm/boot/dts/dbx5x0.dtsi
index bd22c56..9f5fde8 100644
--- a/arch/arm/boot/dts/dbx5x0.dtsi
+++ b/arch/arm/boot/dts/dbx5x0.dtsi
@@ -371,6 +371,13 @@
supplied-to = <&ab8500_chargalg &ab8500_usb>;
};
+ ab8500_battery_temp: ab8500_btemp {
+ compatible = "stericsson,ab8500-btemp";
+ interface-name = "ab8500_btemp";
+ battery-info = <&ab8500_battery_info>;
+ supplied-to = <&ab8500_chargalg &ab8500_fuel_gauge>;
+ };
+
ab8500_usb: ab8500_usb_if {
compatible = "stericsson,ab8500-usb";
interface-name = "ab8500_usb";
diff --git a/drivers/mfd/ab8500-core.c b/drivers/mfd/ab8500-core.c
index 6c3d7c2..0173417 100644
--- a/drivers/mfd/ab8500-core.c
+++ b/drivers/mfd/ab8500-core.c
@@ -1046,6 +1046,7 @@ static struct mfd_cell __devinitdata ab8500_bm_devs[] = {
},
{
.name = "ab8500-btemp",
+ .of_compatible = "stericsson,ab8500-btemp",
.num_resources = ARRAY_SIZE(ab8500_btemp_resources),
.resources = ab8500_btemp_resources,
},
diff --git a/drivers/power/Kconfig b/drivers/power/Kconfig
index c1892f3..1434871 100644
--- a/drivers/power/Kconfig
+++ b/drivers/power/Kconfig
@@ -304,12 +304,6 @@ config AB8500_BM
help
Say Y to include support for AB8500 battery management.
-config AB8500_BATTERY_THERM_ON_BATCTRL
- bool "Thermistor connected on BATCTRL ADC"
- depends on AB8500_BM
- help
- Say Y to enable battery temperature measurements using
- thermistor connected on BATCTRL ADC.
endif # POWER_SUPPLY
source "drivers/power/avs/Kconfig"
diff --git a/drivers/power/ab8500_bmdata.c b/drivers/power/ab8500_bmdata.c
index d0def3b..90d0e51 100644
--- a/drivers/power/ab8500_bmdata.c
+++ b/drivers/power/ab8500_bmdata.c
@@ -29,7 +29,7 @@ static struct abx500_res_to_temp temp_tbl_A_thermistor[] = {
{65, 12500},
};
static struct abx500_res_to_temp temp_tbl_B_thermistor[] = {
- {-5, 165418},
+ {-5, 200000},
{ 0, 159024},
{ 5, 151921},
{10, 144300},
@@ -237,7 +237,7 @@ struct abx500_battery_type bat_type_thermistor[] = {
},
{
.name = POWER_SUPPLY_TECHNOLOGY_LIPO,
- .resis_high = 165418,
+ .resis_high = 200000,
.resis_low = 82869,
.battery_resistance = 300,
.charge_full_design = 900,
diff --git a/drivers/power/ab8500_btemp.c b/drivers/power/ab8500_btemp.c
index 8e427e7..c4291e0 100644
--- a/drivers/power/ab8500_btemp.c
+++ b/drivers/power/ab8500_btemp.c
@@ -20,6 +20,7 @@
#include <linux/power_supply.h>
#include <linux/completion.h>
#include <linux/workqueue.h>
+#include <linux/of.h>
#include <linux/mfd/abx500/ab8500.h>
#include <linux/mfd/abx500.h>
#include <linux/mfd/abx500/ab8500-bm.h>
@@ -955,7 +956,6 @@ static int __devexit ab8500_btemp_remove(struct platform_device *pdev)
flush_scheduled_work();
power_supply_unregister(&di->btemp_psy);
platform_set_drvdata(pdev, NULL);
- kfree(di);
return 0;
}
@@ -965,17 +965,44 @@ static int __devinit ab8500_btemp_probe(struct platform_device *pdev)
int irq, i, ret = 0;
u8 val;
struct abx500_bm_plat_data *plat_data = pdev->dev.platform_data;
+ struct device_node *np = pdev->dev.of_node;
struct ab8500_btemp *di;
+ di = devm_kzalloc(&pdev->dev, sizeof(*di), GFP_KERNEL);
+ if (!di) {
+ dev_err(&pdev->dev, "%s no mem for ab8500_btemp\n", __func__);
+ return -ENOMEM;
+ }
+ if (np) {
+ if (!plat_data) {
+ plat_data =
+ devm_kzalloc(&pdev->dev, sizeof(*plat_data),
+ GFP_KERNEL);
+ if (!plat_data) {
+ dev_err(&pdev->dev,
+ "%s no mem for plat_data\n", __func__);
+ return -ENOMEM;
+ }
+ plat_data->bmdev_pdata = devm_kzalloc(&pdev->dev,
+ sizeof(*plat_data->bmdev_pdata), GFP_KERNEL);
+ if (!plat_data->bmdev_pdata) {
+ dev_err(&pdev->dev,
+ "%s no mem for pdata->btemp\n",
+ __func__);
+ return -ENOMEM;
+ }
+ }
+ ret = bmdevs_of_probe(&pdev->dev, np, plat_data);
+ if (ret < 0) {
+ dev_err(&pdev->dev, "failed to get platform data\n");
+ return ret;
+ }
+ }
if (!plat_data) {
dev_err(&pdev->dev, "No platform data\n");
return -EINVAL;
}
- di = kzalloc(sizeof(*di), GFP_KERNEL);
- if (!di)
- return -ENOMEM;
-
/* get parent data */
di->dev = &pdev->dev;
di->parent = dev_get_drvdata(pdev->dev.parent);
@@ -985,16 +1012,14 @@ static int __devinit ab8500_btemp_probe(struct platform_device *pdev)
di->pdata = plat_data->bmdev_pdata;
if (!di->pdata) {
dev_err(di->dev, "no btemp platform data supplied\n");
- ret = -EINVAL;
- goto free_device_info;
+ return -EINVAL;
}
/* get battery specific platform data */
di->bat = plat_data->battery;
if (!di->bat) {
dev_err(di->dev, "no battery platform data supplied\n");
- ret = -EINVAL;
- goto free_device_info;
+ return -EINVAL;
}
/* BTEMP supply */
@@ -1014,7 +1039,7 @@ static int __devinit ab8500_btemp_probe(struct platform_device *pdev)
create_singlethread_workqueue("ab8500_btemp_wq");
if (di->btemp_wq == NULL) {
dev_err(di->dev, "failed to create work queue\n");
- goto free_device_info;
+ return -ENOMEM;
}
/* Init work for measuring temperature periodically */
@@ -1092,12 +1117,15 @@ free_irq:
}
free_btemp_wq:
destroy_workqueue(di->btemp_wq);
-free_device_info:
- kfree(di);
return ret;
}
+static const struct of_device_id ab8500_btemp_match[] = {
+ {.compatible = "stericsson,ab8500-btemp",},
+ {},
+};
+
static struct platform_driver ab8500_btemp_driver = {
.probe = ab8500_btemp_probe,
.remove = __devexit_p(ab8500_btemp_remove),
@@ -1106,6 +1134,7 @@ static struct platform_driver ab8500_btemp_driver = {
.driver = {
.name = "ab8500-btemp",
.owner = THIS_MODULE,
+ .of_match_table = ab8500_btemp_match,
},
};
--
1.7.9.5
^ permalink raw reply related
* [PATCH 1/4] mfd: ab8500: add devicetree support for fuelgauge
From: Rajanikanth H.V @ 2012-10-01 4:08 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1349064513-31301-1-git-send-email-rajanikanth.hv@stericsson.com>
From: "Rajanikanth H.V" <rajanikanth.hv@stericsson.com>
- This patch adds device tree support for fuelguage driver
- optimize bm devices platform_data usage and of_probe(...)
Note: of_probe() routine for battery managed devices is made
common across all bm drivers.
Signed-off-by: Rajanikanth H.V <rajanikanth.hv@stericsson.com>
---
Documentation/devicetree/bindings/mfd/ab8500.txt | 8 +-
.../devicetree/bindings/power_supply/ab8500/fg.txt | 86 +++
arch/arm/boot/dts/dbx5x0.dtsi | 22 +-
drivers/mfd/ab8500-core.c | 1 +
drivers/power/Makefile | 2 +-
drivers/power/ab8500_bmdata.c | 549 ++++++++++++++++++++
drivers/power/ab8500_btemp.c | 4 +-
drivers/power/ab8500_charger.c | 4 +-
drivers/power/ab8500_fg.c | 76 ++-
drivers/power/abx500_chargalg.c | 4 +-
include/linux/mfd/abx500.h | 37 +-
include/linux/mfd/abx500/ab8500-bm.h | 7 +
12 files changed, 744 insertions(+), 56 deletions(-)
create mode 100644 Documentation/devicetree/bindings/power_supply/ab8500/fg.txt
create mode 100644 drivers/power/ab8500_bmdata.c
diff --git a/Documentation/devicetree/bindings/mfd/ab8500.txt b/Documentation/devicetree/bindings/mfd/ab8500.txt
index ce83c8d..762dc11 100644
--- a/Documentation/devicetree/bindings/mfd/ab8500.txt
+++ b/Documentation/devicetree/bindings/mfd/ab8500.txt
@@ -24,7 +24,13 @@ ab8500-bm : : : Battery Manager
ab8500-btemp : : : Battery Temperature
ab8500-charger : : : Battery Charger
ab8500-codec : : : Audio Codec
-ab8500-fg : : : Fuel Gauge
+ab8500-fg : : vddadc : Fuel Gauge
+ : NCONV_ACCU : : Accumulate N Sample Conversion
+ : BATT_OVV : : Battery Over Voltage
+ : LOW_BAT_F : : LOW threshold battery voltage
+ : CC_INT_CALIB : : Counter Counter Internal Calibration
+ : CCEOC : : Coulomb Counter End of Conversion
+ : : :
ab8500-gpadc : HW_CONV_END : vddadc : Analogue to Digital Converter
SW_CONV_END : :
ab8500-gpio : : : GPIO Controller
diff --git a/Documentation/devicetree/bindings/power_supply/ab8500/fg.txt b/Documentation/devicetree/bindings/power_supply/ab8500/fg.txt
new file mode 100644
index 0000000..caa33b0
--- /dev/null
+++ b/Documentation/devicetree/bindings/power_supply/ab8500/fg.txt
@@ -0,0 +1,86 @@
+=== AB8500 Fuel Gauge Driver ===
+
+AB8500 is a mixed signal multimedia and power management
+device comprising: power and energy-management-module,
+wall-charger, usb-charger, audio codec, general purpose adc,
+tvout, clock management and sim card interface.
+
+Fuel-guage support is part of energy-management-module, the other
+components of this module are:
+main-charger, usb-combo-charger and Battery temperature monitoring.
+
+The properties below describes the node for fuel guage driver.
+
+Required Properties:
+- compatible = "stericsson,ab8500-fg"
+- interface-name:
+ Name of the controller/driver which is part of energy-management-module
+- supplied-to:
+ This property shall have dependent nodes which represent other
+ energy-management-module.
+ This is a logical binding w.r.t power supply events
+ across energy-management-module drivers where-in, the
+ runtime battery properties are shared along with uevent
+ notification.
+ ref: di->fg.external_power_changed =
+ ab8500_fg_external_power_changed;
+ ab8500_fg.c
+
+ Need for this property:
+ energy-management-module driver updates power-supply properties
+ which are subset of events listed in 'enum power_supply_property',
+ ref: power_supply.h file
+ Event handler invokes power supply change notifier
+ which in-turn invokes registered power supply class call-back
+ based on the 'supplied-to' string.
+ ref:
+ power_supply_changed_work(..) ./drivers/power/power_supply_core.c
+ di->fg_psy.external_power_changed
+
+ example:
+ ab8500-fg {
+ /* dependent energy management modules */
+ supplied-to = <&ab8500_chargalg &ab8500_usb>;
+ };
+
+ ab8500_battery_info: ab8500_bat_type {
+ battery-type = <2>;
+ thermistor-on-batctrl = <1>;
+ };
+
+Other dependent node for fuel-gauge is:
+ ab8500_battery_info: ab8500_bat_type {
+ };
+ This node will provide information on 'thermistor interface' and
+ 'battery technology type' used.
+
+Properties of this node are:
+thermistor-on-batctrl:
+ A boolean value indicating thermistor interface to battery
+
+ Note:
+ 'btemp' and 'batctrl' are the pins interfaced for battery temperature
+ measurement, 'btemp' signal is used when NTC(negative temperature
+ coefficient) resister is interfaced external to battery whereas
+ 'batctrl' pin is used when NTC resister is internal to battery.
+
+ e.g:
+ ab8500_battery_info: ab8500_bat_type {
+ thermistor-on-batctrl;
+ };
+ indiactes: NTC resister is internal to battery, 'batctrl' is used
+ for thermal measurement.
+
+ The absence of property 'thermal-on-batctrl' indicates
+ NTC resister is external to battery and 'btemp' signal is used
+ for thermal measurement.
+
+battery-type:
+ This shall be the battery manufacturing technology type,
+ allowed types are:
+ "UNKNOWN" "NiMH" "LION" "LIPO" "LiFe" "NiCd" "LiMn"
+ e.g:
+ ab8500_battery_info: ab8500_bat_type {
+ battery-name = "LION";
+ }
+
diff --git a/arch/arm/boot/dts/dbx5x0.dtsi b/arch/arm/boot/dts/dbx5x0.dtsi
index 748ba7a..bd22c56 100644
--- a/arch/arm/boot/dts/dbx5x0.dtsi
+++ b/arch/arm/boot/dts/dbx5x0.dtsi
@@ -352,8 +352,28 @@
vddadc-supply = <&ab8500_ldo_tvout_reg>;
};
- ab8500-usb {
+ ab8500_battery_info: ab8500_bat_type {
+ battery-name = "LION";
+ thermistor-on-batctrl;
+ };
+
+ ab8500_chargalg: ab8500_chalg {
+ compatible = "stericsson,ab8500-chargalg";
+ interface-name = "ab8500_chargalg";
+ battery-info = <&ab8500_battery_info>;
+ supplied-to = <&ab8500_fuel_gauge>;
+ };
+
+ ab8500_fuel_gauge: ab8500_fg {
+ compatible = "stericsson,ab8500-fg";
+ interface-name = "ab8500_fg";
+ battery-info = <&ab8500_battery_info>;
+ supplied-to = <&ab8500_chargalg &ab8500_usb>;
+ };
+
+ ab8500_usb: ab8500_usb_if {
compatible = "stericsson,ab8500-usb";
+ interface-name = "ab8500_usb";
interrupts = < 90 0x4
96 0x4
14 0x4
diff --git a/drivers/mfd/ab8500-core.c b/drivers/mfd/ab8500-core.c
index 1667c77..6c3d7c2 100644
--- a/drivers/mfd/ab8500-core.c
+++ b/drivers/mfd/ab8500-core.c
@@ -1051,6 +1051,7 @@ static struct mfd_cell __devinitdata ab8500_bm_devs[] = {
},
{
.name = "ab8500-fg",
+ .of_compatible = "stericsson,ab8500-fg",
.num_resources = ARRAY_SIZE(ab8500_fg_resources),
.resources = ab8500_fg_resources,
},
diff --git a/drivers/power/Makefile b/drivers/power/Makefile
index ee58afb..2c58d4e 100644
--- a/drivers/power/Makefile
+++ b/drivers/power/Makefile
@@ -34,7 +34,7 @@ obj-$(CONFIG_BATTERY_S3C_ADC) += s3c_adc_battery.o
obj-$(CONFIG_CHARGER_PCF50633) += pcf50633-charger.o
obj-$(CONFIG_BATTERY_JZ4740) += jz4740-battery.o
obj-$(CONFIG_BATTERY_INTEL_MID) += intel_mid_battery.o
-obj-$(CONFIG_AB8500_BM) += ab8500_charger.o ab8500_btemp.o ab8500_fg.o abx500_chargalg.o
+obj-$(CONFIG_AB8500_BM) += ab8500_bmdata.o ab8500_charger.o ab8500_fg.o ab8500_btemp.o abx500_chargalg.o
obj-$(CONFIG_CHARGER_ISP1704) += isp1704_charger.o
obj-$(CONFIG_CHARGER_MAX8903) += max8903_charger.o
obj-$(CONFIG_CHARGER_TWL4030) += twl4030_charger.o
diff --git a/drivers/power/ab8500_bmdata.c b/drivers/power/ab8500_bmdata.c
new file mode 100644
index 0000000..d0def3b
--- /dev/null
+++ b/drivers/power/ab8500_bmdata.c
@@ -0,0 +1,549 @@
+#include <linux/export.h>
+#include <linux/power_supply.h>
+#include <linux/of.h>
+#include <linux/mfd/abx500.h>
+#include <linux/mfd/abx500/ab8500.h>
+#include <linux/mfd/abx500/ab8500-bm.h>
+
+/*
+ * These are the defined batteries that uses a NTC and ID resistor placed
+ * inside of the battery pack.
+ * Note that the res_to_temp table must be strictly sorted by falling resistance
+ * values to work.
+ */
+static struct abx500_res_to_temp temp_tbl_A_thermistor[] = {
+ {-5, 53407},
+ { 0, 48594},
+ { 5, 43804},
+ {10, 39188},
+ {15, 34870},
+ {20, 30933},
+ {25, 27422},
+ {30, 24347},
+ {35, 21694},
+ {40, 19431},
+ {45, 17517},
+ {50, 15908},
+ {55, 14561},
+ {60, 13437},
+ {65, 12500},
+};
+static struct abx500_res_to_temp temp_tbl_B_thermistor[] = {
+ {-5, 165418},
+ { 0, 159024},
+ { 5, 151921},
+ {10, 144300},
+ {15, 136424},
+ {20, 128565},
+ {25, 120978},
+ {30, 113875},
+ {35, 107397},
+ {40, 101629},
+ {45, 96592},
+ {50, 92253},
+ {55, 88569},
+ {60, 85461},
+ {65, 82869},
+};
+static struct abx500_v_to_cap cap_tbl_A_thermistor[] = {
+ {4171, 100},
+ {4114, 95},
+ {4009, 83},
+ {3947, 74},
+ {3907, 67},
+ {3863, 59},
+ {3830, 56},
+ {3813, 53},
+ {3791, 46},
+ {3771, 33},
+ {3754, 25},
+ {3735, 20},
+ {3717, 17},
+ {3681, 13},
+ {3664, 8},
+ {3651, 6},
+ {3635, 5},
+ {3560, 3},
+ {3408, 1},
+ {3247, 0},
+};
+static struct abx500_v_to_cap cap_tbl_B_thermistor[] = {
+ {4161, 100},
+ {4124, 98},
+ {4044, 90},
+ {4003, 85},
+ {3966, 80},
+ {3933, 75},
+ {3888, 67},
+ {3849, 60},
+ {3813, 55},
+ {3787, 47},
+ {3772, 30},
+ {3751, 25},
+ {3718, 20},
+ {3681, 16},
+ {3660, 14},
+ {3589, 10},
+ {3546, 7},
+ {3495, 4},
+ {3404, 2},
+ {3250, 0},
+};
+
+static struct abx500_v_to_cap cap_tbl[] = {
+ {4186, 100},
+ {4163, 99},
+ {4114, 95},
+ {4068, 90},
+ {3990, 80},
+ {3926, 70},
+ {3898, 65},
+ {3866, 60},
+ {3833, 55},
+ {3812, 50},
+ {3787, 40},
+ {3768, 30},
+ {3747, 25},
+ {3730, 20},
+ {3705, 15},
+ {3699, 14},
+ {3684, 12},
+ {3672, 9},
+ {3657, 7},
+ {3638, 6},
+ {3556, 4},
+ {3424, 2},
+ {3317, 1},
+ {3094, 0},
+};
+
+/*
+ * Note that the res_to_temp table must be strictly sorted by falling
+ * resistance values to work.
+ */
+static struct abx500_res_to_temp temp_tbl[] = {
+ {-5, 214834},
+ { 0, 162943},
+ { 5, 124820},
+ {10, 96520},
+ {15, 75306},
+ {20, 59254},
+ {25, 47000},
+ {30, 37566},
+ {35, 30245},
+ {40, 24520},
+ {45, 20010},
+ {50, 16432},
+ {55, 13576},
+ {60, 11280},
+ {65, 9425},
+};
+
+/*
+ * Note that the batres_vs_temp table must be strictly sorted by falling
+ * temperature values to work.
+ */
+struct batres_vs_temp temp_to_batres_tbl_thermistor[] = {
+ { 40, 120},
+ { 30, 135},
+ { 20, 165},
+ { 10, 230},
+ { 00, 325},
+ {-10, 445},
+ {-20, 595},
+};
+
+/*
+ * Note that the batres_vs_temp table must be strictly sorted by falling
+ * temperature values to work.
+ */
+struct batres_vs_temp temp_to_batres_tbl_ext_thermistor[] = {
+ { 60, 300},
+ { 30, 300},
+ { 20, 300},
+ { 10, 300},
+ { 00, 300},
+ {-10, 300},
+ {-20, 300},
+};
+
+/* battery resistance table for LI ION 9100 battery */
+struct batres_vs_temp temp_to_batres_tbl_9100[] = {
+ { 60, 180},
+ { 30, 180},
+ { 20, 180},
+ { 10, 180},
+ { 00, 180},
+ {-10, 180},
+ {-20, 180},
+};
+
+struct abx500_battery_type bat_type_thermistor[] = {
+[BATTERY_UNKNOWN] = {
+ /* First element always represent the UNKNOWN battery */
+ .name = POWER_SUPPLY_TECHNOLOGY_UNKNOWN,
+ .resis_high = 0,
+ .resis_low = 0,
+ .battery_resistance = 300,
+ .charge_full_design = 612,
+ .nominal_voltage = 3700,
+ .termination_vol = 4050,
+ .termination_curr = 200,
+ .recharge_vol = 3990,
+ .normal_cur_lvl = 400,
+ .normal_vol_lvl = 4100,
+ .maint_a_cur_lvl = 400,
+ .maint_a_vol_lvl = 4050,
+ .maint_a_chg_timer_h = 60,
+ .maint_b_cur_lvl = 400,
+ .maint_b_vol_lvl = 4000,
+ .maint_b_chg_timer_h = 200,
+ .low_high_cur_lvl = 300,
+ .low_high_vol_lvl = 4000,
+ .n_temp_tbl_elements = ARRAY_SIZE(temp_tbl),
+ .r_to_t_tbl = temp_tbl,
+ .n_v_cap_tbl_elements = ARRAY_SIZE(cap_tbl),
+ .v_to_cap_tbl = cap_tbl,
+ .n_batres_tbl_elements = ARRAY_SIZE(temp_to_batres_tbl_thermistor),
+ .batres_tbl = temp_to_batres_tbl_thermistor,
+},
+{
+ .name = POWER_SUPPLY_TECHNOLOGY_LIPO,
+ .resis_high = 53407,
+ .resis_low = 12500,
+ .battery_resistance = 300,
+ .charge_full_design = 900,
+ .nominal_voltage = 3600,
+ .termination_vol = 4150,
+ .termination_curr = 80,
+ .recharge_vol = 4130,
+ .normal_cur_lvl = 700,
+ .normal_vol_lvl = 4200,
+ .maint_a_cur_lvl = 600,
+ .maint_a_vol_lvl = 4150,
+ .maint_a_chg_timer_h = 60,
+ .maint_b_cur_lvl = 600,
+ .maint_b_vol_lvl = 4100,
+ .maint_b_chg_timer_h = 200,
+ .low_high_cur_lvl = 300,
+ .low_high_vol_lvl = 4000,
+ .n_temp_tbl_elements = ARRAY_SIZE(temp_tbl_A_thermistor),
+ .r_to_t_tbl = temp_tbl_A_thermistor,
+ .n_v_cap_tbl_elements = ARRAY_SIZE(cap_tbl_A_thermistor),
+ .v_to_cap_tbl = cap_tbl_A_thermistor,
+ .n_batres_tbl_elements = ARRAY_SIZE(temp_to_batres_tbl_thermistor),
+ .batres_tbl = temp_to_batres_tbl_thermistor,
+
+},
+{
+ .name = POWER_SUPPLY_TECHNOLOGY_LIPO,
+ .resis_high = 165418,
+ .resis_low = 82869,
+ .battery_resistance = 300,
+ .charge_full_design = 900,
+ .nominal_voltage = 3600,
+ .termination_vol = 4150,
+ .termination_curr = 80,
+ .recharge_vol = 4130,
+ .normal_cur_lvl = 700,
+ .normal_vol_lvl = 4200,
+ .maint_a_cur_lvl = 600,
+ .maint_a_vol_lvl = 4150,
+ .maint_a_chg_timer_h = 60,
+ .maint_b_cur_lvl = 600,
+ .maint_b_vol_lvl = 4100,
+ .maint_b_chg_timer_h = 200,
+ .low_high_cur_lvl = 300,
+ .low_high_vol_lvl = 4000,
+ .n_temp_tbl_elements = ARRAY_SIZE(temp_tbl_B_thermistor),
+ .r_to_t_tbl = temp_tbl_B_thermistor,
+ .n_v_cap_tbl_elements = ARRAY_SIZE(cap_tbl_B_thermistor),
+ .v_to_cap_tbl = cap_tbl_B_thermistor,
+ .n_batres_tbl_elements = ARRAY_SIZE(temp_to_batres_tbl_thermistor),
+ .batres_tbl = temp_to_batres_tbl_thermistor,
+},
+};
+
+struct abx500_battery_type bat_type_ext_thermistor[] = {
+[BATTERY_UNKNOWN] = {
+ /* First element always represent the UNKNOWN battery */
+ .name = POWER_SUPPLY_TECHNOLOGY_UNKNOWN,
+ .resis_high = 0,
+ .resis_low = 0,
+ .battery_resistance = 300,
+ .charge_full_design = 612,
+ .nominal_voltage = 3700,
+ .termination_vol = 4050,
+ .termination_curr = 200,
+ .recharge_vol = 3990,
+ .normal_cur_lvl = 400,
+ .normal_vol_lvl = 4100,
+ .maint_a_cur_lvl = 400,
+ .maint_a_vol_lvl = 4050,
+ .maint_a_chg_timer_h = 60,
+ .maint_b_cur_lvl = 400,
+ .maint_b_vol_lvl = 4000,
+ .maint_b_chg_timer_h = 200,
+ .low_high_cur_lvl = 300,
+ .low_high_vol_lvl = 4000,
+ .n_temp_tbl_elements = ARRAY_SIZE(temp_tbl),
+ .r_to_t_tbl = temp_tbl,
+ .n_v_cap_tbl_elements = ARRAY_SIZE(cap_tbl),
+ .v_to_cap_tbl = cap_tbl,
+ .n_batres_tbl_elements = ARRAY_SIZE(temp_to_batres_tbl_thermistor),
+ .batres_tbl = temp_to_batres_tbl_thermistor,
+},
+/*
+ * These are the batteries that doesn't have an internal NTC resistor to measure
+ * its temperature. The temperature in this case is measure with a NTC placed
+ * near the battery but on the PCB.
+ */
+{
+ .name = POWER_SUPPLY_TECHNOLOGY_LIPO,
+ .resis_high = 76000,
+ .resis_low = 53000,
+ .battery_resistance = 300,
+ .charge_full_design = 900,
+ .nominal_voltage = 3700,
+ .termination_vol = 4150,
+ .termination_curr = 100,
+ .recharge_vol = 4130,
+ .normal_cur_lvl = 700,
+ .normal_vol_lvl = 4200,
+ .maint_a_cur_lvl = 600,
+ .maint_a_vol_lvl = 4150,
+ .maint_a_chg_timer_h = 60,
+ .maint_b_cur_lvl = 600,
+ .maint_b_vol_lvl = 4100,
+ .maint_b_chg_timer_h = 200,
+ .low_high_cur_lvl = 300,
+ .low_high_vol_lvl = 4000,
+ .n_temp_tbl_elements = ARRAY_SIZE(temp_tbl),
+ .r_to_t_tbl = temp_tbl,
+ .n_v_cap_tbl_elements = ARRAY_SIZE(cap_tbl),
+ .v_to_cap_tbl = cap_tbl,
+ .n_batres_tbl_elements = ARRAY_SIZE(temp_to_batres_tbl_thermistor),
+ .batres_tbl = temp_to_batres_tbl_thermistor,
+},
+{
+ .name = POWER_SUPPLY_TECHNOLOGY_LION,
+ .resis_high = 30000,
+ .resis_low = 10000,
+ .battery_resistance = 300,
+ .charge_full_design = 950,
+ .nominal_voltage = 3700,
+ .termination_vol = 4150,
+ .termination_curr = 100,
+ .recharge_vol = 4130,
+ .normal_cur_lvl = 700,
+ .normal_vol_lvl = 4200,
+ .maint_a_cur_lvl = 600,
+ .maint_a_vol_lvl = 4150,
+ .maint_a_chg_timer_h = 60,
+ .maint_b_cur_lvl = 600,
+ .maint_b_vol_lvl = 4100,
+ .maint_b_chg_timer_h = 200,
+ .low_high_cur_lvl = 300,
+ .low_high_vol_lvl = 4000,
+ .n_temp_tbl_elements = ARRAY_SIZE(temp_tbl),
+ .r_to_t_tbl = temp_tbl,
+ .n_v_cap_tbl_elements = ARRAY_SIZE(cap_tbl),
+ .v_to_cap_tbl = cap_tbl,
+ .n_batres_tbl_elements = ARRAY_SIZE(temp_to_batres_tbl_thermistor),
+ .batres_tbl = temp_to_batres_tbl_thermistor,
+},
+{
+ .name = POWER_SUPPLY_TECHNOLOGY_LION,
+ .resis_high = 95000,
+ .resis_low = 76001,
+ .battery_resistance = 300,
+ .charge_full_design = 950,
+ .nominal_voltage = 3700,
+ .termination_vol = 4150,
+ .termination_curr = 100,
+ .recharge_vol = 4130,
+ .normal_cur_lvl = 700,
+ .normal_vol_lvl = 4200,
+ .maint_a_cur_lvl = 600,
+ .maint_a_vol_lvl = 4150,
+ .maint_a_chg_timer_h = 60,
+ .maint_b_cur_lvl = 600,
+ .maint_b_vol_lvl = 4100,
+ .maint_b_chg_timer_h = 200,
+ .low_high_cur_lvl = 300,
+ .low_high_vol_lvl = 4000,
+ .n_temp_tbl_elements = ARRAY_SIZE(temp_tbl),
+ .r_to_t_tbl = temp_tbl,
+ .n_v_cap_tbl_elements = ARRAY_SIZE(cap_tbl),
+ .v_to_cap_tbl = cap_tbl,
+ .n_batres_tbl_elements = ARRAY_SIZE(temp_to_batres_tbl_thermistor),
+ .batres_tbl = temp_to_batres_tbl_thermistor,
+},
+};
+
+static const struct abx500_bm_capacity_levels cap_levels = {
+ .critical = 2,
+ .low = 10,
+ .normal = 70,
+ .high = 95,
+ .full = 100,
+};
+
+static const struct abx500_fg_parameters fg = {
+ .recovery_sleep_timer = 10,
+ .recovery_total_time = 100,
+ .init_timer = 1,
+ .init_discard_time = 5,
+ .init_total_time = 40,
+ .high_curr_time = 60,
+ .accu_charging = 30,
+ .accu_high_curr = 30,
+ .high_curr_threshold = 50,
+ .lowbat_threshold = 3100,
+ .battok_falling_th_sel0 = 2860,
+ .battok_raising_th_sel1 = 2860,
+ .user_cap_limit = 15,
+ .maint_thres = 97,
+};
+
+static const struct abx500_maxim_parameters maxi_params = {
+ .ena_maxi = true,
+ .chg_curr = 910,
+ .wait_cycles = 10,
+ .charger_curr_step = 100,
+};
+
+static const struct abx500_bm_charger_parameters chg = {
+ .usb_volt_max = 5500,
+ .usb_curr_max = 1500,
+ .ac_volt_max = 7500,
+ .ac_curr_max = 1500,
+};
+
+struct abx500_bm_data ab8500_bm_data = {
+ .temp_under = 3,
+ .temp_low = 8,
+ .temp_high = 43,
+ .temp_over = 48,
+ .main_safety_tmr_h = 4,
+ .temp_interval_chg = 20,
+ .temp_interval_nochg = 120,
+ .usb_safety_tmr_h = 4,
+ .bkup_bat_v = BUP_VCH_SEL_2P6V,
+ .bkup_bat_i = BUP_ICH_SEL_150UA,
+ .no_maintenance = false,
+ .adc_therm = ABx500_ADC_THERM_BATCTRL,
+ .chg_unknown_bat = false,
+ .enable_overshoot = false,
+ .fg_res = 100,
+ .cap_levels = &cap_levels,
+ .bat_type = bat_type_thermistor,
+ .n_btypes = 3,
+ .batt_id = 0,
+ .interval_charging = 5,
+ .interval_not_charging = 120,
+ .temp_hysteresis = 3,
+ .gnd_lift_resistance = 34,
+ .maxi = &maxi_params,
+ .chg_params = &chg,
+ .fg_params = &fg,
+};
+
+int __devinit
+bmdevs_of_probe(struct device *dev,
+ struct device_node *np,
+ struct abx500_bm_plat_data *pdata)
+{
+ int i, ret = 0, thermistor = NTC_INTERNAL;
+ const __be32 *ph;
+ const char *bat_tech;
+ struct abx500_bm_data *bat;
+ struct abx500_battery_type *btype;
+ struct device_node *np_bat_supply;
+ struct abx500_bmdevs_plat_data *plat_data = pdata->bmdev_pdata;
+
+ /* get phandle to 'supplied-to' node */
+ ph = of_get_property(np, "supplied-to", &plat_data->num_supplicants);
+ if (ph == NULL) {
+ dev_err(dev, "no supplied_to property specified\n");
+ return -EINVAL;
+ }
+ plat_data->num_supplicants /= sizeof(int);
+ plat_data->supplied_to =
+ devm_kzalloc(dev, plat_data->num_supplicants *
+ sizeof(const char *), GFP_KERNEL);
+ if (plat_data->supplied_to == NULL) {
+ dev_err(dev, "%s no mem for supplied-to\n", __func__);
+ return -ENOMEM;
+ }
+ for (i = 0; i < plat_data->num_supplicants; ++i) {
+ np_bat_supply = of_find_node_by_phandle(be32_to_cpup(ph) + i);
+ if (np_bat_supply == NULL) {
+ dev_err(dev, "invalid supplied_to property\n");
+ return -EINVAL;
+ }
+ ret = of_property_read_string(np_bat_supply, "interface-name",
+ (const char **)(plat_data->supplied_to + i));
+ if (ret < 0) {
+ of_node_put(np_bat_supply);
+ dev_err(dev, "supply/interface name not found\n");
+ return ret;
+ }
+ dev_dbg(dev, "%s power supply interface_name:%s\n",
+ __func__, *(plat_data->supplied_to + i));
+ }
+ /* get phandle to 'battery-info' node */
+ ph = of_get_property(np, "battery-info", NULL);
+ if (ph == NULL) {
+ dev_err(dev, "missing property battery-info\n");
+ return -EINVAL;
+ }
+ np_bat_supply = of_find_node_by_phandle(be32_to_cpup(ph));
+ if (np_bat_supply == NULL) {
+ dev_err(dev, "invalid battery-info node\n");
+ return -EINVAL;
+ }
+ if (of_property_read_bool(np_bat_supply,
+ "thermistor-on-batctrl") == false){
+ dev_warn(dev, "missing property thermistor-on-batctrl\n");
+ thermistor = NTC_EXTERNAL;
+ }
+ pdata->battery = &ab8500_bm_data;
+ bat = pdata->battery;
+ if (thermistor == NTC_EXTERNAL) {
+ bat->n_btypes = 4;
+ bat->bat_type = bat_type_ext_thermistor;
+ bat->adc_therm = ABx500_ADC_THERM_BATTEMP;
+ }
+ ret = of_property_read_string(np_bat_supply, "battery-name", &bat_tech);
+ if (ret < 0) {
+ dev_warn(dev, "missing property battery-name/type\n");
+ bat_tech = "UNKNOWN";
+ }
+ of_node_put(np_bat_supply);
+ if (strcmp(bat_tech, "LION") == 0) {
+ bat->no_maintenance = true;
+ bat->chg_unknown_bat = true;
+ bat->bat_type[BATTERY_UNKNOWN].charge_full_design = 2600;
+ bat->bat_type[BATTERY_UNKNOWN].termination_vol = 4150;
+ bat->bat_type[BATTERY_UNKNOWN].recharge_vol = 4130;
+ bat->bat_type[BATTERY_UNKNOWN].normal_cur_lvl = 520;
+ bat->bat_type[BATTERY_UNKNOWN].normal_vol_lvl = 4200;
+ }
+ /* select the battery resolution table */
+ for (i = 0; i < bat->n_btypes; ++i) {
+ btype = (bat->bat_type + i);
+ if (thermistor == NTC_EXTERNAL) {
+ btype->batres_tbl =
+ temp_to_batres_tbl_ext_thermistor;
+ } else if (strcmp(bat_tech, "LION") == 0) {
+ btype->batres_tbl =
+ temp_to_batres_tbl_9100;
+ } else {
+ btype->batres_tbl =
+ temp_to_batres_tbl_thermistor;
+ }
+ }
+ return 0;
+}
+EXPORT_SYMBOL(bmdevs_of_probe);
diff --git a/drivers/power/ab8500_btemp.c b/drivers/power/ab8500_btemp.c
index bba3cca..8e427e7 100644
--- a/drivers/power/ab8500_btemp.c
+++ b/drivers/power/ab8500_btemp.c
@@ -93,7 +93,7 @@ struct ab8500_btemp {
struct ab8500 *parent;
struct ab8500_gpadc *gpadc;
struct ab8500_fg *fg;
- struct abx500_btemp_platform_data *pdata;
+ struct abx500_bmdevs_plat_data *pdata;
struct abx500_bm_data *bat;
struct power_supply btemp_psy;
struct ab8500_btemp_events events;
@@ -982,7 +982,7 @@ static int __devinit ab8500_btemp_probe(struct platform_device *pdev)
di->gpadc = ab8500_gpadc_get("ab8500-gpadc.0");
/* get btemp specific platform data */
- di->pdata = plat_data->btemp;
+ di->pdata = plat_data->bmdev_pdata;
if (!di->pdata) {
dev_err(di->dev, "no btemp platform data supplied\n");
ret = -EINVAL;
diff --git a/drivers/power/ab8500_charger.c b/drivers/power/ab8500_charger.c
index d4f0c98..5ff0d83 100644
--- a/drivers/power/ab8500_charger.c
+++ b/drivers/power/ab8500_charger.c
@@ -220,7 +220,7 @@ struct ab8500_charger {
bool autopower;
struct ab8500 *parent;
struct ab8500_gpadc *gpadc;
- struct abx500_charger_platform_data *pdata;
+ struct abx500_bmdevs_plat_data *pdata;
struct abx500_bm_data *bat;
struct ab8500_charger_event_flags flags;
struct ab8500_charger_usb_state usb_state;
@@ -2555,7 +2555,7 @@ static int __devinit ab8500_charger_probe(struct platform_device *pdev)
spin_lock_init(&di->usb_state.usb_lock);
/* get charger specific platform data */
- di->pdata = plat_data->charger;
+ di->pdata = plat_data->bmdev_pdata;
if (!di->pdata) {
dev_err(di->dev, "no charger platform data supplied\n");
ret = -EINVAL;
diff --git a/drivers/power/ab8500_fg.c b/drivers/power/ab8500_fg.c
index bf02225..96741b8 100644
--- a/drivers/power/ab8500_fg.c
+++ b/drivers/power/ab8500_fg.c
@@ -22,15 +22,14 @@
#include <linux/platform_device.h>
#include <linux/power_supply.h>
#include <linux/kobject.h>
-#include <linux/mfd/abx500/ab8500.h>
-#include <linux/mfd/abx500.h>
#include <linux/slab.h>
-#include <linux/mfd/abx500/ab8500-bm.h>
#include <linux/delay.h>
-#include <linux/mfd/abx500/ab8500-gpadc.h>
-#include <linux/mfd/abx500.h>
#include <linux/time.h>
#include <linux/completion.h>
+#include <linux/mfd/abx500.h>
+#include <linux/mfd/abx500/ab8500.h>
+#include <linux/mfd/abx500/ab8500-bm.h>
+#include <linux/mfd/abx500/ab8500-gpadc.h>
#define MILLI_TO_MICRO 1000
#define FG_LSB_IN_MA 1627
@@ -212,7 +211,7 @@ struct ab8500_fg {
struct ab8500_fg_avg_cap avg_cap;
struct ab8500 *parent;
struct ab8500_gpadc *gpadc;
- struct abx500_fg_platform_data *pdata;
+ struct abx500_bmdevs_plat_data *pdata;
struct abx500_bm_data *bat;
struct power_supply fg_psy;
struct workqueue_struct *fg_wq;
@@ -544,14 +543,14 @@ cc_err:
ret = abx500_set_register_interruptible(di->dev,
AB8500_GAS_GAUGE, AB8500_GASG_CC_NCOV_ACCU,
SEC_TO_SAMPLE(10));
- if (ret)
+ if (ret < 0)
goto fail;
/* Start the CC */
ret = abx500_set_register_interruptible(di->dev, AB8500_RTC,
AB8500_RTC_CC_CONF_REG,
(CC_DEEP_SLEEP_ENA | CC_PWR_UP_ENA));
- if (ret)
+ if (ret < 0)
goto fail;
} else {
di->turn_off_fg = false;
@@ -2429,7 +2428,6 @@ static int __devexit ab8500_fg_remove(struct platform_device *pdev)
flush_scheduled_work();
power_supply_unregister(&di->fg_psy);
platform_set_drvdata(pdev, NULL);
- kfree(di);
return ret;
}
@@ -2446,18 +2444,47 @@ static int __devinit ab8500_fg_probe(struct platform_device *pdev)
{
int i, irq;
int ret = 0;
- struct abx500_bm_plat_data *plat_data = pdev->dev.platform_data;
+ struct abx500_bm_plat_data *plat_data
+ = pdev->dev.platform_data;
+ struct device_node *np = pdev->dev.of_node;
struct ab8500_fg *di;
+ di = devm_kzalloc(&pdev->dev, sizeof(*di), GFP_KERNEL);
+ if (!di) {
+ dev_err(&pdev->dev, "%s no mem for ab8500_fg\n", __func__);
+ return -ENOMEM;
+ }
+ if (np) {
+ if (!plat_data) {
+ plat_data =
+ devm_kzalloc(&pdev->dev, sizeof(*plat_data),
+ GFP_KERNEL);
+ if (!plat_data) {
+ dev_err(&pdev->dev,
+ "%s no mem for plat_data\n", __func__);
+ return -ENOMEM;
+ }
+ plat_data->bmdev_pdata = devm_kzalloc(&pdev->dev,
+ sizeof(*plat_data->bmdev_pdata), GFP_KERNEL);
+ if (!plat_data->bmdev_pdata) {
+ dev_err(&pdev->dev,
+ "%s no mem for pdata->fg\n",
+ __func__);
+ return -ENOMEM;
+ }
+ }
+ ret = bmdevs_of_probe(&pdev->dev, np, plat_data);
+ if (ret < 0) {
+ dev_err(&pdev->dev, "failed to get platform data\n");
+ return ret;
+ }
+ }
if (!plat_data) {
- dev_err(&pdev->dev, "No platform data\n");
+ dev_err(&pdev->dev,
+ "%s no fg platform data found\n", __func__);
return -EINVAL;
}
- di = kzalloc(sizeof(*di), GFP_KERNEL);
- if (!di)
- return -ENOMEM;
-
mutex_init(&di->cc_lock);
/* get parent data */
@@ -2466,19 +2493,17 @@ static int __devinit ab8500_fg_probe(struct platform_device *pdev)
di->gpadc = ab8500_gpadc_get("ab8500-gpadc.0");
/* get fg specific platform data */
- di->pdata = plat_data->fg;
+ di->pdata = plat_data->bmdev_pdata;
if (!di->pdata) {
dev_err(di->dev, "no fg platform data supplied\n");
- ret = -EINVAL;
- goto free_device_info;
+ return -EINVAL;
}
/* get battery specific platform data */
di->bat = plat_data->battery;
if (!di->bat) {
dev_err(di->dev, "no battery platform data supplied\n");
- ret = -EINVAL;
- goto free_device_info;
+ return -EINVAL;
}
di->fg_psy.name = "ab8500_fg";
@@ -2506,7 +2531,7 @@ static int __devinit ab8500_fg_probe(struct platform_device *pdev)
di->fg_wq = create_singlethread_workqueue("ab8500_fg_wq");
if (di->fg_wq == NULL) {
dev_err(di->dev, "failed to create work queue\n");
- goto free_device_info;
+ return -ENOMEM;
}
/* Init work for running the fg algorithm instantly */
@@ -2605,12 +2630,14 @@ free_irq:
}
free_inst_curr_wq:
destroy_workqueue(di->fg_wq);
-free_device_info:
- kfree(di);
-
return ret;
}
+static const struct of_device_id ab8500_fg_match[] = {
+ {.compatible = "stericsson,ab8500-fg",},
+ {},
+};
+
static struct platform_driver ab8500_fg_driver = {
.probe = ab8500_fg_probe,
.remove = __devexit_p(ab8500_fg_remove),
@@ -2619,6 +2646,7 @@ static struct platform_driver ab8500_fg_driver = {
.driver = {
.name = "ab8500-fg",
.owner = THIS_MODULE,
+ .of_match_table = ab8500_fg_match,
},
};
diff --git a/drivers/power/abx500_chargalg.c b/drivers/power/abx500_chargalg.c
index 804b88c..ba548e4 100644
--- a/drivers/power/abx500_chargalg.c
+++ b/drivers/power/abx500_chargalg.c
@@ -231,7 +231,7 @@ struct abx500_chargalg {
struct abx500_chargalg_charger_info chg_info;
struct abx500_chargalg_battery_data batt_data;
struct abx500_chargalg_suspension_status susp_status;
- struct abx500_chargalg_platform_data *pdata;
+ struct abx500_bmdevs_plat_data *pdata;
struct abx500_bm_data *bat;
struct power_supply chargalg_psy;
struct ux500_charger *ac_chg;
@@ -1814,7 +1814,7 @@ static int __devinit abx500_chargalg_probe(struct platform_device *pdev)
di->dev = &pdev->dev;
plat_data = pdev->dev.platform_data;
- di->pdata = plat_data->chargalg;
+ di->pdata = plat_data->bmdev_pdata;
di->bat = plat_data->battery;
/* chargalg supply */
diff --git a/include/linux/mfd/abx500.h b/include/linux/mfd/abx500.h
index 1318ca6..286f8ac 100644
--- a/include/linux/mfd/abx500.h
+++ b/include/linux/mfd/abx500.h
@@ -382,39 +382,30 @@ struct abx500_bm_data {
int gnd_lift_resistance;
const struct abx500_maxim_parameters *maxi;
const struct abx500_bm_capacity_levels *cap_levels;
- const struct abx500_battery_type *bat_type;
+ struct abx500_battery_type *bat_type;
const struct abx500_bm_charger_parameters *chg_params;
const struct abx500_fg_parameters *fg_params;
};
-struct abx500_chargalg_platform_data {
- char **supplied_to;
- size_t num_supplicants;
+struct abx500_bmdevs_plat_data {
+ char **supplied_to;
+ size_t num_supplicants;
+ bool autopower_cfg;
};
-struct abx500_charger_platform_data {
- char **supplied_to;
- size_t num_supplicants;
- bool autopower_cfg;
-};
-
-struct abx500_btemp_platform_data {
- char **supplied_to;
- size_t num_supplicants;
+struct abx500_bm_plat_data {
+ struct abx500_bm_data *battery;
+ struct abx500_bmdevs_plat_data *bmdev_pdata;
};
-struct abx500_fg_platform_data {
- char **supplied_to;
- size_t num_supplicants;
+enum {
+ NTC_EXTERNAL = 0,
+ NTC_INTERNAL,
};
-struct abx500_bm_plat_data {
- struct abx500_bm_data *battery;
- struct abx500_charger_platform_data *charger;
- struct abx500_btemp_platform_data *btemp;
- struct abx500_fg_platform_data *fg;
- struct abx500_chargalg_platform_data *chargalg;
-};
+int bmdevs_of_probe(struct device *dev,
+ struct device_node *np,
+ struct abx500_bm_plat_data *pdata);
int abx500_set_register_interruptible(struct device *dev, u8 bank, u8 reg,
u8 value);
diff --git a/include/linux/mfd/abx500/ab8500-bm.h b/include/linux/mfd/abx500/ab8500-bm.h
index 44310c9..d15b7f1 100644
--- a/include/linux/mfd/abx500/ab8500-bm.h
+++ b/include/linux/mfd/abx500/ab8500-bm.h
@@ -422,6 +422,13 @@ struct ab8500_chargalg_platform_data {
struct ab8500_btemp;
struct ab8500_gpadc;
struct ab8500_fg;
+
+extern struct abx500_bm_data ab8500_bm_data;
+extern struct abx500_battery_type bat_type_ext_thermistor[];
+extern struct batres_vs_temp temp_to_batres_tbl_ext_thermistor[];
+extern struct batres_vs_temp temp_to_batres_tbl_9100[];
+extern struct batres_vs_temp temp_to_batres_tbl_thermistor[];
+
#ifdef CONFIG_AB8500_BM
void ab8500_fg_reinit(void);
void ab8500_charger_usb_state_changed(u8 bm_usb_state, u16 mA);
--
1.7.9.5
^ permalink raw reply related
* [PATCH 0/4] Implement device tree support for ab8500 BM Devices
From: Rajanikanth H.V @ 2012-10-01 4:08 UTC (permalink / raw)
To: linux-arm-kernel
From: "Rajanikanth H.V" <rajanikanth.hv@stericsson.com>
This patch-set adds device tree support for ab8500 battery-managed
devices. This removes the redundant platform structure maintained
across bm devices and implements common DT probe routine across all the
modules.
Rajanikanth H.V (4):
mfd: ab8500: add devicetree support for fuelgauge
mfd: ab8500: add devicetree support for Btemp
mfd: ab8500: add devicetree support for charger
mfd: ab8500: add devicetree support for charging algorithm
Documentation/devicetree/bindings/mfd/ab8500.txt | 27 +-
.../bindings/power_supply/ab8500/btemp.txt | 29 ++
.../bindings/power_supply/ab8500/chargalg.txt | 36 ++
.../bindings/power_supply/ab8500/charger.txt | 44 ++
.../devicetree/bindings/power_supply/ab8500/fg.txt | 86 +++
arch/arm/boot/dts/dbx5x0.dtsi | 40 +-
drivers/mfd/ab8500-core.c | 4 +
drivers/power/Kconfig | 6 -
drivers/power/Makefile | 2 +-
drivers/power/ab8500_bmdata.c | 549 ++++++++++++++++++++
drivers/power/ab8500_btemp.c | 57 +-
drivers/power/ab8500_charger.c | 65 ++-
drivers/power/ab8500_fg.c | 76 ++-
drivers/power/abx500_chargalg.c | 62 ++-
include/linux/mfd/abx500.h | 37 +-
include/linux/mfd/abx500/ab8500-bm.h | 7 +
16 files changed, 1028 insertions(+), 99 deletions(-)
create mode 100644 Documentation/devicetree/bindings/power_supply/ab8500/btemp.txt
create mode 100644 Documentation/devicetree/bindings/power_supply/ab8500/chargalg.txt
create mode 100644 Documentation/devicetree/bindings/power_supply/ab8500/charger.txt
create mode 100644 Documentation/devicetree/bindings/power_supply/ab8500/fg.txt
create mode 100644 drivers/power/ab8500_bmdata.c
--
1.7.9.5
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox