cpm2: Reset the CPM at startup and fix the cpm_uart driver accordingly.
Subsystems (2)
v2 cover cpm2: Reset the CPM at startup and fix the cpm_uart driver accordingly.
Hi everybody,
these 3 patches reset the CPM in cpm2_reset() and fix the cpm_uart driver to initialise SMC ports correctly without relying on any initialisation performed by the boot loader/wrapper. They update the EP8248E device tree to match the new SMC registers description.
Signature · 9 lines
Laurent Pinchart CSE Semaphore Belgium Chaussée de Bruxelles, 732A B-1410 Waterloo Belgium T +32 (2) 387 42 59 F +32 (2) 387 42 75
PATCH v2 1/3 cpm_uart: Allocate DPRAM memory for SMC ports on CPM2-based platforms.
This patch allocates parameter RAM for SMC serial ports without relying on previous initialisation by a boot loader or a wrapper layer.
SMC parameter RAM on CPM2-based platforms can be allocated anywhere in the general-purpose areas of the dual-port RAM. The current code relies on the boot loader to allocate a section of general-purpose CPM RAM and gets the section address from the device tree.
This patch modifies the device tree address usage to reference the SMC parameter RAM base pointer instead of a pre-allocated RAM section and allocates memory from the CPM dual-port RAM when initialising the SMC port. CPM1-based platforms are not affected.
--- drivers/serial/cpm_uart/cpm_uart.h | 3 ++ drivers/serial/cpm_uart/cpm_uart_core.c | 19 +++++------ drivers/serial/cpm_uart/cpm_uart_cpm1.c | 12 +++++++ drivers/serial/cpm_uart/cpm_uart_cpm2.c | 52 +++++++++++++++++++++++++++++++ 4 files changed, 76 insertions(+), 10 deletions(-)
drivers/serial/cpm_uart/cpm_uart.h +3 -0
@@ -93,6 +93,9 @@ extern struct uart_cpm_port cpm_uart_ports[UART_NR];/* these are located in their respective files */ void cpm_line_cr_cmd (struct uart_cpm_port *port,int cmd); +void __iomem *cpm_uart_map_pram (struct uart_cpm_port *port, +struct device_node *np); +void cpm_uart_unmap_pram (struct uart_cpm_port *port,void __iomem *pram);int cpm_uart_init_portdesc (void );int cpm_uart_allocbuf (struct uart_cpm_port *pinfo,unsigned int is_con);void cpm_uart_freebuf (struct uart_cpm_port *pinfo);
drivers/serial/cpm_uart/cpm_uart_core.c +9 -10
@@ -997,24 +997,23 @@ static int cpm_uart_init_port(struct device_node *np,if (!mem)return -ENOMEM ; - pram =of_iomap (np,1 ); -if (!pram) { - ret = -ENOMEM ; - goto out_mem; - } -if (of_device_is_compatible (np,"fsl,cpm1-scc-uart" ) ||of_device_is_compatible (np,"fsl,cpm2-scc-uart" )) { pinfo->sccp = mem; - pinfo->sccup = pram; + pinfo->sccup = pram =cpm_uart_map_pram (pinfo, np); }else if (of_device_is_compatible (np,"fsl,cpm1-smc-uart" ) ||of_device_is_compatible (np,"fsl,cpm2-smc-uart" )) { pinfo->flags |=FLAG_SMC ; pinfo->smcp = mem; - pinfo->smcup = pram; + pinfo->smcup = pram =cpm_uart_map_pram (pinfo, np); }else { ret = -ENODEV ; - goto out_pram; + goto out_mem; + } + +if (!pram) { + ret = -ENOMEM ; + goto out_mem; } pinfo->tx_nrfifos =TX_NUM_FIFO ;
@@ -1038,7 +1037,7 @@ static int cpm_uart_init_port(struct device_node *np,return cpm_uart_request_port (&pinfo->port); out_pram: -iounmap (pram); +cpm_uart_unmap_pram (pinfo, pram); out_mem:iounmap (mem);return ret;
drivers/serial/cpm_uart/cpm_uart_cpm1.c +12 -0
@@ -54,6 +54,18 @@ void cpm_line_cr_cmd(struct uart_cpm_port *port, int cmd) {cpm_command (port->command, cmd); } + +void __iomem *cpm_uart_map_pram (struct uart_cpm_port *port, +struct device_node *np) +{ +return of_iomap (np,1 ); +} + +void cpm_uart_unmap_pram (struct uart_cpm_port *port,void __iomem *pram) +{ +iounmap (pram); +} +#else void cpm_line_cr_cmd (struct uart_cpm_port *port,int cmd) {
drivers/serial/cpm_uart/cpm_uart_cpm2.c +52 -0
64 lines not on this page · raw message
Signature · 13 lines
1.5.0 -- Laurent Pinchart CSE Semaphore Belgium Chaussée de Bruxelles, 732A B-1410 Waterloo Belgium T +32 (2) 387 42 59 F +32 (2) 387 42 75
PATCH v2 2/3 ep8248e: Reference SMC parameter RAM base in the device tree.
In reply to Laurent PinchartThis patch modifies the Embedded Planet EP8248E device tree to reference the SMC paramater RAM base register instead of the parameter RAM allocated by the boot loader.
The cpm_uart driver will allocate parameter RAM itself, making the serial port initialisation independent of the boot loader.
--- arch/powerpc/boot/dts/ep8248e.dts | 5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-)
arch/powerpc/boot/dts/ep8248e.dts +2 -3
@@ -121,8 +121,7 @@ data@0 { compatible = "fsl,cpm-muram-data"; - reg = <0 0x1100 0x1140 - 0xec0 0x9800 0x800>; + reg = <0 0x2000 0x9800 0x800>; }; };
@@ -138,7 +137,7 @@ device_type = "serial"; compatible = "fsl,mpc8248-smc-uart", "fsl,cpm2-smc-uart"; - reg = <0x11a80 0x20 0x1100 0x40>; + reg = <0x11a80 0x20 0x87fc 2>; interrupts = <4 8>; interrupt-parent = <&PIC>; fsl,cpm-brg = <7>;
Signature · 13 lines
1.5.0 -- Laurent Pinchart CSE Semaphore Belgium Chaussée de Bruxelles, 732A B-1410 Waterloo Belgium T +32 (2) 387 42 59 F +32 (2) 387 42 75
Re: [PATCHv2 2/3] ep8248e: Reference SMC parameter RAM base in the device tree.
arch/powerpc/boot/dts/ep8248e.dts line 125
Quoted 12 lines · Laurent Pinchart
arch/powerpc/boot/dts/ep8248e.dts +1
-2@@ -121,8 +121,7 @@ data@0 { compatible = "fsl,cpm-muram-data"; - reg = <0 0x1100 0x1140 - 0xec0 0x9800 0x800>; + reg = <0 0x2000 0x9800 0x800>; };
Can we leave this as reserved, so that udbg still works?
-Scott
Re: [PATCHv2 2/3] ep8248e: Reference SMC parameter RAM base in the device tree.
Quoted 2 lines · Scott Wood
Review
Quoted 1 line · Laurent Pinchart
(quoted diff) +0
-0
b/arch/powerpc/boot/dts/ep8248e.dts
Quoted 5 lines
Quoted 5 lines
index 5d2fb76..756758f 100644
arch/powerpc/boot/dts/ep8248e.dts +0
-0@@ -121,8 +121,7 @@
Quoted 8 lines
arch/powerpc/boot/dts/ep8248e.dts line 125
Quoted 6 lines
arch/powerpc/boot/dts/ep8248e.dts +1
-2data@0 { compatible = "fsl,cpm-muram-data"; - reg = <0 0x1100 0x1140 - 0xec0 0x9800 0x800>; + reg = <0 0x2000 0x9800 0x800>; };Can we leave this as reserved, so that udbg still works?
Ok. Should I add a comment to the DTS to explain additional muram can be reclaimed if udbg isn't used ?
Signature · 9 lines
Laurent Pinchart CSE Semaphore Belgium Chaussée de Bruxelles, 732A B-1410 Waterloo Belgium T +32 (2) 387 42 59 F +32 (2) 387 42 75
Re: [PATCHv2 2/3] ep8248e: Reference SMC parameter RAM base in the device tree.
In reply to Laurent Pinchartarch/powerpc/boot/dts/ep8248e.dts line 143
Quoted 9 lines · Laurent Pinchart
arch/powerpc/boot/dts/ep8248e.dts +1
-1@@ -138,7 +137,7 @@ device_type = "serial"; compatible = "fsl,mpc8248-smc-uart", "fsl,cpm2-smc-uart"; - reg = <0x11a80 0x20 0x1100 0x40>; + reg = <0x11a80 0x20 0x87fc 2>; interrupts = <4 8>; interrupt-parent = <&PIC>; fsl,cpm-brg = <7>;
This breaks the bootwrapper console.
-Scott
Re: [PATCHv2 2/3] ep8248e: Reference SMC parameter RAM base in the device tree.
Quoted 12 lines · Scott Wood
arch/powerpc/boot/dts/ep8248e.dts line 143
Quoted 9 lines · Laurent Pinchart
arch/powerpc/boot/dts/ep8248e.dts +1
-1@@ -138,7 +137,7 @@ device_type = "serial"; compatible = "fsl,mpc8248-smc-uart", "fsl,cpm2-smc-uart"; - reg = <0x11a80 0x20 0x1100 0x40>; + reg = <0x11a80 0x20 0x87fc 2>; interrupts = <4 8>; interrupt-parent = <&PIC>; fsl,cpm-brg = <7>;This breaks the bootwrapper console.
And of course I forgot about that :-)
The boot wrapper code doesn't have any dpram allocator. Any objection against using a chunk of dpram at a fixed location ? What about at the beginning of the dpram ? The DTS muram node would then exclude a chunk of dpram at offset 0x0000 instead of 0x1100.
Signature · 9 lines
Laurent Pinchart CSE Semaphore Belgium Chaussée de Bruxelles, 732A B-1410 Waterloo Belgium T +32 (2) 387 42 59 F +32 (2) 387 42 75
Re: [PATCHv2 2/3] ep8248e: Reference SMC parameter RAM base in the device tree.
Quoted 9 lines · Laurent Pinchart
Quoted 1 line · Scott Wood
This breaks the bootwrapper console.
And of course I forgot about that :-)
The boot wrapper code doesn't have any dpram allocator. Any objection against using a chunk of dpram at a fixed location ? What about at the beginning of the dpram ? The DTS muram node would then exclude a chunk of dpram at offset
0x0000instead of0x1100.
I'm not entirely comfortable with using a chunk outside of what's in the muram node, and assuming that it's for the SMC pram -- what if there's microcode or something there?
Since udbg is only for debugging, and is marked as potentially dangerous, how about just using the end of muram (as described in the device tree)? If the muram is fully allocated, it won't happen until after the real serial console is initialized.
-Scott
Re: [PATCHv2 2/3] ep8248e: Reference SMC parameter RAM base in the device tree.
Quoted 11 lines · Scott Wood
Quoted 9 lines · Laurent Pinchart
Quoted 1 line · Scott Wood
This breaks the bootwrapper console.
And of course I forgot about that :-)
The boot wrapper code doesn't have any dpram allocator. Any objection against using a chunk of dpram at a fixed location ? What about at the beginning of the dpram ? The DTS muram node would then exclude a chunk of dpram at offset
0x0000instead of0x1100.
Quoted 8 lines
I'm not entirely comfortable with using a chunk outside of what's in the muram node, and assuming that it's for the SMC pram -- what if there's microcode or something there?
Since udbg is only for debugging, and is marked as potentially dangerous, how about just using the end of muram (as described in the device tree)? If the muram is fully allocated, it won't happen until after the real serial console is initialized.
Very good idea. I'll prepare a new patch.
Signature · 9 lines
Laurent Pinchart CSE Semaphore Belgium Chaussée de Bruxelles, 732A B-1410 Waterloo Belgium T +32 (2) 387 42 59 F +32 (2) 387 42 75
Re: [PATCHv2 2/3] ep8248e: Reference SMC parameter RAM base in the device tree.
Quoted 8 lines · Laurent Pinchart
Quoted 7 lines · Scott Wood
Quoted 6 lines · Laurent Pinchart
Quoted 1 line · Scott Wood
This breaks the bootwrapper console.
And of course I forgot about that :-)
The boot wrapper code doesn't have any dpram allocator. Any objection
against
Quoted 1 line
Quoted 1 line
Quoted 1 line
using a chunk of dpram at a fixed location ? What about at the beginning
of
Quoted 1 line
Quoted 1 line
Quoted 1 line
the dpram ? The DTS muram node would then exclude a chunk of dpram at
offset
Quoted 6 lines
Quoted 6 lines
Quoted 1 line
0x0000instead of0x1100.I'm not entirely comfortable with using a chunk outside of what's in the muram node, and assuming that it's for the SMC pram -- what if there's microcode or something there?
Quoted 6 lines
Quoted 4 lines
Since udbg is only for debugging, and is marked as potentially dangerous, how about just using the end of muram (as described in the device tree)? If the muram is fully allocated, it won't happen until after the real serial console is initialized.
Very good idea. I'll prepare a new patch.
arch/powerpc/boot/cpm-serial.c stores the udbg buffer descriptors at the beginning of the muram. Should I move them at the end as well ?
Signature · 9 lines
Laurent Pinchart CSE Semaphore Belgium Chaussée de Bruxelles, 732A B-1410 Waterloo Belgium T +32 (2) 387 42 59 F +32 (2) 387 42 75
Re: [PATCHv2 2/3] ep8248e: Reference SMC parameter RAM base in the device tree.
Quoted 2 lines · Laurent Pinchart
arch/powerpc/boot/cpm-serial.cstores the udbg buffer descriptors at the beginning of the muram. Should I move them at the end as well ?
Sure; make sure to update the default descriptor addresses in the Kconfig.
-Scott
Re: [PATCHv2 2/3] ep8248e: Reference SMC parameter RAM base in the device tree.
In reply to Scott WoodQuoted 11 lines · Scott Wood
Quoted 9 lines · Laurent Pinchart
Quoted 1 line · Scott Wood
This breaks the bootwrapper console.
And of course I forgot about that :-)
The boot wrapper code doesn't have any dpram allocator. Any objection against using a chunk of dpram at a fixed location ? What about at the beginning of the dpram ? The DTS muram node would then exclude a chunk of dpram at offset
0x0000instead of0x1100.
Quoted 8 lines
I'm not entirely comfortable with using a chunk outside of what's in the muram node, and assuming that it's for the SMC pram -- what if there's microcode or something there?
Since udbg is only for debugging, and is marked as potentially dangerous, how about just using the end of muram (as described in the device tree)? If the muram is fully allocated, it won't happen until after the real serial console is initialized.
Locating the end of the muram isn't as straightforward as it could be. As the current code already uses the beginning of the muram to store the BDs and data buffers, should I really bother locating the end or can I store the SMC parameter ram at the beginning as well ?
If I'm not mistaken, once the SMC parameter ram gets relocated to the beginning/end of the muram, the boot loader preallocated space can be reclaimed and can be added to the muram in the device tree like I did in my previous patch. Is that correct ?
Signature · 9 lines
Laurent Pinchart CSE Semaphore Belgium Chaussée de Bruxelles, 732A B-1410 Waterloo Belgium T +32 (2) 387 42 59 F +32 (2) 387 42 75
Re: [PATCHv2 2/3] ep8248e: Reference SMC parameter RAM base in the device tree.
Quoted 1 line · Laurent Pinchart
Locating the end of the muram isn't as straightforward as it could be. As the current code already uses the beginning of the muram to store the BDs and data buffers, should I really bother locating the end or can I store the SMC parameter ram at the beginning as well ?
Maybe, but the end would be safer. What's the problem with finding the end? Even the end of the first reg resource would be OK.
Quoted 1 line
If I'm not mistaken, once the SMC parameter ram gets relocated to the beginning/end of the muram, the boot loader preallocated space can be reclaimed and can be added to the muram in the device tree like I did in my previous patch. Is that correct ?
Yes.
-Scott
Re: [PATCHv2 2/3] ep8248e: Reference SMC parameter RAM base in the device tree.
Quoted 8 lines · Scott Wood
Quoted 4 lines · Laurent Pinchart
Locating the end of the muram isn't as straightforward as it could be. As the current code already uses the beginning of the muram to store the BDs and data buffers, should I really bother locating the end or can I store the SMC parameter ram at the beginning as well ?
Maybe, but the end would be safer. What's the problem with finding the end?
That requires manual parsing of all the cells in the reg property. The device-tree API doesn't provide a way to get the length of a property, so I'll have to use a big enough pre-allocated buffer. I'm also not sure if resources are guaranteed to be sorted in increasing order.
This doesn't make finding the end of the muram really difficult. I was just wondering if the increased code complexity was worth it, especially seeing how the cpm_serial code in the boot wrapper seem quite unstable.
I'm not familiar with the boot wrapper code so I'm sometimes not very confident in my assumptions, but isn't the handling of the virtual-reg property in cpm_console_init broken ?
void *reg_virt[2];
...
n = getprop(devp, "virtual-reg", reg_virt, sizeof(reg_virt));
if (n < (int)sizeof(reg_virt)) {
for (n = 0; n < 2; n++) {
if (!dt_xlate_reg(devp, n, ®_phys, NULL))
return -1;
reg_virt[n] = (void *)reg_phys;
}
}
if (is_smc)
smc = reg_virt[0];
else
scc = reg_virt[0];
param = reg_virt[1];If I'm not mistaken, getprop will return the address and size of the first resource and not the addresses of the first two resources. What is virtual-reg used for ? To report the virtual address without requiring a device tree walk ? Does it provide any information that dt_xlate_reg can't find ?
Quoted 1 line
Even the end of the first reg resource would be OK.
If I use the end of the first resource, can I assume it spans 0x0000 - 0x8000 to set the default tx BD address in Kconfig ?
Quoted 6 lines
Quoted 4 lines
If I'm not mistaken, once the SMC parameter ram gets relocated to the beginning/end of the muram, the boot loader preallocated space can be reclaimed and can be added to the muram in the device tree like I did in my previous patch. Is that correct ?
Yes.
Signature · 9 lines
Laurent Pinchart CSE Semaphore Belgium Chaussée de Bruxelles, 732A B-1410 Waterloo Belgium T +32 (2) 387 42 59 F +32 (2) 387 42 75
Re: [PATCHv2 2/3] ep8248e: Reference SMC parameter RAM base in the device tree.
Quoted 7 lines · Laurent Pinchart
Quoted 6 lines · Scott Wood
Quoted 5 lines · Laurent Pinchart
Locating the end of the muram isn't as straightforward as it could be. As the current code already uses the beginning of the muram to store the BDs and data buffers, should I really bother locating the end or can I store the SMC parameter ram at the beginning as well ?
Quoted 6 lines
Quoted 2 lines
Maybe, but the end would be safer. What's the problem with finding the end?
That requires manual parsing of all the cells in the reg property. The device-tree API doesn't provide a way to get the length of a property,
Sure it does. Do a getprop with an insufficiently large buffer, and it tells you how much you really need. :-)
Quoted 2 lines
so I'll have to use a big enough pre-allocated buffer. I'm also not sure if resources are guaranteed to be sorted in increasing order.
Ah, good point.
Quoted 4 lines
This doesn't make finding the end of the muram really difficult. I was just wondering if the increased code complexity was worth it, especially seeing how the
cpm_serialcode in the boot wrapper seem quite unstable.
Unstable in what way?
Quoted 3 lines
I'm not familiar with the boot wrapper code so I'm sometimes not very
confident in my assumptions, but isn't the handling of the
virtual-reg property incpm_console_initbroken ?
Not as far as I can see.
Quoted 2 lines
If I'm not mistaken, getprop will return the address and size of the first resource and not the addresses of the first two resources.
No, it'll get as much of the virtual-reg property as will fit in the buffer. There's no size in virtual-reg.
Quoted 3 lines
What is virtual-reg used for ? To report the virtual address without requiring a device tree walk ? Does it provide any information that
dt_xlate_regcan't find ?
Yes, it tells you the virtual address when it's not an identity mapping.
It's not currently used on CPM platforms, but might be used down the
road with a QE device on 85xx.
Quoted 4 lines
Quoted 1 line
Even the end of the first reg resource would be OK.
If I use the end of the first resource, can I assume it spans
0x0000
-0x8000to set the default tx BD address inKconfig?
No, especially seeing as it doesn't on any existing boards. :-)
You could set the default to just before 0x2000 with board-specific exceptions, though.
-Scott
Re: [PATCHv2 2/3] ep8248e: Reference SMC parameter RAM base in the device tree.
Quoted 11 lines · Scott Wood
Quoted 10 lines · Laurent Pinchart
Quoted 8 lines · Scott Wood
Quoted 5 lines · Laurent Pinchart
Locating the end of the muram isn't as straightforward as it could be. As the current code already uses the beginning of the muram to store the BDs and data buffers, should I really bother locating the end or can I store the SMC parameter ram at the beginning as well ?
Maybe, but the end would be safer. What's the problem with finding the end?
Quoted 6 lines
Quoted 3 lines
That requires manual parsing of all the cells in the reg property. The device-tree API doesn't provide a way to get the length of a property,
Sure it does. Do a getprop with an insufficiently large buffer, and it tells you how much you really need. :-)
Ok thanks.
Quoted 11 lines
Quoted 2 lines
so I'll have to use a big enough pre-allocated buffer. I'm also not sure if resources are guaranteed to be sorted in increasing order.
Ah, good point.
Quoted 4 lines
This doesn't make finding the end of the muram really difficult. I was just wondering if the increased code complexity was worth it, especially seeing how the
cpm_serialcode in the boot wrapper seem quite unstable.Unstable in what way?
I was refering to the virtual-reg (non-)issue I mentionned below.
Quoted 11 lines
Quoted 3 lines
I'm not familiar with the boot wrapper code so I'm sometimes not very
confident in my assumptions, but isn't the handling of the
virtual-reg property incpm_console_initbroken ?Not as far as I can see.
Quoted 2 lines
If I'm not mistaken, getprop will return the address and size of the first resource and not the addresses of the first two resources.
No, it'll get as much of the virtual-reg property as will fit in the buffer. There's no size in virtual-reg.
Ah right. Sorry about the misunderstanding.
Quoted 7 lines
Quoted 3 lines
What is virtual-reg used for ? To report the virtual address without requiring a device tree walk ? Does it provide any information that
dt_xlate_regcan't find ?Yes, it tells you the virtual address when it's not an identity mapping.
It's not currently used on CPM platforms, but might be used down the
road with a QE device on 85xx.
Will the virtual-reg property on the muram node list the addresses of all muram chunks or the address of the first chunk only ?
Quoted 6 lines
Quoted 4 lines
Quoted 1 line
Even the end of the first reg resource would be OK.
If I use the end of the first resource, can I assume it spans
0x0000
-0x8000to set the default tx BD address inKconfig?No, especially seeing as it doesn't on any existing boards. :-)
I still need a default value :-) It obviously won't work for all boards.
Quoted 2 lines
You could set the default to just before
0x2000with board-specific exceptions, though.
We're getting a bit lost. I'll try to summarize the discussion.
- The muram node has a reg property that lists the offsets and sizes of all muram chunks, and an optional virtual-reg property that lists the virtual address of all chunks/the first chunk only.
- From the above information I can locate a section of muram at the end of the first chunk (easy) or at the end of the muram (not really difficult, just a bit more complex, especially if chunks are not sorted by their start address).
- Kconfig needs a default address for the tx BD. This depends on the allocation strategy (end of first chunk vs. end of last chunk). Is there some consistent default across QE devices ?
Signature · 9 lines
Laurent Pinchart CSE Semaphore Belgium Chaussée de Bruxelles, 732A B-1410 Waterloo Belgium T +32 (2) 387 42 59 F +32 (2) 387 42 75
Re: [PATCHv2 2/3] ep8248e: Reference SMC parameter RAM base in the device tree.
Quoted 7 lines · Laurent Pinchart
Quoted 3 lines · Scott Wood
Yes, it tells you the virtual address when it's not an identity mapping.
It's not currently used on CPM platforms, but might be used down the
road with a QE device on 85xx.Will the virtual-reg property on the muram node list the addresses of all muram chunks or the address of the first chunk only ?
It should list all the chunks. If you want the size of each chunk, just look at the reg property.
Quoted 8 lines
Quoted 6 lines
Quoted 4 lines
Quoted 1 line
Even the end of the first reg resource would be OK.
If I use the end of the first resource, can I assume it spans
0x0000
-0x8000to set the default tx BD address inKconfig?No, especially seeing as it doesn't on any existing boards. :-)
I still need a default value :-) It obviously won't work for all boards.
Just before 0x8000 won't work for any board, because that area is reserved on CPM2.
Quoted 9 lines
Quoted 2 lines
You could set the default to just before
0x2000with board-specific exceptions, though.We're getting a bit lost. I'll try to summarize the discussion.
- The muram node has a reg property that lists the offsets and sizes of all muram chunks, and an optional virtual-reg property that lists the virtual address of all chunks/the first chunk only.
Quoted 8 lines
- From the above information I can locate a section of muram at the end of the first chunk (easy) or at the end of the muram (not really difficult, just a bit more complex, especially if chunks are not sorted by their start address).
-
Kconfigneeds a default address for the tx BD. This depends on the allocation strategy (end of first chunk vs. end of last chunk). Is there some consistent default across QE devices ?
0x2000 minus sizeof(...) would be a good default for CPM1 and CPM2 (8280 has its first chunk go up to 0x4000, but for some reason that didn't get reflected in the dts for the one 8280 board in-tree).
-Scott
RE: [PATCHv2 2/3] ep8248e: Reference SMC parameter RAM base in thedevice tree.
Quoted 3 lines · Scott Wood
0x2000minus sizeof(...) would be a good default for CPM1 and CPM2 (8280 has its first chunk go up to0x4000, but for some reason that didn't get reflected in the dts for the one 8280 board in-tree).
Except that last time I tested it, it is not from 0 - 0x4000, but the extra 0x2000 is added from offset 0x9000.....
So 8280 has available muram from 0 - 0x2000 and 0x9000 - 0xb000
Re: [PATCHv2 2/3] ep8248e: Reference SMC parameter RAM base in thedevice tree.
Quoted 8 lines · Rune Torgersen
Quoted 3 lines · Scott Wood
0x2000minus sizeof(...) would be a good default for CPM1 and CPM2 (8280 has its first chunk go up to0x4000, but for some reason that didn't get reflected in the dts for the one 8280 board in-tree).Except that last time I tested it, it is not from 0 -
0x4000, but the extra0x2000is added from offset0x9000.....
So 8280 has available muram from 0 -0x2000and0x9000-0xb000
According to the docs, it has 0 - 0x4000 and 0x9000 - 0xc000.
-Scott
RE: [PATCHv2 2/3] ep8248e: Reference SMC parameter RAM base in thedevice tree.
Quoted 11 lines · Scott Wood
Quoted 8 lines · Rune Torgersen
Quoted 3 lines · Scott Wood
0x2000minus sizeof(...) would be a good default for CPM1 and CPM2 (8280 has its first chunk go up to0x4000, but for some reason that didn't get reflected in the dts for the one 8280 board in-tree).=20
Except that last time I tested it, it is not from 0 -0x4000, but the extra0x2000is added from offset0x9000.....
So 8280 has available muram from 0 -0x2000and0x9000-0xb000=20
According to the docs, it has 0 -0x4000and0x9000-0xc000.
I tried it on out 8280 board inhouse, and any addresses from 0x2000 to 0x3fff does not work with at least the MCC's.
(running ss7 with the extended ss7 microcode)
If I only used 0-0x2000 and 0x9000 to 0xB000 then it is happy.
v2 cover cpm2: Reset the CPM when early debugging is not enabled.
In reply to Laurent PinchartSimilarly to what is done for PQ1-based platforms, this patch resets the PQ2 Communication Processor Module in cpm2_reset() when early debugging is not enabled. This helps avoiding conflicts when the boot loader configured the CPM in an unexpected way.
--- arch/powerpc/sysdev/cpm2.c | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-)
arch/powerpc/sysdev/cpm2.c +6 -0
@@ -80,6 +80,12 @@ void __init cpm2_reset(void)/* Tell everyone where the comm processor resides. */ cpmp = &cpm2_immr->im_cpm; + +#ifndef CONFIG_PPC_EARLY_DEBUG_CPM +/* Reset the CPM. +*/ +cpm_command (CPM_CR_RST ,0 ); +#endif }static DEFINE_SPINLOCK (cmd_lock);
Signature · 13 lines
1.5.0 -- Laurent Pinchart CSE Semaphore Belgium Chaussée de Bruxelles, 732A B-1410 Waterloo Belgium T +32 (2) 387 42 59 F +32 (2) 387 42 75
Re: [PATCHv2 0/3] cpm2: Reset the CPM when early debugging is not enabled.
This one should of course have been PATCHv2 3/3.
Signature · 9 lines
Laurent Pinchart CSE Semaphore Belgium Chaussée de Bruxelles, 732A B-1410 Waterloo Belgium T +32 (2) 387 42 59 F +32 (2) 387 42 75