* [PATCH 5/6] powerpc/powernv: Create OPAL sglist helper functions and fix endian issues
From: Anton Blanchard @ 2014-04-22 5:01 UTC (permalink / raw)
To: benh, paulus, hegdevasant, stewart; +Cc: linuxppc-dev
In-Reply-To: <1398142887-24109-1-git-send-email-anton@samba.org>
We have two copies of code that creates an OPAL sg list. Consolidate
these into a common set of helpers and fix the endian issues.
The flash interface embedded a version number in the num_entries
field, whereas the dump interface did did not. Since versioning
wasn't added to the flash interface and it is impossible to add
this in a backwards compatible way, just remove it.
Signed-off-by: Anton Blanchard <anton@samba.org>
---
arch/powerpc/include/asm/opal.h | 14 ++--
arch/powerpc/platforms/powernv/opal-dump.c | 81 +--------------------
arch/powerpc/platforms/powernv/opal-flash.c | 106 +---------------------------
arch/powerpc/platforms/powernv/opal.c | 63 +++++++++++++++++
4 files changed, 76 insertions(+), 188 deletions(-)
diff --git a/arch/powerpc/include/asm/opal.h b/arch/powerpc/include/asm/opal.h
index 1a752ac..afb0fed 100644
--- a/arch/powerpc/include/asm/opal.h
+++ b/arch/powerpc/include/asm/opal.h
@@ -41,14 +41,14 @@ struct opal_takeover_args {
* size except the last one in the list to be as well.
*/
struct opal_sg_entry {
- void *data;
- long length;
+ __be64 data;
+ __be64 length;
};
-/* sg list */
+/* SG list */
struct opal_sg_list {
- unsigned long num_entries;
- struct opal_sg_list *next;
+ __be64 length;
+ __be64 next;
struct opal_sg_entry entry[];
};
@@ -929,6 +929,10 @@ extern int opal_resync_timebase(void);
extern void opal_lpc_init(void);
+struct opal_sg_list *opal_vmalloc_to_sg_list(void *vmalloc_addr,
+ unsigned long vmalloc_size);
+void opal_free_sg_list(struct opal_sg_list *sg);
+
#endif /* __ASSEMBLY__ */
#endif /* __OPAL_H */
diff --git a/arch/powerpc/platforms/powernv/opal-dump.c b/arch/powerpc/platforms/powernv/opal-dump.c
index b9827b0..f0b4724 100644
--- a/arch/powerpc/platforms/powernv/opal-dump.c
+++ b/arch/powerpc/platforms/powernv/opal-dump.c
@@ -209,80 +209,6 @@ static struct kobj_type dump_ktype = {
.default_attrs = dump_default_attrs,
};
-static void free_dump_sg_list(struct opal_sg_list *list)
-{
- struct opal_sg_list *sg1;
- while (list) {
- sg1 = list->next;
- kfree(list);
- list = sg1;
- }
- list = NULL;
-}
-
-static struct opal_sg_list *dump_data_to_sglist(struct dump_obj *dump)
-{
- struct opal_sg_list *sg1, *list = NULL;
- void *addr;
- int64_t size;
-
- addr = dump->buffer;
- size = dump->size;
-
- sg1 = kzalloc(PAGE_SIZE, GFP_KERNEL);
- if (!sg1)
- goto nomem;
-
- list = sg1;
- sg1->num_entries = 0;
- while (size > 0) {
- /* Translate virtual address to physical address */
- sg1->entry[sg1->num_entries].data =
- (void *)(vmalloc_to_pfn(addr) << PAGE_SHIFT);
-
- if (size > PAGE_SIZE)
- sg1->entry[sg1->num_entries].length = PAGE_SIZE;
- else
- sg1->entry[sg1->num_entries].length = size;
-
- sg1->num_entries++;
- if (sg1->num_entries >= SG_ENTRIES_PER_NODE) {
- sg1->next = kzalloc(PAGE_SIZE, GFP_KERNEL);
- if (!sg1->next)
- goto nomem;
-
- sg1 = sg1->next;
- sg1->num_entries = 0;
- }
- addr += PAGE_SIZE;
- size -= PAGE_SIZE;
- }
- return list;
-
-nomem:
- pr_err("%s : Failed to allocate memory\n", __func__);
- free_dump_sg_list(list);
- return NULL;
-}
-
-static void sglist_to_phy_addr(struct opal_sg_list *list)
-{
- struct opal_sg_list *sg, *next;
-
- for (sg = list; sg; sg = next) {
- next = sg->next;
- /* Don't translate NULL pointer for last entry */
- if (sg->next)
- sg->next = (struct opal_sg_list *)__pa(sg->next);
- else
- sg->next = NULL;
-
- /* Convert num_entries to length */
- sg->num_entries =
- sg->num_entries * sizeof(struct opal_sg_entry) + 16;
- }
-}
-
static int64_t dump_read_info(uint32_t *id, uint32_t *size, uint32_t *type)
{
int rc;
@@ -314,15 +240,12 @@ static int64_t dump_read_data(struct dump_obj *dump)
}
/* Generate SG list */
- list = dump_data_to_sglist(dump);
+ list = opal_vmalloc_to_sg_list(dump->buffer, dump->size);
if (!list) {
rc = -ENOMEM;
goto out;
}
- /* Translate sg list addr to real address */
- sglist_to_phy_addr(list);
-
/* First entry address */
addr = __pa(list);
@@ -341,7 +264,7 @@ static int64_t dump_read_data(struct dump_obj *dump)
__func__, dump->id);
/* Free SG list */
- free_dump_sg_list(list);
+ opal_free_sg_list(list);
out:
return rc;
diff --git a/arch/powerpc/platforms/powernv/opal-flash.c b/arch/powerpc/platforms/powernv/opal-flash.c
index 714ef97..0ae9e5f 100644
--- a/arch/powerpc/platforms/powernv/opal-flash.c
+++ b/arch/powerpc/platforms/powernv/opal-flash.c
@@ -79,9 +79,6 @@
/* XXX: Assume candidate image size is <= 1GB */
#define MAX_IMAGE_SIZE 0x40000000
-/* Flash sg list version */
-#define SG_LIST_VERSION (1UL)
-
/* Image status */
enum {
IMAGE_INVALID,
@@ -268,93 +265,11 @@ static ssize_t manage_store(struct kobject *kobj,
}
/*
- * Free sg list
- */
-static void free_sg_list(struct opal_sg_list *list)
-{
- struct opal_sg_list *sg1;
- while (list) {
- sg1 = list->next;
- kfree(list);
- list = sg1;
- }
- list = NULL;
-}
-
-/*
- * Build candidate image scatter gather list
- *
- * list format:
- * -----------------------------------
- * | VER (8) | Entry length in bytes |
- * -----------------------------------
- * | Pointer to next entry |
- * -----------------------------------
- * | Address of memory area 1 |
- * -----------------------------------
- * | Length of memory area 1 |
- * -----------------------------------
- * | ......... |
- * -----------------------------------
- * | ......... |
- * -----------------------------------
- * | Address of memory area N |
- * -----------------------------------
- * | Length of memory area N |
- * -----------------------------------
- */
-static struct opal_sg_list *image_data_to_sglist(void)
-{
- struct opal_sg_list *sg1, *list = NULL;
- void *addr;
- int size;
-
- addr = image_data.data;
- size = image_data.size;
-
- sg1 = kzalloc(PAGE_SIZE, GFP_KERNEL);
- if (!sg1)
- return NULL;
-
- list = sg1;
- sg1->num_entries = 0;
- while (size > 0) {
- /* Translate virtual address to physical address */
- sg1->entry[sg1->num_entries].data =
- (void *)(vmalloc_to_pfn(addr) << PAGE_SHIFT);
-
- if (size > PAGE_SIZE)
- sg1->entry[sg1->num_entries].length = PAGE_SIZE;
- else
- sg1->entry[sg1->num_entries].length = size;
-
- sg1->num_entries++;
- if (sg1->num_entries >= SG_ENTRIES_PER_NODE) {
- sg1->next = kzalloc(PAGE_SIZE, GFP_KERNEL);
- if (!sg1->next) {
- pr_err("%s : Failed to allocate memory\n",
- __func__);
- goto nomem;
- }
-
- sg1 = sg1->next;
- sg1->num_entries = 0;
- }
- addr += PAGE_SIZE;
- size -= PAGE_SIZE;
- }
- return list;
-nomem:
- free_sg_list(list);
- return NULL;
-}
-
-/*
* OPAL update flash
*/
static int opal_flash_update(int op)
{
- struct opal_sg_list *sg, *list, *next;
+ struct opal_sg_list *list;
unsigned long addr;
int64_t rc = OPAL_PARAMETER;
@@ -364,30 +279,13 @@ static int opal_flash_update(int op)
goto flash;
}
- list = image_data_to_sglist();
+ list = opal_vmalloc_to_sg_list(image_data.data, image_data.size);
if (!list)
goto invalid_img;
/* First entry address */
addr = __pa(list);
- /* Translate sg list address to absolute */
- for (sg = list; sg; sg = next) {
- next = sg->next;
- /* Don't translate NULL pointer for last entry */
- if (sg->next)
- sg->next = (struct opal_sg_list *)__pa(sg->next);
- else
- sg->next = NULL;
-
- /*
- * Convert num_entries to version/length format
- * to satisfy OPAL.
- */
- sg->num_entries = (SG_LIST_VERSION << 56) |
- (sg->num_entries * sizeof(struct opal_sg_entry) + 16);
- }
-
pr_alert("FLASH: Image is %u bytes\n", image_data.size);
pr_alert("FLASH: Image update requested\n");
pr_alert("FLASH: Image will be updated during system reboot\n");
diff --git a/arch/powerpc/platforms/powernv/opal.c b/arch/powerpc/platforms/powernv/opal.c
index 17cfc70..360ad80c 100644
--- a/arch/powerpc/platforms/powernv/opal.c
+++ b/arch/powerpc/platforms/powernv/opal.c
@@ -638,3 +638,66 @@ void opal_shutdown(void)
/* Export this so that test modules can use it */
EXPORT_SYMBOL_GPL(opal_invalid_call);
+
+/* Convert a region of vmalloc memory to an opal sg list */
+struct opal_sg_list *opal_vmalloc_to_sg_list(void *vmalloc_addr,
+ unsigned long vmalloc_size)
+{
+ struct opal_sg_list *sg, *first = NULL;
+ unsigned long i = 0;
+
+ sg = kzalloc(PAGE_SIZE, GFP_KERNEL);
+ if (!sg)
+ goto nomem;
+
+ first = sg;
+
+ while (vmalloc_size > 0) {
+ uint64_t data = vmalloc_to_pfn(vmalloc_addr) << PAGE_SHIFT;
+ uint64_t length = min(vmalloc_size, PAGE_SIZE);
+
+ sg->entry[i].data = cpu_to_be64(data);
+ sg->entry[i].length = cpu_to_be64(length);
+ i++;
+
+ if (i >= SG_ENTRIES_PER_NODE) {
+ struct opal_sg_list *next;
+
+ next = kzalloc(PAGE_SIZE, GFP_KERNEL);
+ if (!next)
+ goto nomem;
+
+ sg->length = cpu_to_be64(
+ i * sizeof(struct opal_sg_entry) + 16);
+ i = 0;
+ sg->next = cpu_to_be64(__pa(next));
+ sg = next;
+ }
+
+ vmalloc_addr += length;
+ vmalloc_size -= length;
+ }
+
+ sg->length = cpu_to_be64(i * sizeof(struct opal_sg_entry) + 16);
+
+ return first;
+
+nomem:
+ pr_err("%s : Failed to allocate memory\n", __func__);
+ opal_free_sg_list(first);
+ return NULL;
+}
+
+void opal_free_sg_list(struct opal_sg_list *sg)
+{
+ while (sg) {
+ uint64_t next = be64_to_cpu(sg->next);
+
+ kfree(sg);
+
+ if (next)
+ sg = __va(next);
+ else
+ sg = NULL;
+ }
+}
--
1.8.3.2
^ permalink raw reply related
* [PATCH 6/6] powerpc/powernv: Fix little endian issues in OPAL dump code
From: Anton Blanchard @ 2014-04-22 5:01 UTC (permalink / raw)
To: benh, paulus, hegdevasant, stewart; +Cc: linuxppc-dev
In-Reply-To: <1398142887-24109-1-git-send-email-anton@samba.org>
Signed-off-by: Anton Blanchard <anton@samba.org>
---
arch/powerpc/include/asm/opal.h | 4 ++--
arch/powerpc/platforms/powernv/opal-dump.c | 13 +++++++++----
2 files changed, 11 insertions(+), 6 deletions(-)
diff --git a/arch/powerpc/include/asm/opal.h b/arch/powerpc/include/asm/opal.h
index afb0fed..66ad7a7 100644
--- a/arch/powerpc/include/asm/opal.h
+++ b/arch/powerpc/include/asm/opal.h
@@ -868,8 +868,8 @@ int64_t opal_validate_flash(uint64_t buffer, uint32_t *size, uint32_t *result);
int64_t opal_manage_flash(uint8_t op);
int64_t opal_update_flash(uint64_t blk_list);
int64_t opal_dump_init(uint8_t dump_type);
-int64_t opal_dump_info(uint32_t *dump_id, uint32_t *dump_size);
-int64_t opal_dump_info2(uint32_t *dump_id, uint32_t *dump_size, uint32_t *dump_type);
+int64_t opal_dump_info(__be32 *dump_id, __be32 *dump_size);
+int64_t opal_dump_info2(__be32 *dump_id, __be32 *dump_size, __be32 *dump_type);
int64_t opal_dump_read(uint32_t dump_id, uint64_t buffer);
int64_t opal_dump_ack(uint32_t dump_id);
int64_t opal_dump_resend_notification(void);
diff --git a/arch/powerpc/platforms/powernv/opal-dump.c b/arch/powerpc/platforms/powernv/opal-dump.c
index f0b4724..788a197 100644
--- a/arch/powerpc/platforms/powernv/opal-dump.c
+++ b/arch/powerpc/platforms/powernv/opal-dump.c
@@ -209,15 +209,20 @@ static struct kobj_type dump_ktype = {
.default_attrs = dump_default_attrs,
};
-static int64_t dump_read_info(uint32_t *id, uint32_t *size, uint32_t *type)
+static int64_t dump_read_info(uint32_t *dump_id, uint32_t *dump_size, uint32_t *dump_type)
{
+ __be32 id, size, type;
int rc;
- *type = 0xffffffff;
- rc = opal_dump_info2(id, size, type);
+ type = cpu_to_be32(0xffffffff);
+ rc = opal_dump_info2(&id, &size, &type);
if (rc == OPAL_PARAMETER)
- rc = opal_dump_info(id, size);
+ rc = opal_dump_info(&id, &size);
+
+ *dump_id = be32_to_cpu(id);
+ *dump_size = be32_to_cpu(size);
+ *dump_type = be32_to_cpu(type);
if (rc)
pr_warn("%s: Failed to get dump info (%d)\n",
--
1.8.3.2
^ permalink raw reply related
* Re: [PATCH 6/7] powerpc/ftrace: Use module loader helpers to parse trampolines
From: Rusty Russell @ 2014-04-22 6:58 UTC (permalink / raw)
To: Anton Blanchard, benh, paulus, ulrich.weigand, amodra, mikey, mjw,
rostedt, philippe.bergheaud
Cc: linuxppc-dev
In-Reply-To: <1396591750-8203-7-git-send-email-anton@samba.org>
Anton Blanchard <anton@samba.org> writes:
> Now we have is_module_trampoline() and module_trampoline_target()
> we can remove a bunch of intimate kernel module trampoline
> knowledge from ftrace.
>
> Signed-off-by: Anton Blanchard <anton@samba.org>
Oh god, I had no idea this code existed.
I really wanted to implement the R_PPC64_TOCSAVE optimization, and I was
thinking of frobbing the stub code. At least now it's all in one place,
because I would have completely missed this.
Thanks,
Rusty.
^ permalink raw reply
* Re: [PATCH V2 1/2] mm: move FAULT_AROUND_ORDER to arch/
From: Rusty Russell @ 2014-04-22 7:22 UTC (permalink / raw)
To: Dave Hansen, Madhavan Srinivasan, linux-kernel, linuxppc-dev,
linux-mm, linux-arch, x86
Cc: riel, ak, peterz, paulus, mgorman, akpm, mingo, kirill.shutemov
In-Reply-To: <53456B61.1040901@intel.com>
Dave Hansen <dave.hansen@intel.com> writes:
> On 04/08/2014 06:32 PM, Madhavan Srinivasan wrote:
>>> > In mm/Kconfig, put
>>> >
>>> > config FAULT_AROUND_ORDER
>>> > int
>>> > default 1234 if POWERPC
>>> > default 4
>>> >
>>> > The way you have it now, every single architecture that needs to enable
>>> > this has to go put that in their Kconfig. That's madness. This way,
>> I though about it and decided not to do this way because, in future,
>> sub platforms of the architecture may decide to change the values. Also,
>> adding an if line for each architecture with different sub platforms
>> oring to it will look messy.
>
> I'm not sure why I'm trying here any more. You do seem quite content to
> add as much cruft to ppc and every other architecture as possible. If
> your theoretical scenario pops up, you simply do this in ppc:
>
> config ARCH_FAULT_AROUND_ORDER
> int
> default 999
> default 888 if OTHER_SILLY_POWERPC_SUBARCH
>
> But *ONLY* in the architectures that care about doing that stuff. You
> leave every other architecture on the planet alone. Then, in mm/Kconfig:
>
> config FAULT_AROUND_ORDER
> int
> default ARCH_FAULT_AROUND_ORDER if ARCH_FAULT_AROUND_ORDER
> default 4
>
> Your way still requires going and individually touching every single
> architecture's Kconfig that wants to enable fault around. That's not an
> acceptable solution.
Why bother with Kconfig at all? It seems like a weird indirection.
And talking about future tuning seems like a separate issue, if and when
someone does the work. For the moment, let's keep it simple (as below).
If you really want Kconfig, then just go straight from
ARCH_FAULT_AROUND_ORDER, ie:
#ifdef CONFIG_ARCH_FAULT_AROUND_ORDER
#define FAULT_AROUND_ORDER CONFIG_ARCH_FAULT_AROUND_ORDER
#else
#define FAULT_AROUND_ORDER 4
#endif
Then powerpc's Kconfig defines CONFIG_ARCH_FAULT_AROUND_ORDER, and
we're done.
Cheers,
Rusty.
diff --git a/arch/powerpc/include/asm/page.h b/arch/powerpc/include/asm/page.h
index 32e4e212b9c1..b519c5c53cfc 100644
--- a/arch/powerpc/include/asm/page.h
+++ b/arch/powerpc/include/asm/page.h
@@ -412,4 +412,7 @@ typedef struct page *pgtable_t;
#include <asm-generic/memory_model.h>
#endif /* __ASSEMBLY__ */
+/* Measured on a 4 socket Power7 system (128 Threads and 128GB memory) */
+#define FAULT_AROUND_ORDER 3
+
#endif /* _ASM_POWERPC_PAGE_H */
diff --git a/mm/memory.c b/mm/memory.c
index d0f0bef3be48..9aa47e9ec7ba 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -3382,7 +3382,10 @@ void do_set_pte(struct vm_area_struct *vma, unsigned long address,
update_mmu_cache(vma, address, pte);
}
+/* Archs can override, but this seems to work for x86. */
+#ifndef FAULT_AROUND_ORDER
#define FAULT_AROUND_ORDER 4
+#endif
#ifdef CONFIG_DEBUG_FS
static unsigned int fault_around_order = FAULT_AROUND_ORDER;
^ permalink raw reply related
* Re: [PATCH 1/2] powerpc/powernv: clear the refcount for pci_dev on powernv platform
From: Wei Yang @ 2014-04-22 7:44 UTC (permalink / raw)
To: Gavin Shan; +Cc: aik, linuxppc-dev
In-Reply-To: <20140421233423.GA4023@shangw>
On Tue, Apr 22, 2014 at 09:34:23AM +1000, Gavin Shan wrote:
>On Mon, Apr 21, 2014 at 10:25:18AM +0800, Wei Yang wrote:
>>When pcibios_remove_pci_devices() is removing pci devices, it will release
>>pci device respectively. When the refcount of the device is 0, the pci_dev
>>structure will be destroyed.
>>
>>On PowerNV platform, the pci_dev will not be destroyed since the refcount is
>>not 0.
>>
>
>Richard, the above description is true. However, it's not relevant to the
>issue (backtrace). I don't quite understand the scenario you had. You're
>doing hotplug on VFs or PF? I guess it would be full-hotplug instead of
>partial hotplug.
I am doing hotplug on PF.
>
>It seems that the IOMMU group wasn't detached correctly and then we tried
>to attach it again. Or the IOMMU group was attached for towice? :-)
Did more tests and find it is a little out of expectation. The conclusion is:
1. The iommu group is detached correctly,
2. The iommu group is attached three times
3. The warning is cleared based on the first patch instead of this one.
The three times to attach the iommu_group is:
pci_device_add
...
set_iommu_table_base_and_group <- 1st time, fail
device_add
...
tce_iommu_bus_notifier <- 2nd time, succees
pcibios_add_pci_devices
...
pcibios_setup_bus_devices <- 3rd time, re-attach
The error in patch 1 happens at the first time, since the dev->kobj->sd is not
initialized.
The warning in patch 2 happens at the 3rd time, since iommu group is already
attached in the 2nd time.
So this patch(the 2nd one) doesn't contribute to clear the warning and error.
Only the first patch did it. Please ignore this one.
>
>The IOMMU group is expected to be detached like this, please investigate
>for more why it wasn't detached correctly.
>
>pcibios_remove_pci_devices()
>pci_stop_and_remove_bus_device()
>pci_remove_bus_device()
>pci_destroy_dev()
>
>static void pci_destroy_dev(struct pci_dev *dev)
>{
> if (!dev->dev.kobj.parent)
> return;
>
> device_del(&dev->dev); /* It's calling iommu_del_device() */
>
> down_write(&pci_bus_sem);
> list_del(&dev->bus_list);
> up_write(&pci_bus_sem);
>
> pci_free_resources(dev);
> put_device(&dev->dev); /* It's calling pcibios_release_device() */
>}
>
--
Richard Yang
Help you, Help me
^ permalink raw reply
* Re: [PATCH 4/6] powerpc/powernv: Fix little endian issues in OPAL error log code
From: Vasant Hegde @ 2014-04-22 8:10 UTC (permalink / raw)
To: Anton Blanchard, benh, paulus, stewart; +Cc: linuxppc-dev
In-Reply-To: <1398142887-24109-4-git-send-email-anton@samba.org>
On 04/22/2014 10:31 AM, Anton Blanchard wrote:
> Fix little endian issues with the OPAL error log code.
>
> Signed-off-by: Anton Blanchard <anton@samba.org>
> Reviewed-by: Stewart Smith <stewart@linux.vnet.ibm.com>
> ---
> arch/powerpc/include/asm/opal.h | 2 +-
> arch/powerpc/platforms/powernv/opal-elog.c | 9 ++++++++-
> 2 files changed, 9 insertions(+), 2 deletions(-)
>
> diff --git a/arch/powerpc/include/asm/opal.h b/arch/powerpc/include/asm/opal.h
> index cb7d52e..1a752ac 100644
> --- a/arch/powerpc/include/asm/opal.h
> +++ b/arch/powerpc/include/asm/opal.h
> @@ -859,7 +859,7 @@ int64_t opal_lpc_read(uint32_t chip_id, enum OpalLPCAddressType addr_type,
> uint32_t addr, __be32 *data, uint32_t sz);
>
> int64_t opal_read_elog(uint64_t buffer, uint64_t size, uint64_t log_id);
> -int64_t opal_get_elog_size(uint64_t *log_id, uint64_t *size, uint64_t *elog_type);
> +int64_t opal_get_elog_size(__be64 *log_id, __be64 *size, __be64 *elog_type);
> int64_t opal_write_elog(uint64_t buffer, uint64_t size, uint64_t offset);
> int64_t opal_send_ack_elog(uint64_t log_id);
> void opal_resend_pending_logs(void);
> diff --git a/arch/powerpc/platforms/powernv/opal-elog.c b/arch/powerpc/platforms/powernv/opal-elog.c
> index 7e3821e..10268c4 100644
> --- a/arch/powerpc/platforms/powernv/opal-elog.c
> +++ b/arch/powerpc/platforms/powernv/opal-elog.c
> @@ -238,18 +238,25 @@ static struct elog_obj *create_elog_obj(uint64_t id, size_t size, uint64_t type)
>
> static void elog_work_fn(struct work_struct *work)
> {
> + __be64 size;
> + __be64 id;
> + __be64 type;
> uint64_t elog_size;
> uint64_t log_id;
> uint64_t elog_type;
> int rc;
> char name[2+16+1];
>
> - rc = opal_get_elog_size(&log_id, &elog_size, &elog_type);
> + rc = opal_get_elog_size(&id, &size, &type);
> if (rc != OPAL_SUCCESS) {
> pr_err("ELOG: Opal log read failed\n");
> return;
> }
>
> + elog_size = be64_to_cpu(size);
> + log_id = be64_to_cpu(id);
Anton,
Shouldn't we covert Log ID back to BE format in ACK function (elog_ack_store() ) ?
Rest looks good.
-Vasant
> + elog_type = be64_to_cpu(type);
> +
> BUG_ON(elog_size > OPAL_MAX_ERRLOG_SIZE);
>
> if (elog_size >= OPAL_MAX_ERRLOG_SIZE)
>
^ permalink raw reply
* Re: [PATCH 1/2] powerpc/powernv: clear the refcount for pci_dev on powernv platform
From: Benjamin Herrenschmidt @ 2014-04-22 8:25 UTC (permalink / raw)
To: Wei Yang; +Cc: aik, linuxppc-dev, Gavin Shan
In-Reply-To: <20140422074437.GB6431@richard>
On Tue, 2014-04-22 at 15:44 +0800, Wei Yang wrote:
> So this patch(the 2nd one) doesn't contribute to clear the warning and
> error.
> Only the first patch did it. Please ignore this one.
But is it correct ? It's not right to keep a refcount elevated if we
don't have to.
Gavin, can you get to the bottom of that refcount business ?
Cheers,
Ben.
^ permalink raw reply
* Re: [PATCH 6/6] powerpc/powernv: Fix little endian issues in OPAL dump code
From: Vasant Hegde @ 2014-04-22 8:32 UTC (permalink / raw)
To: Anton Blanchard, benh, paulus, stewart; +Cc: linuxppc-dev
In-Reply-To: <1398142887-24109-6-git-send-email-anton@samba.org>
On 04/22/2014 10:31 AM, Anton Blanchard wrote:
> Signed-off-by: Anton Blanchard <anton@samba.org>
> ---
> arch/powerpc/include/asm/opal.h | 4 ++--
> arch/powerpc/platforms/powernv/opal-dump.c | 13 +++++++++----
> 2 files changed, 11 insertions(+), 6 deletions(-)
>
> diff --git a/arch/powerpc/include/asm/opal.h b/arch/powerpc/include/asm/opal.h
> index afb0fed..66ad7a7 100644
> --- a/arch/powerpc/include/asm/opal.h
> +++ b/arch/powerpc/include/asm/opal.h
> @@ -868,8 +868,8 @@ int64_t opal_validate_flash(uint64_t buffer, uint32_t *size, uint32_t *result);
> int64_t opal_manage_flash(uint8_t op);
> int64_t opal_update_flash(uint64_t blk_list);
> int64_t opal_dump_init(uint8_t dump_type);
> -int64_t opal_dump_info(uint32_t *dump_id, uint32_t *dump_size);
> -int64_t opal_dump_info2(uint32_t *dump_id, uint32_t *dump_size, uint32_t *dump_type);
> +int64_t opal_dump_info(__be32 *dump_id, __be32 *dump_size);
> +int64_t opal_dump_info2(__be32 *dump_id, __be32 *dump_size, __be32 *dump_type);
> int64_t opal_dump_read(uint32_t dump_id, uint64_t buffer);
> int64_t opal_dump_ack(uint32_t dump_id);
Shouldn't we change above two functions as well ?
> int64_t opal_dump_resend_notification(void);
> diff --git a/arch/powerpc/platforms/powernv/opal-dump.c b/arch/powerpc/platforms/powernv/opal-dump.c
> index f0b4724..788a197 100644
> --- a/arch/powerpc/platforms/powernv/opal-dump.c
> +++ b/arch/powerpc/platforms/powernv/opal-dump.c
> @@ -209,15 +209,20 @@ static struct kobj_type dump_ktype = {
> .default_attrs = dump_default_attrs,
> };
>
> -static int64_t dump_read_info(uint32_t *id, uint32_t *size, uint32_t *type)
> +static int64_t dump_read_info(uint32_t *dump_id, uint32_t *dump_size, uint32_t *dump_type)
> {
> + __be32 id, size, type;
> int rc;
> - *type = 0xffffffff;
>
> - rc = opal_dump_info2(id, size, type);
> + type = cpu_to_be32(0xffffffff);
>
> + rc = opal_dump_info2(&id, &size, &type);
> if (rc == OPAL_PARAMETER)
> - rc = opal_dump_info(id, size);
> + rc = opal_dump_info(&id, &size);
> +
> + *dump_id = be32_to_cpu(id);
> + *dump_size = be32_to_cpu(size);
> + *dump_type = be32_to_cpu(type);
>
Should we convert ID back to BE format in dump_send_ack() ?
-Vasant
> if (rc)
> pr_warn("%s: Failed to get dump info (%d)\n",
>
^ permalink raw reply
* Re: [PATCH 5/6] powerpc/powernv: Create OPAL sglist helper functions and fix endian issues
From: Vasant Hegde @ 2014-04-22 9:16 UTC (permalink / raw)
To: Anton Blanchard, benh, paulus, stewart; +Cc: linuxppc-dev
In-Reply-To: <1398142887-24109-5-git-send-email-anton@samba.org>
On 04/22/2014 10:31 AM, Anton Blanchard wrote:
> We have two copies of code that creates an OPAL sg list. Consolidate
> these into a common set of helpers and fix the endian issues.
>
> The flash interface embedded a version number in the num_entries
> field, whereas the dump interface did did not. Since versioning
> wasn't added to the flash interface and it is impossible to add
> this in a backwards compatible way, just remove it.
>
> Signed-off-by: Anton Blanchard <anton@samba.org>
> ---
> arch/powerpc/include/asm/opal.h | 14 ++--
> arch/powerpc/platforms/powernv/opal-dump.c | 81 +--------------------
> arch/powerpc/platforms/powernv/opal-flash.c | 106 +---------------------------
> arch/powerpc/platforms/powernv/opal.c | 63 +++++++++++++++++
> 4 files changed, 76 insertions(+), 188 deletions(-)
>
> diff --git a/arch/powerpc/include/asm/opal.h b/arch/powerpc/include/asm/opal.h
> index 1a752ac..afb0fed 100644
> --- a/arch/powerpc/include/asm/opal.h
> +++ b/arch/powerpc/include/asm/opal.h
> @@ -41,14 +41,14 @@ struct opal_takeover_args {
> * size except the last one in the list to be as well.
> */
> struct opal_sg_entry {
> - void *data;
> - long length;
> + __be64 data;
> + __be64 length;
> };
>
> -/* sg list */
> +/* SG list */
> struct opal_sg_list {
> - unsigned long num_entries;
> - struct opal_sg_list *next;
> + __be64 length;
> + __be64 next;
> struct opal_sg_entry entry[];
> };
>
> @@ -929,6 +929,10 @@ extern int opal_resync_timebase(void);
>
> extern void opal_lpc_init(void);
>
> +struct opal_sg_list *opal_vmalloc_to_sg_list(void *vmalloc_addr,
> + unsigned long vmalloc_size);
> +void opal_free_sg_list(struct opal_sg_list *sg);
> +
> #endif /* __ASSEMBLY__ */
>
> #endif /* __OPAL_H */
> diff --git a/arch/powerpc/platforms/powernv/opal-dump.c b/arch/powerpc/platforms/powernv/opal-dump.c
> index b9827b0..f0b4724 100644
> --- a/arch/powerpc/platforms/powernv/opal-dump.c
> +++ b/arch/powerpc/platforms/powernv/opal-dump.c
> @@ -209,80 +209,6 @@ static struct kobj_type dump_ktype = {
> .default_attrs = dump_default_attrs,
> };
>
> -static void free_dump_sg_list(struct opal_sg_list *list)
> -{
> - struct opal_sg_list *sg1;
> - while (list) {
> - sg1 = list->next;
> - kfree(list);
> - list = sg1;
> - }
> - list = NULL;
> -}
> -
> -static struct opal_sg_list *dump_data_to_sglist(struct dump_obj *dump)
> -{
> - struct opal_sg_list *sg1, *list = NULL;
> - void *addr;
> - int64_t size;
> -
> - addr = dump->buffer;
> - size = dump->size;
> -
> - sg1 = kzalloc(PAGE_SIZE, GFP_KERNEL);
> - if (!sg1)
> - goto nomem;
> -
> - list = sg1;
> - sg1->num_entries = 0;
> - while (size > 0) {
> - /* Translate virtual address to physical address */
> - sg1->entry[sg1->num_entries].data =
> - (void *)(vmalloc_to_pfn(addr) << PAGE_SHIFT);
> -
> - if (size > PAGE_SIZE)
> - sg1->entry[sg1->num_entries].length = PAGE_SIZE;
> - else
> - sg1->entry[sg1->num_entries].length = size;
> -
> - sg1->num_entries++;
> - if (sg1->num_entries >= SG_ENTRIES_PER_NODE) {
> - sg1->next = kzalloc(PAGE_SIZE, GFP_KERNEL);
> - if (!sg1->next)
> - goto nomem;
> -
> - sg1 = sg1->next;
> - sg1->num_entries = 0;
> - }
> - addr += PAGE_SIZE;
> - size -= PAGE_SIZE;
> - }
> - return list;
> -
> -nomem:
> - pr_err("%s : Failed to allocate memory\n", __func__);
> - free_dump_sg_list(list);
> - return NULL;
> -}
> -
> -static void sglist_to_phy_addr(struct opal_sg_list *list)
> -{
> - struct opal_sg_list *sg, *next;
> -
> - for (sg = list; sg; sg = next) {
> - next = sg->next;
> - /* Don't translate NULL pointer for last entry */
> - if (sg->next)
> - sg->next = (struct opal_sg_list *)__pa(sg->next);
> - else
> - sg->next = NULL;
> -
> - /* Convert num_entries to length */
> - sg->num_entries =
> - sg->num_entries * sizeof(struct opal_sg_entry) + 16;
> - }
> -}
> -
> static int64_t dump_read_info(uint32_t *id, uint32_t *size, uint32_t *type)
> {
> int rc;
> @@ -314,15 +240,12 @@ static int64_t dump_read_data(struct dump_obj *dump)
> }
>
> /* Generate SG list */
> - list = dump_data_to_sglist(dump);
> + list = opal_vmalloc_to_sg_list(dump->buffer, dump->size);
> if (!list) {
> rc = -ENOMEM;
> goto out;
> }
>
> - /* Translate sg list addr to real address */
> - sglist_to_phy_addr(list);
> -
> /* First entry address */
> addr = __pa(list);
>
> @@ -341,7 +264,7 @@ static int64_t dump_read_data(struct dump_obj *dump)
> __func__, dump->id);
>
Shouldn't we convert addr and id before passing to opal_dump_read() here ?
> /* Free SG list */
> - free_dump_sg_list(list);
> + opal_free_sg_list(list);
>
> out:
> return rc;
> diff --git a/arch/powerpc/platforms/powernv/opal-flash.c b/arch/powerpc/platforms/powernv/opal-flash.c
> index 714ef97..0ae9e5f 100644
> --- a/arch/powerpc/platforms/powernv/opal-flash.c
> +++ b/arch/powerpc/platforms/powernv/opal-flash.c
> @@ -79,9 +79,6 @@
> /* XXX: Assume candidate image size is <= 1GB */
> #define MAX_IMAGE_SIZE 0x40000000
>
> -/* Flash sg list version */
> -#define SG_LIST_VERSION (1UL)
> -
> /* Image status */
> enum {
> IMAGE_INVALID,
> @@ -268,93 +265,11 @@ static ssize_t manage_store(struct kobject *kobj,
> }
>
> /*
> - * Free sg list
> - */
> -static void free_sg_list(struct opal_sg_list *list)
> -{
> - struct opal_sg_list *sg1;
> - while (list) {
> - sg1 = list->next;
> - kfree(list);
> - list = sg1;
> - }
> - list = NULL;
> -}
> -
> -/*
> - * Build candidate image scatter gather list
> - *
> - * list format:
> - * -----------------------------------
> - * | VER (8) | Entry length in bytes |
> - * -----------------------------------
> - * | Pointer to next entry |
> - * -----------------------------------
> - * | Address of memory area 1 |
> - * -----------------------------------
> - * | Length of memory area 1 |
> - * -----------------------------------
> - * | ......... |
> - * -----------------------------------
> - * | ......... |
> - * -----------------------------------
> - * | Address of memory area N |
> - * -----------------------------------
> - * | Length of memory area N |
> - * -----------------------------------
> - */
> -static struct opal_sg_list *image_data_to_sglist(void)
> -{
> - struct opal_sg_list *sg1, *list = NULL;
> - void *addr;
> - int size;
> -
> - addr = image_data.data;
> - size = image_data.size;
> -
> - sg1 = kzalloc(PAGE_SIZE, GFP_KERNEL);
> - if (!sg1)
> - return NULL;
> -
> - list = sg1;
> - sg1->num_entries = 0;
> - while (size > 0) {
> - /* Translate virtual address to physical address */
> - sg1->entry[sg1->num_entries].data =
> - (void *)(vmalloc_to_pfn(addr) << PAGE_SHIFT);
> -
> - if (size > PAGE_SIZE)
> - sg1->entry[sg1->num_entries].length = PAGE_SIZE;
> - else
> - sg1->entry[sg1->num_entries].length = size;
> -
> - sg1->num_entries++;
> - if (sg1->num_entries >= SG_ENTRIES_PER_NODE) {
> - sg1->next = kzalloc(PAGE_SIZE, GFP_KERNEL);
> - if (!sg1->next) {
> - pr_err("%s : Failed to allocate memory\n",
> - __func__);
> - goto nomem;
> - }
> -
> - sg1 = sg1->next;
> - sg1->num_entries = 0;
> - }
> - addr += PAGE_SIZE;
> - size -= PAGE_SIZE;
> - }
> - return list;
> -nomem:
> - free_sg_list(list);
> - return NULL;
> -}
> -
> -/*
> * OPAL update flash
> */
> static int opal_flash_update(int op)
> {
> - struct opal_sg_list *sg, *list, *next;
> + struct opal_sg_list *list;
> unsigned long addr;
> int64_t rc = OPAL_PARAMETER;
>
> @@ -364,30 +279,13 @@ static int opal_flash_update(int op)
> goto flash;
> }
>
> - list = image_data_to_sglist();
> + list = opal_vmalloc_to_sg_list(image_data.data, image_data.size);
> if (!list)
> goto invalid_img;
>
> /* First entry address */
> addr = __pa(list);
>
> - /* Translate sg list address to absolute */
> - for (sg = list; sg; sg = next) {
> - next = sg->next;
> - /* Don't translate NULL pointer for last entry */
> - if (sg->next)
> - sg->next = (struct opal_sg_list *)__pa(sg->next);
> - else
> - sg->next = NULL;
> -
> - /*
> - * Convert num_entries to version/length format
> - * to satisfy OPAL.
> - */
> - sg->num_entries = (SG_LIST_VERSION << 56) |
> - (sg->num_entries * sizeof(struct opal_sg_entry) + 16);
> - }
> -
> pr_alert("FLASH: Image is %u bytes\n", image_data.size);
> pr_alert("FLASH: Image update requested\n");
> pr_alert("FLASH: Image will be updated during system reboot\n");
> diff --git a/arch/powerpc/platforms/powernv/opal.c b/arch/powerpc/platforms/powernv/opal.c
> index 17cfc70..360ad80c 100644
> --- a/arch/powerpc/platforms/powernv/opal.c
> +++ b/arch/powerpc/platforms/powernv/opal.c
> @@ -638,3 +638,66 @@ void opal_shutdown(void)
>
> /* Export this so that test modules can use it */
> EXPORT_SYMBOL_GPL(opal_invalid_call);
> +
> +/* Convert a region of vmalloc memory to an opal sg list */
> +struct opal_sg_list *opal_vmalloc_to_sg_list(void *vmalloc_addr,
> + unsigned long vmalloc_size)
> +{
> + struct opal_sg_list *sg, *first = NULL;
> + unsigned long i = 0;
> +
> + sg = kzalloc(PAGE_SIZE, GFP_KERNEL);
> + if (!sg)
> + goto nomem;
> +
> + first = sg;
> +
> + while (vmalloc_size > 0) {
> + uint64_t data = vmalloc_to_pfn(vmalloc_addr) << PAGE_SHIFT;
> + uint64_t length = min(vmalloc_size, PAGE_SIZE);
> +
> + sg->entry[i].data = cpu_to_be64(data);
> + sg->entry[i].length = cpu_to_be64(length);
> + i++;
> +
> + if (i >= SG_ENTRIES_PER_NODE) {
> + struct opal_sg_list *next;
> +
> + next = kzalloc(PAGE_SIZE, GFP_KERNEL);
> + if (!next)
> + goto nomem;
> +
> + sg->length = cpu_to_be64(
> + i * sizeof(struct opal_sg_entry) + 16);
> + i = 0;
> + sg->next = cpu_to_be64(__pa(next));
> + sg = next;
> + }
> +
> + vmalloc_addr += length;
> + vmalloc_size -= length;
> + }
> +
> + sg->length = cpu_to_be64(i * sizeof(struct opal_sg_entry) + 16);
> +
> + return first;
> +
> +nomem:
> + pr_err("%s : Failed to allocate memory\n", __func__);
> + opal_free_sg_list(first);
> + return NULL;
> +}
> +
> +void opal_free_sg_list(struct opal_sg_list *sg)
> +{
> + while (sg) {
> + uint64_t next = be64_to_cpu(sg->next);
> +
> + kfree(sg);
> +
> + if (next)
> + sg = __va(next);
This for this fix..
-Vasant
> + else
> + sg = NULL;
> + }
> +}
>
^ permalink raw reply
* [PATCH v4 2/3] devcietree: bindings: add some MFD Keymile FPGAs
From: Valentin Longchamp @ 2014-04-22 9:30 UTC (permalink / raw)
To: Scott Wood, linuxppc-dev; +Cc: devicetree, Valentin Longchamp
In-Reply-To: <1398159031-10110-1-git-send-email-valentin.longchamp@keymile.com>
These are the bindings for 2 MFD devices used on some of the Keymile boards.
The first one is the chassis managmenet bfticu FPGA.
The second one is the board controller (reset, LEDs, GPIOs) QRIO CPDL.
These FPGAs are used in the kmcoge4 board.
Signed-off-by: Valentin Longchamp <valentin.longchamp@keymile.com>
---
Changes in v4:
- remove the addition of the KEYMILE vendor-prefix as it is already
picked by Rob
- Take Scott's and Rob's comments regarding the bindings for the
interrupt-cells into account
Changes in v3:
- add a patch with the bindings for the KEYMILE FPGAs
Changes in v2: None
Documentation/devicetree/bindings/mfd/bfticu.txt | 25 ++++++++++++++++++++++++
Documentation/devicetree/bindings/mfd/qriox.txt | 17 ++++++++++++++++
2 files changed, 42 insertions(+)
create mode 100644 Documentation/devicetree/bindings/mfd/bfticu.txt
create mode 100644 Documentation/devicetree/bindings/mfd/qriox.txt
diff --git a/Documentation/devicetree/bindings/mfd/bfticu.txt b/Documentation/devicetree/bindings/mfd/bfticu.txt
new file mode 100644
index 0000000..65c9077
--- /dev/null
+++ b/Documentation/devicetree/bindings/mfd/bfticu.txt
@@ -0,0 +1,25 @@
+KEYMILE bfticu Chassis Management FPGA
+
+The bfticu is a multifunction device that manages the whole chassis.
+Its main functionality is to collect IRQs from the whole chassis and signals
+them to a single controller.
+
+Required properties:
+- compatible: "keymile,bfticu"
+- interrupt-controller: the bfticu FPGA is an interrupt controller
+- interrupts: the main IRQ line to signal the collected IRQs
+- #interrupt-cells : is 2 and their usage is compliant to the 2 cells variant
+ of Documentation/devicetree/bindings/interrupt-controller/interrupts.txt
+- interrupt-parent: the parent IRQ ctrl the main IRQ is connected to
+- reg: access on the parent local bus (chip select, offset in chip select, size)
+
+Example:
+
+ chassis-mgmt@3,0 {
+ compatible = "keymile,bfticu";
+ interrupt-controller;
+ #interrupt-cells = <2>;
+ reg = <3 0 0x100>;
+ interrupt-parent = <&mpic>;
+ interrupts = <6 1 0 0>;
+ };
diff --git a/Documentation/devicetree/bindings/mfd/qriox.txt b/Documentation/devicetree/bindings/mfd/qriox.txt
new file mode 100644
index 0000000..f301e2d
--- /dev/null
+++ b/Documentation/devicetree/bindings/mfd/qriox.txt
@@ -0,0 +1,17 @@
+KEYMILE qrio Board Control CPLD
+
+The qrio is a multifunction device that controls the KEYMILE boards based on
+the kmp204x design.
+It is consists of a reset controller, watchdog timer, LEDs, and 2 IRQ capable
+GPIO blocks.
+
+Required properties:
+- compatible: "keymile,qriox"
+- reg: access on the parent local bus (chip select, offset in chip select, size)
+
+Example:
+
+ board-control@1,0 {
+ compatible = "keymile,qriox";
+ reg = <1 0 0x80>;
+ };
--
1.8.0.1
^ permalink raw reply related
* [PATCH v4 1/3] devicetree: bindings: add Zarlink to the vendor prefixes
From: Valentin Longchamp @ 2014-04-22 9:30 UTC (permalink / raw)
To: Scott Wood, linuxppc-dev; +Cc: devicetree, Valentin Longchamp
In-Reply-To: <1398159031-10110-1-git-send-email-valentin.longchamp@keymile.com>
Even though the company belongs to Microsemi, many chips are still
labeled as Zarlink. Among them is the family of network clock generators,
the zl3034x.
Signed-off-by: Valentin Longchamp <valentin.longchamp@keymile.com>
---
Changes in v4: None
Changes in v3: None
Changes in v2:
- add a patch so that the Zarlink vendor prefix is defined
Documentation/devicetree/bindings/vendor-prefixes.txt | 1 +
1 file changed, 1 insertion(+)
diff --git a/Documentation/devicetree/bindings/vendor-prefixes.txt b/Documentation/devicetree/bindings/vendor-prefixes.txt
index 0f01c9b..93cc7dc 100644
--- a/Documentation/devicetree/bindings/vendor-prefixes.txt
+++ b/Documentation/devicetree/bindings/vendor-prefixes.txt
@@ -119,3 +119,4 @@ wlf Wolfson Microelectronics
wm Wondermedia Technologies, Inc.
xes Extreme Engineering Solutions (X-ES)
xlnx Xilinx
+zarlink Zarlink Semiconductor
--
1.8.0.1
^ permalink raw reply related
* [PATCH v4 0/3] Support of the kmcoge4 board
From: Valentin Longchamp @ 2014-04-22 9:30 UTC (permalink / raw)
To: Scott Wood, linuxppc-dev; +Cc: devicetree, Valentin Longchamp
This series adds support for Keymile's COGE4 board, called kmcoge4. This
board is the reference design for further designs at Keymile around the
P2040/P2041 SoCs from Freescale. This reference design is internally
called kmp204x.
Changes in v4:
- remove the addition of the KEYMILE vendor-prefix as it is already
picked by Rob
- Take Scott's and Rob's comments regarding the bindings for the
interrupt-cells into account
- remove the partition layout for the NAND Flash as well as it was
forgotten
- Rebased on top of v3.15-rc1
Changes in v3:
- add a patch with the bindings for the KEYMILE FPGAs
- add the compatible strings for the localbus nodes
- remove the IRQ part of the board-control node as it is currently being
reworked
Changes in v2:
- add a patch so that the Zarlink vendor prefix is defined
- add some nodes on the localbus CS when possible
- only use the corenet_generic machine and add kmcoge4 to the supported
boards instead of defining a new kmp204x machine
- set better and more precise device nodes for the spi devices
- remove the partion layout for the spi_flash@0
Valentin Longchamp (3):
devicetree: bindings: add Zarlink to the vendor prefixes
devcietree: bindings: add some MFD Keymile FPGAs
powerpc/mpc85xx: add support for Keymile's kmcoge4 board
Documentation/devicetree/bindings/mfd/bfticu.txt | 25 +++
Documentation/devicetree/bindings/mfd/qriox.txt | 17 ++
.../devicetree/bindings/vendor-prefixes.txt | 1 +
arch/powerpc/boot/dts/kmcoge4.dts | 152 ++++++++++++++
arch/powerpc/configs/85xx/kmp204x_defconfig | 225 +++++++++++++++++++++
arch/powerpc/platforms/85xx/Kconfig | 2 +-
arch/powerpc/platforms/85xx/corenet_generic.c | 3 +-
7 files changed, 423 insertions(+), 2 deletions(-)
create mode 100644 Documentation/devicetree/bindings/mfd/bfticu.txt
create mode 100644 Documentation/devicetree/bindings/mfd/qriox.txt
create mode 100644 arch/powerpc/boot/dts/kmcoge4.dts
create mode 100644 arch/powerpc/configs/85xx/kmp204x_defconfig
--
1.8.0.1
^ permalink raw reply
* [PATCH v4 3/3] powerpc/mpc85xx: add support for Keymile's kmcoge4 board
From: Valentin Longchamp @ 2014-04-22 9:30 UTC (permalink / raw)
To: Scott Wood, linuxppc-dev; +Cc: devicetree, Valentin Longchamp
In-Reply-To: <1398159031-10110-1-git-send-email-valentin.longchamp@keymile.com>
This patch introduces the support for Keymile's kmcoge4 board which is
the internal reference design for boards based on Freescale's
P2040/P2041 SoCs. This internal reference design is named kmp204x.
The peripherals used on this board are:
- SPI NOR Flash as bootloader medium
- NAND Flash with a ubi partition
- 2 PCIe busses (hosts 1 and 3)
- 3 FMAN Ethernet devices (FMAN1 DTSEC1/2/5)
- 4 Local Bus windows, with one dedicated to the QRIO reset/power mgmt
CPLD
- 2 I2C busses
- last but not least, the mandatory serial port
The patch also adds a defconfig file for this reference design that is
necessary because of the lowmem option that must be set higher due to
the number of PCIe devices with big ioremapped mem ranges on the boad.
Signed-off-by: Valentin Longchamp <valentin.longchamp@keymile.com>
---
Changes in v4:
- remove the partition layout for the NAND Flash as well as it was
forgotten
- Rebased on top of v3.15-rc1
Changes in v3:
- add the compatible strings for the localbus nodes
- remove the IRQ part of the board-control node as it is currently being
reworked
Changes in v2:
- add some nodes on the localbus CS when possible
- only use the corenet_generic machine and add kmcoge4 to the supported
boards instead of defining a new kmp204x machine
- set better and more precise device nodes for the spi devices
- remove the partion layout for the spi_flash@0
arch/powerpc/boot/dts/kmcoge4.dts | 152 +++++++++++++++++
arch/powerpc/configs/85xx/kmp204x_defconfig | 225 ++++++++++++++++++++++++++
arch/powerpc/platforms/85xx/Kconfig | 2 +-
arch/powerpc/platforms/85xx/corenet_generic.c | 3 +-
4 files changed, 380 insertions(+), 2 deletions(-)
create mode 100644 arch/powerpc/boot/dts/kmcoge4.dts
create mode 100644 arch/powerpc/configs/85xx/kmp204x_defconfig
diff --git a/arch/powerpc/boot/dts/kmcoge4.dts b/arch/powerpc/boot/dts/kmcoge4.dts
new file mode 100644
index 0000000..89b4119
--- /dev/null
+++ b/arch/powerpc/boot/dts/kmcoge4.dts
@@ -0,0 +1,152 @@
+/*
+ * Keymile kmcoge4 Device Tree Source, based on the P2041RDB DTS
+ *
+ * (C) Copyright 2014
+ * Valentin Longchamp, Keymile AG, valentin.longchamp@keymile.com
+ *
+ * Copyright 2011 Freescale Semiconductor Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ */
+
+/include/ "fsl/p2041si-pre.dtsi"
+
+/ {
+ model = "keymile,kmcoge4";
+ compatible = "keymile,kmcoge4", "keymile,kmp204x";
+ #address-cells = <2>;
+ #size-cells = <2>;
+ interrupt-parent = <&mpic>;
+
+ memory {
+ device_type = "memory";
+ };
+
+ dcsr: dcsr@f00000000 {
+ ranges = <0x00000000 0xf 0x00000000 0x01008000>;
+ };
+
+ soc: soc@ffe000000 {
+ ranges = <0x00000000 0xf 0xfe000000 0x1000000>;
+ reg = <0xf 0xfe000000 0 0x00001000>;
+ spi@110000 {
+ flash@0 {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ compatible = "spansion,s25fl256s1";
+ reg = <0>;
+ spi-max-frequency = <20000000>; /* input clock */
+ };
+
+ network_clock@1 {
+ compatible = "zarlink,zl30343";
+ reg = <1>;
+ spi-max-frequency = <8000000>;
+ };
+
+ flash@2 {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ compatible = "micron,m25p32";
+ reg = <2>;
+ spi-max-frequency = <15000000>;
+ };
+ };
+
+ i2c@119000 {
+ status = "disabled";
+ };
+
+ i2c@119100 {
+ status = "disabled";
+ };
+
+ usb0: usb@210000 {
+ status = "disabled";
+ };
+
+ usb1: usb@211000 {
+ status = "disabled";
+ };
+
+ sata@220000 {
+ status = "disabled";
+ };
+
+ sata@221000 {
+ status = "disabled";
+ };
+ };
+
+ rio: rapidio@ffe0c0000 {
+ status = "disabled";
+ };
+
+ lbc: localbus@ffe124000 {
+ reg = <0xf 0xfe124000 0 0x1000>;
+ ranges = <0 0 0xf 0xffa00000 0x00040000 /* LB 0 */
+ 1 0 0xf 0xfb000000 0x00010000 /* LB 1 */
+ 2 0 0xf 0xd0000000 0x10000000 /* LB 2 */
+ 3 0 0xf 0xe0000000 0x10000000>; /* LB 3 */
+
+ nand@0,0 {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ compatible = "fsl,elbc-fcm-nand";
+ reg = <0 0 0x40000>;
+ };
+
+ board-control@1,0 {
+ compatible = "keymile,qriox";
+ reg = <1 0 0x80>;
+ };
+
+ chassis-mgmt@3,0 {
+ compatible = "keymile,bfticu";
+ interrupt-controller;
+ #interrupt-cells = <2>;
+ reg = <3 0 0x100>;
+ interrupt-parent = <&mpic>;
+ interrupts = <6 1 0 0>;
+ };
+ };
+
+ pci0: pcie@ffe200000 {
+ reg = <0xf 0xfe200000 0 0x1000>;
+ ranges = <0x02000000 0 0xe0000000 0xc 0x00000000 0x0 0x20000000
+ 0x01000000 0 0x00000000 0xf 0xf8000000 0x0 0x00010000>;
+ pcie@0 {
+ ranges = <0x02000000 0 0xe0000000
+ 0x02000000 0 0xe0000000
+ 0 0x20000000
+
+ 0x01000000 0 0x00000000
+ 0x01000000 0 0x00000000
+ 0 0x00010000>;
+ };
+ };
+
+ pci1: pcie@ffe201000 {
+ status = "disabled";
+ };
+
+ pci2: pcie@ffe202000 {
+ reg = <0xf 0xfe202000 0 0x1000>;
+ ranges = <0x02000000 0 0xe0000000 0xc 0x20000000 0 0x20000000
+ 0x01000000 0 0x00000000 0xf 0xf8010000 0 0x00010000>;
+ pcie@0 {
+ ranges = <0x02000000 0 0xe0000000
+ 0x02000000 0 0xe0000000
+ 0 0x20000000
+
+ 0x01000000 0 0x00000000
+ 0x01000000 0 0x00000000
+ 0 0x00010000>;
+ };
+ };
+};
+
+/include/ "fsl/p2041si-post.dtsi"
diff --git a/arch/powerpc/configs/85xx/kmp204x_defconfig b/arch/powerpc/configs/85xx/kmp204x_defconfig
new file mode 100644
index 0000000..e9a81e5
--- /dev/null
+++ b/arch/powerpc/configs/85xx/kmp204x_defconfig
@@ -0,0 +1,225 @@
+CONFIG_PPC_85xx=y
+CONFIG_SMP=y
+CONFIG_NR_CPUS=8
+CONFIG_SYSVIPC=y
+CONFIG_POSIX_MQUEUE=y
+CONFIG_AUDIT=y
+CONFIG_NO_HZ=y
+CONFIG_HIGH_RES_TIMERS=y
+CONFIG_BSD_PROCESS_ACCT=y
+CONFIG_IKCONFIG=y
+CONFIG_IKCONFIG_PROC=y
+CONFIG_LOG_BUF_SHIFT=14
+CONFIG_CGROUPS=y
+CONFIG_CGROUP_SCHED=y
+CONFIG_RELAY=y
+CONFIG_BLK_DEV_INITRD=y
+CONFIG_KALLSYMS_ALL=y
+CONFIG_EMBEDDED=y
+CONFIG_PERF_EVENTS=y
+CONFIG_SLAB=y
+CONFIG_MODULES=y
+CONFIG_MODULE_UNLOAD=y
+CONFIG_MODULE_FORCE_UNLOAD=y
+CONFIG_MODVERSIONS=y
+# CONFIG_BLK_DEV_BSG is not set
+CONFIG_PARTITION_ADVANCED=y
+CONFIG_MAC_PARTITION=y
+CONFIG_CORENET_GENERIC=y
+CONFIG_MPIC_MSGR=y
+CONFIG_HIGHMEM=y
+# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
+CONFIG_BINFMT_MISC=m
+CONFIG_KEXEC=y
+CONFIG_FORCE_MAX_ZONEORDER=13
+CONFIG_PCI=y
+CONFIG_PCIEPORTBUS=y
+# CONFIG_PCIEASPM is not set
+CONFIG_PCI_MSI=y
+CONFIG_ADVANCED_OPTIONS=y
+CONFIG_LOWMEM_SIZE_BOOL=y
+CONFIG_LOWMEM_SIZE=0x20000000
+CONFIG_NET=y
+CONFIG_PACKET=y
+CONFIG_UNIX=y
+CONFIG_XFRM_USER=y
+CONFIG_XFRM_SUB_POLICY=y
+CONFIG_XFRM_STATISTICS=y
+CONFIG_NET_KEY=y
+CONFIG_NET_KEY_MIGRATE=y
+CONFIG_INET=y
+CONFIG_IP_MULTICAST=y
+CONFIG_IP_ADVANCED_ROUTER=y
+CONFIG_IP_MULTIPLE_TABLES=y
+CONFIG_IP_ROUTE_MULTIPATH=y
+CONFIG_IP_ROUTE_VERBOSE=y
+CONFIG_IP_PNP=y
+CONFIG_IP_PNP_DHCP=y
+CONFIG_IP_PNP_BOOTP=y
+CONFIG_IP_PNP_RARP=y
+CONFIG_NET_IPIP=y
+CONFIG_IP_MROUTE=y
+CONFIG_IP_PIMSM_V1=y
+CONFIG_IP_PIMSM_V2=y
+CONFIG_INET_AH=y
+CONFIG_INET_ESP=y
+CONFIG_INET_IPCOMP=y
+# CONFIG_INET_LRO is not set
+CONFIG_IPV6=y
+CONFIG_IP_SCTP=m
+CONFIG_TIPC=y
+CONFIG_NET_SCHED=y
+CONFIG_NET_SCH_CBQ=y
+CONFIG_NET_SCH_HTB=y
+CONFIG_NET_SCH_HFSC=y
+CONFIG_NET_SCH_PRIO=y
+CONFIG_NET_SCH_MULTIQ=y
+CONFIG_NET_SCH_RED=y
+CONFIG_NET_SCH_SFQ=y
+CONFIG_NET_SCH_TEQL=y
+CONFIG_NET_SCH_TBF=y
+CONFIG_NET_SCH_GRED=y
+CONFIG_NET_CLS_BASIC=y
+CONFIG_NET_CLS_TCINDEX=y
+CONFIG_NET_CLS_U32=y
+CONFIG_CLS_U32_PERF=y
+CONFIG_CLS_U32_MARK=y
+CONFIG_NET_CLS_FLOW=y
+CONFIG_NET_CLS_CGROUP=y
+CONFIG_UEVENT_HELPER_PATH="/sbin/mdev"
+CONFIG_DEVTMPFS=y
+CONFIG_MTD=y
+CONFIG_MTD_CMDLINE_PARTS=y
+CONFIG_MTD_BLOCK=y
+CONFIG_MTD_CFI=y
+CONFIG_MTD_CFI_AMDSTD=y
+CONFIG_MTD_PHYSMAP_OF=y
+CONFIG_MTD_M25P80=y
+CONFIG_MTD_PHRAM=y
+CONFIG_MTD_NAND=y
+CONFIG_MTD_NAND_ECC_BCH=y
+CONFIG_MTD_NAND_FSL_ELBC=y
+CONFIG_MTD_UBI=y
+CONFIG_MTD_UBI_GLUEBI=y
+CONFIG_BLK_DEV_LOOP=y
+CONFIG_BLK_DEV_RAM=y
+CONFIG_BLK_DEV_RAM_COUNT=2
+CONFIG_BLK_DEV_RAM_SIZE=2048
+CONFIG_EEPROM_AT24=y
+CONFIG_SCSI=y
+CONFIG_BLK_DEV_SD=y
+CONFIG_CHR_DEV_ST=y
+CONFIG_BLK_DEV_SR=y
+CONFIG_CHR_DEV_SG=y
+CONFIG_SCSI_MULTI_LUN=y
+CONFIG_SCSI_LOGGING=y
+CONFIG_SCSI_SYM53C8XX_2=y
+CONFIG_NETDEVICES=y
+# CONFIG_NET_VENDOR_3COM is not set
+# CONFIG_NET_VENDOR_ADAPTEC is not set
+# CONFIG_NET_VENDOR_ALTEON is not set
+# CONFIG_NET_VENDOR_AMD is not set
+# CONFIG_NET_VENDOR_ATHEROS is not set
+# CONFIG_NET_CADENCE is not set
+# CONFIG_NET_VENDOR_BROADCOM is not set
+# CONFIG_NET_VENDOR_BROCADE is not set
+# CONFIG_NET_VENDOR_CHELSIO is not set
+# CONFIG_NET_VENDOR_CISCO is not set
+# CONFIG_NET_VENDOR_DEC is not set
+# CONFIG_NET_VENDOR_DLINK is not set
+# CONFIG_NET_VENDOR_EMULEX is not set
+# CONFIG_NET_VENDOR_EXAR is not set
+CONFIG_FSL_PQ_MDIO=y
+CONFIG_FSL_XGMAC_MDIO=y
+# CONFIG_NET_VENDOR_HP is not set
+# CONFIG_NET_VENDOR_INTEL is not set
+# CONFIG_NET_VENDOR_MARVELL is not set
+# CONFIG_NET_VENDOR_MELLANOX is not set
+# CONFIG_NET_VENDOR_MICREL is not set
+# CONFIG_NET_VENDOR_MICROCHIP is not set
+# CONFIG_NET_VENDOR_MYRI is not set
+# CONFIG_NET_VENDOR_NATSEMI is not set
+# CONFIG_NET_VENDOR_NVIDIA is not set
+# CONFIG_NET_VENDOR_OKI is not set
+# CONFIG_NET_PACKET_ENGINE is not set
+# CONFIG_NET_VENDOR_QLOGIC is not set
+# CONFIG_NET_VENDOR_REALTEK is not set
+# CONFIG_NET_VENDOR_RDC is not set
+# CONFIG_NET_VENDOR_SEEQ is not set
+# CONFIG_NET_VENDOR_SILAN is not set
+# CONFIG_NET_VENDOR_SIS is not set
+# CONFIG_NET_VENDOR_SMSC is not set
+# CONFIG_NET_VENDOR_STMICRO is not set
+# CONFIG_NET_VENDOR_SUN is not set
+# CONFIG_NET_VENDOR_TEHUTI is not set
+# CONFIG_NET_VENDOR_TI is not set
+# CONFIG_NET_VENDOR_VIA is not set
+# CONFIG_NET_VENDOR_WIZNET is not set
+# CONFIG_NET_VENDOR_XILINX is not set
+CONFIG_MARVELL_PHY=y
+CONFIG_VITESSE_PHY=y
+CONFIG_FIXED_PHY=y
+# CONFIG_WLAN is not set
+# CONFIG_INPUT_MOUSEDEV is not set
+# CONFIG_INPUT_KEYBOARD is not set
+# CONFIG_INPUT_MOUSE is not set
+CONFIG_SERIO_LIBPS2=y
+# CONFIG_LEGACY_PTYS is not set
+CONFIG_PPC_EPAPR_HV_BYTECHAN=y
+CONFIG_SERIAL_8250=y
+CONFIG_SERIAL_8250_CONSOLE=y
+CONFIG_SERIAL_8250_MANY_PORTS=y
+CONFIG_SERIAL_8250_DETECT_IRQ=y
+CONFIG_SERIAL_8250_RSA=y
+CONFIG_NVRAM=y
+CONFIG_I2C=y
+CONFIG_I2C_CHARDEV=y
+CONFIG_I2C_MUX=y
+CONFIG_I2C_MUX_PCA954x=y
+CONFIG_I2C_MPC=y
+CONFIG_SPI=y
+CONFIG_SPI_FSL_SPI=y
+CONFIG_SPI_FSL_ESPI=y
+CONFIG_SPI_SPIDEV=m
+CONFIG_PTP_1588_CLOCK=y
+# CONFIG_HWMON is not set
+# CONFIG_USB_SUPPORT is not set
+CONFIG_EDAC=y
+CONFIG_EDAC_MM_EDAC=y
+CONFIG_EDAC_MPC85XX=y
+CONFIG_RTC_CLASS=y
+CONFIG_RTC_DRV_DS3232=y
+CONFIG_RTC_DRV_CMOS=y
+CONFIG_UIO=y
+CONFIG_STAGING=y
+# CONFIG_NET_VENDOR_SILICOM is not set
+CONFIG_CLK_PPC_CORENET=y
+CONFIG_EXT2_FS=y
+CONFIG_NTFS_FS=y
+CONFIG_PROC_KCORE=y
+CONFIG_TMPFS=y
+CONFIG_JFFS2_FS=y
+CONFIG_UBIFS_FS=y
+CONFIG_CRAMFS=y
+CONFIG_SQUASHFS=y
+CONFIG_SQUASHFS_XZ=y
+CONFIG_NFS_FS=y
+CONFIG_NFS_V4=y
+CONFIG_ROOT_NFS=y
+CONFIG_NLS_ISO8859_1=y
+CONFIG_NLS_UTF8=m
+CONFIG_CRC_ITU_T=m
+CONFIG_DEBUG_INFO=y
+CONFIG_MAGIC_SYSRQ=y
+CONFIG_DEBUG_SHIRQ=y
+CONFIG_DETECT_HUNG_TASK=y
+CONFIG_SCHEDSTATS=y
+CONFIG_RCU_TRACE=y
+CONFIG_UPROBE_EVENT=y
+CONFIG_CRYPTO_NULL=y
+CONFIG_CRYPTO_PCBC=m
+CONFIG_CRYPTO_MD4=y
+CONFIG_CRYPTO_SHA256=y
+CONFIG_CRYPTO_SHA512=y
+# CONFIG_CRYPTO_ANSI_CPRNG is not set
+CONFIG_CRYPTO_DEV_FSL_CAAM=y
diff --git a/arch/powerpc/platforms/85xx/Kconfig b/arch/powerpc/platforms/85xx/Kconfig
index c17aae8..fb98fd6 100644
--- a/arch/powerpc/platforms/85xx/Kconfig
+++ b/arch/powerpc/platforms/85xx/Kconfig
@@ -263,7 +263,7 @@ config CORENET_GENERIC
help
This option enables support for the FSL CoreNet based boards.
For 32bit kernel, the following boards are supported:
- P2041 RDB, P3041 DS and P4080 DS
+ P2041 RDB, P3041 DS, P4080 DS and kmcoge4
For 64bit kernel, the following boards are supported:
T4240 QDS and B4 QDS
The following boards are supported for both 32bit and 64bit kernel:
diff --git a/arch/powerpc/platforms/85xx/corenet_generic.c b/arch/powerpc/platforms/85xx/corenet_generic.c
index 8e4b1e1..ceb0dac 100644
--- a/arch/powerpc/platforms/85xx/corenet_generic.c
+++ b/arch/powerpc/platforms/85xx/corenet_generic.c
@@ -67,7 +67,7 @@ void __init corenet_gen_setup_arch(void)
swiotlb_detect_4g();
- pr_info("%s board from Freescale Semiconductor\n", ppc_md.name);
+ pr_info("%s board\n", ppc_md.name);
mpc85xx_qe_init();
}
@@ -122,6 +122,7 @@ static const char * const boards[] __initconst = {
"fsl,B4860QDS",
"fsl,B4420QDS",
"fsl,B4220QDS",
+ "keymile,kmcoge4",
NULL
};
--
1.8.0.1
^ permalink raw reply related
* Re: [PATCH 1/2] powerpc/powernv: clear the refcount for pci_dev on powernv platform
From: Wei Yang @ 2014-04-22 9:44 UTC (permalink / raw)
To: Benjamin Herrenschmidt; +Cc: aik, linuxppc-dev, Gavin Shan
In-Reply-To: <1398155109.19682.89.camel@pasglop>
On Tue, Apr 22, 2014 at 06:25:09PM +1000, Benjamin Herrenschmidt wrote:
>On Tue, 2014-04-22 at 15:44 +0800, Wei Yang wrote:
>> So this patch(the 2nd one) doesn't contribute to clear the warning and
>> error.
>> Only the first patch did it. Please ignore this one.
>
>But is it correct ? It's not right to keep a refcount elevated if we
>don't have to.
The code refcount is introduced in commit 184cd4a3(powerpc/powernv: PCI
support for p7IOC under OPAL v2). To me, it looks not necessary.
>
>Gavin, can you get to the bottom of that refcount business ?
>
>Cheers,
>Ben.
>
--
Richard Yang
Help you, Help me
^ permalink raw reply
* Re: questions on CONFIG_PPC_ADV_DEBUG_REGS, DBCR0_BRT, and DBCR0_ACTIVE_EVENTS
From: shiva7 @ 2014-04-22 12:43 UTC (permalink / raw)
To: linuxppc-dev
In-Reply-To: <5167457E.1050205@genband.com>
I have the same question as like above posted by Mr. Chirs.
Could someone help to understand why the debug BRT bit not handled in debug
context sys call? Intentional or need volunteer to finish up this part :)
--
View this message in context: http://linuxppc.10917.n7.nabble.com/questions-on-CONFIG-PPC-ADV-DEBUG-REGS-DBCR0-BRT-and-DBCR0-ACTIVE-EVENTS-tp70147p81732.html
Sent from the linuxppc-dev mailing list archive at Nabble.com.
^ permalink raw reply
* Re: [PATCH v2] gpio: ge: Convert to platform driver
From: Linus Walleij @ 2014-04-22 13:03 UTC (permalink / raw)
To: Alexander Shiyan
Cc: linux-gpio@vger.kernel.org, Martyn Welch,
linuxppc-dev@lists.ozlabs.org list, Alexandre Courbot
In-Reply-To: <1397281291-28694-1-git-send-email-shc_work@mail.ru>
On Sat, Apr 12, 2014 at 7:41 AM, Alexander Shiyan <shc_work@mail.ru> wrote:
> This patch converts GE I/O FPGA GPIO driver to platform driver.
>
> Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
No further comments, so this v2 patch is applied.
Yours,
Linus Walleij
^ permalink raw reply
* Re: [PATCH 0/3] of: dts: enable memory@0 quirk for PPC32 only
From: Grant Likely @ 2014-04-22 13:08 UTC (permalink / raw)
To: Rob Herring, Leif Lindholm
Cc: Mark Rutland, devicetree@vger.kernel.org, linuxppc-dev,
linux-kernel@vger.kernel.org, Linaro Patches
In-Reply-To: <CAL_JsqKdFyhHfkcC1E9QuKjQTrXwoELYG+CFTpgf2-jqDvxGmA@mail.gmail.com>
On Fri, 18 Apr 2014 10:37:58 -0500, Rob Herring <robherring2@gmail.com> wrote:
> On Fri, Apr 18, 2014 at 7:48 AM, Leif Lindholm <leif.lindholm@linaro.org> wrote:
> > On Thu, Apr 17, 2014 at 07:43:13PM -0500, Rob Herring wrote:
> >> On Thu, Apr 17, 2014 at 12:41 PM, Leif Lindholm
> >> <leif.lindholm@linaro.org> wrote:
> >> > drivers/of/fdt.c contains a workaround for a missing memory type
> >> > entry on longtrail firmware. Make that quirk PPC32 only, and while
> >> > at it - fix up the .dts files in the tree currently working only
> >> > because of that quirk.
> >>
> >> But why do you need this?
> >
> > Apart from the current code permitting recreating a 15+ year old
> > firmware bug into completely new platform ports?
>
> I would prefer to see a "WARN_ON(!IS_ENABLED(CONFIG_PPC32));" added here.
I completely agree.
> Really, I would like to see quirks like this fixed up out of line from
> the normal flow somewhat like how PCI quirks are handled. So in this
> example, we would just add the missing property to the dtb for the
> broken platform before doing the memory scan. That does then require
> libfdt which is something I'm working on.
In fact, for Leif's purposes, I would rather have a flag when booting via
UEFI, and make the kernel skip the memory node parsing if the UEFI
memory map is available. Then the stub doesn't need to do any munging of
the DTB at all.
g.
^ permalink raw reply
* Re: [PATCH 3/3] of: Handle memory@0 node on PPC32 only
From: Grant Likely @ 2014-04-22 13:35 UTC (permalink / raw)
To: Leif Lindholm, Geert Uytterhoeven
Cc: Mark Rutland, devicetree@vger.kernel.org, patches, Lee Jones,
linux-kernel@vger.kernel.org, Rob Herring,
linuxppc-dev@lists.ozlabs.org
In-Reply-To: <20140418125924.GF5904@bivouac.eciton.net>
On Fri, 18 Apr 2014 13:59:24 +0100, Leif Lindholm <leif.lindholm@linaro.org> wrote:
> Hi Geert,
>
> On Fri, Apr 18, 2014 at 10:04:15AM +0200, Geert Uytterhoeven wrote:
> > On Thu, Apr 17, 2014 at 7:42 PM, Leif Lindholm <leif.lindholm@linaro.org> wrote:
> > > In order to deal with an firmware bug on a specific ppc32 platform
> > > (longtrail), early_init_dt_scan_memory() looks for a node called
> > > memory@0 on all platforms. Restrict this quirk to ppc32 kernels only.
> >
> > This breaks backwards compatibilty with old DTSes (at least on ARM/MIPS,
> > where you added the missing property in patches 1 and 2 of the series)?
>
> As Rob said in response to 0/3, the MIPSs would likely not be affected,
> since they embed the DT.
>
> > For the Longtrail, I don't care much anymore, as mine died in 2004.
> > AFAIK, there have never been many users anyway.
>
> There are still a few mentions of it under arch/powerpc/, so I wouldn't
> want to be the one to kill it off...
>
> How about the below v2 3/3 to address the ARM platform?
The problem with this approach is that selecting one board that needs it
automatically makes it active for all boards. It would need to be
something more like the following:
diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c
index 399e242e1a42..55d65b2b4c74 100644
--- a/drivers/of/fdt.c
+++ b/drivers/of/fdt.c
@@ -887,12 +887,10 @@ int __init early_init_dt_scan_memory(unsigned long node, const char *uname,
/* We are scanning "memory" nodes only */
if (type == NULL) {
- /*
- * The longtrail doesn't have a device_type on the
- * /memory node, so look for the node called /memory@0.
- */
if (depth != 1 || strcmp(uname, "memory@0") != 0)
return 0;
+ if (!of_flat_dt_match(dt_root, memory_quirk_list))
+ return 0;
} else if (strcmp(type, "memory") != 0)
return 0;
With a list of compatible properties for affected boards.
g.
^ permalink raw reply related
* Re: [PATCH 0/3] of: dts: enable memory@0 quirk for PPC32 only
From: Leif Lindholm @ 2014-04-22 14:05 UTC (permalink / raw)
To: Grant Likely
Cc: Mark Rutland, devicetree@vger.kernel.org, Linaro Patches,
linux-kernel@vger.kernel.org, Rob Herring, linuxppc-dev
In-Reply-To: <20140422130829.CA29DC4042C@trevor.secretlab.ca>
On Tue, Apr 22, 2014 at 02:08:29PM +0100, Grant Likely wrote:
> > I would prefer to see a "WARN_ON(!IS_ENABLED(CONFIG_PPC32));" added here.
>
> I completely agree.
OK. So do we keep this around on unaffected architectures in perpetuity?
Or can there be some cut-off date when the majority of DT-enabled
platforms can stop including this workaround which permits new incorrect
DTs to be implemented so long as they are incorrect in this particular
way?
> > Really, I would like to see quirks like this fixed up out of line from
> > the normal flow somewhat like how PCI quirks are handled. So in this
> > example, we would just add the missing property to the dtb for the
> > broken platform before doing the memory scan. That does then require
> > libfdt which is something I'm working on.
>
> In fact, for Leif's purposes, I would rather have a flag when booting via
> UEFI, and make the kernel skip the memory node parsing if the UEFI
> memory map is available. Then the stub doesn't need to do any munging of
> the DTB at all.
The reason for me doing that is because we (including you) agreed at
the discussion held during LCU13 that this was the safest way of
preventing "mischief" like userland trying to read information from
/proc/device-tree...
/
Leif
^ permalink raw reply
* Re: [PATCH RFC v11 5/6] dma: mpc512x: add device tree binding document
From: Gerhard Sittig @ 2014-04-22 18:27 UTC (permalink / raw)
To: Alexander Popov
Cc: devicetree, Lars-Peter Clausen, Anatolij Gustschin, Arnd Bergmann,
Vinod Koul, dmaengine, Dan Williams, Andy Shevchenko,
linuxppc-dev
In-Reply-To: <CAF0T0X4TqhZ=niKRgArG-s1cD6uRH0UZDqGyTLpde_aHBFTVtw@mail.gmail.com>
On Fri, 2014-04-18 at 15:29 +0400, Alexander Popov wrote:
>
> 2014-04-17 0:44 GMT+04:00 Gerhard Sittig <gsi@denx.de>:
> > On Tue, 2014-04-15 at 14:54 +0400, Alexander Popov wrote:
> >>
> >> +- reg: Address and size of the DMA controller's register set
> >> +- interrupts: Interrupt for the DMA controller. Generic interrupt client node
> >> + is described in interrupt-controller/interrupts.txt
> >
> > 'interrupts' only works in combinations with 'interrupt-parent',
> > that actual .dts files don't have the latter in the nodes is an
> > implementation detail but not a binding's requirement
> Excuse me, I didn't understand your point.
>
> > and an alternative method of specifying interrupts was introduced
> > recently, a reference to the common binding without naming one
> > specific property name could be most appropriate
> Excuse me, I haven't found such an example.
The 'interrupts' property is not enough in itself, it always
needs the 'interrupt-parent' property, too. Because the parent
(the interrupt controller) often is the same for multiple
interrupts, it usually gets "factored out" into a parent node in
the tree, and thus often gets missed in discussions. Still the
'interrupt-parent' is strictly required for 'interrupts' to work.
Splitting both properties and putting them into nodes that are
rather distant from each other is just an implementation detail
of .dts files. This should not be reflected in bindings.
The 'interrupts-extended' property was introduced only recently.
See bindings/interrupt-controller/interrupts.txt for details.
Although the motivation was to reference several parents from one
client node, I very much like the idea of having all of the
interrupt spec within a single property. Being explicit is a
good thing, especially in setups with cascades. I consider this
approach an improvement in readability and maintenance.
You might just want to document in the binding that interrupt
specs are required (or optional), which interrupts these are (the
above text could be sufficient if there is only one interrupt for
this IP block), and refer to the common binding for the syntax.
virtually yours
Gerhard Sittig
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr. 5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 Email: office@denx.de
^ permalink raw reply
* Re: [PATCH 6/6] powerpc/powernv: Fix little endian issues in OPAL dump code
From: Anton Blanchard @ 2014-04-22 21:31 UTC (permalink / raw)
To: Vasant Hegde; +Cc: stewart, paulus, linuxppc-dev
In-Reply-To: <53562921.6050300@linux.vnet.ibm.com>
Hi,
> -int64_t opal_dump_info(uint32_t *dump_id, uint32_t *dump_size);
> -int64_t opal_dump_info2(uint32_t *dump_id, uint32_t *dump_size, uint32_t *dump_type);
> +int64_t opal_dump_info(__be32 *dump_id, __be32 *dump_size);
> +int64_t opal_dump_info2(__be32 *dump_id, __be32 *dump_size, __be32 *dump_type);
> int64_t opal_dump_read(uint32_t dump_id, uint64_t buffer);
> int64_t opal_dump_ack(uint32_t dump_id);
>
> Shouldn't we change above two functions as well ?
No, there are no endian issues here because we pass the values via
register. The only endian issues are for values we pass via pointer.
> Should we convert ID back to BE format in dump_send_ack() ?
Same as above.
Anton
^ permalink raw reply
* Re: [PATCH 5/6] powerpc/powernv: Create OPAL sglist helper functions and fix endian issues
From: Anton Blanchard @ 2014-04-22 21:34 UTC (permalink / raw)
To: Vasant Hegde; +Cc: stewart, paulus, linuxppc-dev
In-Reply-To: <5356335A.1080704@linux.vnet.ibm.com>
Hi,
> Shouldn't we convert addr and id before passing to opal_dump_read()
> here ?
int64_t opal_dump_read(uint32_t dump_id, uint64_t buffer);
All arguments are passed via register, so byteswaping the arguments
would break it.
Anton
^ permalink raw reply
* Re: [PATCH 10/33] powerpc: Ignore TOC relocations
From: Anton Blanchard @ 2014-04-22 22:02 UTC (permalink / raw)
To: Alan Modra; +Cc: mikey, rusty, ulrich.weigand, mjw, paulus, linuxppc-dev
In-Reply-To: <20140326093602.GM18201@bubble.grove.modra.org>
Hi Alan,
> > The linker fixes up TOC. relocations, so prom_init_check.sh should
> > ignore them.
>
> Err, .TOC. you mean. Presumably something strips off the leading dot
> somewhere?
Yeah, the script strips them:
# On 64-bit nm gives us the function descriptors, which have
# a leading . on the name, so strip it off here.
UNDEF="${UNDEF#.}"
I'll modify the commit message to be less confusing.
Anton
^ permalink raw reply
* Re: questions on CONFIG_PPC_ADV_DEBUG_REGS, DBCR0_BRT, and DBCR0_ACTIVE_EVENTS
From: Scott Wood @ 2014-04-22 22:31 UTC (permalink / raw)
To: shiva7; +Cc: Chris Friesen, linuxppc-dev, Dave Kleikamp, Torez Smith
In-Reply-To: <1398170592855-81732.post@n7.nabble.com>
On Tue, 2014-04-22 at 05:43 -0700, shiva7 wrote:
> I have the same question as like above posted by Mr. Chirs.
I had to google the subject to find what e-mail you were talking about
-- it was posted a year ago:
http://marc.info/?l=linuxppc-embedded&m=136572252330650&w=2
Next time please quote the e-mail if you're trying to revive a thread,
and keep the original poster on CC.
I've quoted it here:
> Sorry for the bunch of emails, I'm working on some new stuff and running
> into issues.
>
> For CONFIG_BOOKE it appears that DBCR0_ACTIVE_EVENTS includes DBCR0_ICMP
> but not DBCR0_BRT. Is that just because none of the code paths
> currently using DBCR0_ACTIVE_EVENTS need to check DBCR0_BT?
Perhaps it was just an oversight. I've CCed Dave Kleikamp and Torez
Smith, who added DBCR0_ACTIVE_EVENTS.
> Also, in sys_debug_setcontext() why does SIG_DBG_BRANCH_TRACING return
> -EINVAL if CONFIG_PPC_ADV_DEBUG_REGS is set? Would it not be possible
> to use DBCR0_BRT?
Either nobody has gotten around to implementing it, or the semantics
are different in some way (if the semantics are even defined anywhere
-- I couldn't find any documentation).
-Scott
^ permalink raw reply
* Re: questions on CONFIG_PPC_ADV_DEBUG_REGS, DBCR0_BRT, and DBCR0_ACTIVE_EVENTS
From: Scott Wood @ 2014-04-22 22:37 UTC (permalink / raw)
To: shiva7; +Cc: Chris Friesen, linuxppc-dev
In-Reply-To: <1398205896.1694.252.camel@snotra.buserror.net>
On Tue, 2014-04-22 at 17:31 -0500, Scott Wood wrote:
> On Tue, 2014-04-22 at 05:43 -0700, shiva7 wrote:
> > I have the same question as like above posted by Mr. Chirs.
>
> I had to google the subject to find what e-mail you were talking about
> -- it was posted a year ago:
>
> http://marc.info/?l=linuxppc-embedded&m=136572252330650&w=2
>
> Next time please quote the e-mail if you're trying to revive a thread,
> and keep the original poster on CC.
>
> I've quoted it here:
>
> > Sorry for the bunch of emails, I'm working on some new stuff and running
> > into issues.
> >
> > For CONFIG_BOOKE it appears that DBCR0_ACTIVE_EVENTS includes DBCR0_ICMP
> > but not DBCR0_BRT. Is that just because none of the code paths
> > currently using DBCR0_ACTIVE_EVENTS need to check DBCR0_BT?
>
> Perhaps it was just an oversight. I've CCed Dave Kleikamp and Torez
> Smith, who added DBCR0_ACTIVE_EVENTS.
...and both of those e-mails bounced, so it may be that nobody who is
listening knows the answer. Feel free to submit a patch that adds it,
with the changelog explaining why it should be included.
-Scott
^ 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