Re: [PATCH] Move ams driver to macintosh
Hi Benjamin, On Tue, 16 Nov 2010 15:33:25 +1100, Benjamin Herrenschmidt wrote: On Tue, 2010-10-05 at 12:10 +0200, Jean Delvare wrote: The ams driver isn't a hardware monitoring driver, so it shouldn't live under driver/hwmon. drivers/macintosh seems much more appropriate, as the driver is only useful on PowerBooks and iBooks. Going through backlog... Do you want me to carry this in powerpc or you'll deal with it directly ? Signed-off-by: Jean Delvare kh...@linux-fr.org Cc: Guenter Roeck guenter.ro...@ericsson.com Cc: Stelian Pop stel...@popies.net Cc: Michael Hanselmann linux-ker...@hansmi.ch Acked-by: Benjamin Herrenschmidt b...@kernel.crashing.org I'm glad you like this patch, as it has already been applied to Linus' tree ;) -- Jean Delvare ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: Corrected data type mismatch
[added cc's based on from ff10b88b5a05c8f1646dd15fb9f6093c1384ff6d, which added the patched line ] https://patchwork.kernel.org/patch/323022/ On Sun, 14 Nov 2010 around 02:06:59 -, Hai Shan wrote: Corrected data type mismatch This merely hides the type mismatch by force casting it. Looking at the context I believe the intent is to copy the the value to or from the register content slot, not take the previous value of the register and use that as an address to copy to or from. milton Signed-off-by: Hai Shan shan@windriver.com --- arch/powerpc/kernel/kgdb.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/kernel/kgdb.c b/arch/powerpc/kernel/kgdb.c index 7a9db64..c5ce65f 100644 --- a/arch/powerpc/kernel/kgdb.c +++ b/arch/powerpc/kernel/kgdb.c @@ -337,7 +337,7 @@ char *dbg_get_reg(int regno, void *mem, struct pt_regs *regs) /* FP registers 32 - 63 */ #if defined(CONFIG_FSL_BOOKE) defined(CONFIG_SPE) if (current) - memcpy(mem, current-thread.evr[regno-32], + memcpy(mem, (void *)current-thread.evr[regno-32], dbg_reg_def[regno].size); #else /* fp registers not used by kernel, leave zero */ @@ -362,7 +362,7 @@ int dbg_set_reg(int regno, void *mem, struct pt_regs *regs) if (regno = 32 regno 64) { /* FP registers 32 - 63 */ #if defined(CONFIG_FSL_BOOKE) defined(CONFIG_SPE) - memcpy(current-thread.evr[regno-32], mem, + memcpy((void *)current-thread.evr[regno-32], mem, dbg_reg_def[regno].size); #else /* fp registers not used by kernel, leave zero */ ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [PATCH] Fix float to unsigned conversion failure with SPE enabled
On Sat, Nov 13, 2010 at 11:11 PM, Hai Shan haishan@gmail.com wrote: Fixed the failure on converting minus float to unsigned int with SPE enabled Signed-off-by: Hai Shan shan@windriver.com You should make sure to send PowerPC patches to linuxppc-dev. josh --- arch/powerpc/math-emu/math_efp.c | 17 + 1 files changed, 13 insertions(+), 4 deletions(-) diff --git a/arch/powerpc/math-emu/math_efp.c b/arch/powerpc/math-emu/math_efp.c index 41f4ef3..338a128 100644 --- a/arch/powerpc/math-emu/math_efp.c +++ b/arch/powerpc/math-emu/math_efp.c @@ -320,7 +320,9 @@ int do_spe_mathemu(struct pt_regs *regs) } else { _FP_ROUND_ZERO(1, SB); } - FP_TO_INT_S(vc.wp[1], SB, 32, ((func 0x3) != 0)); + /* SB_s: convert from minus float to unsigned int */ + FP_TO_INT_S(vc.wp[1], SB, 32, + ((func 0x3) != 0) || SB_s); goto update_regs; default: @@ -458,7 +460,11 @@ cmp_s: } else { _FP_ROUND_ZERO(2, DB); } - FP_TO_INT_D(vc.wp[1], DB, 32, ((func 0x3) != 0)); + /* DB_s: convert from minus long double to + * unsigned long long + */ + FP_TO_INT_D(vc.wp[1], DB, 32, + ((func 0x3) != 0) || DB_s); goto update_regs; default: @@ -589,8 +595,11 @@ cmp_d: _FP_ROUND_ZERO(1, SB0); _FP_ROUND_ZERO(1, SB1); } - FP_TO_INT_S(vc.wp[0], SB0, 32, ((func 0x3) != 0)); - FP_TO_INT_S(vc.wp[1], SB1, 32, ((func 0x3) != 0)); + /* SB*_s: convert from minus float to unsigned int */ + FP_TO_INT_S(vc.wp[0], SB0, 32, + ((func 0x3) != 0) || SB0_s); + FP_TO_INT_S(vc.wp[1], SB1, 32, + ((func 0x3) != 0) || SB1_s); goto update_regs; default: -- 1.7.0.4 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/ ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [PATCH] powerpc: Update a comment
On Mon, Nov 15, 2010 at 3:21 AM, Alessio Igor Bogani abog...@texware.it wrote: The commit 5e3d20a remove bkl from startup code so setup_arch() it isn't called with bkl held anymore. Update the comment on top of that function. This work was supported by a hardware donation from the CE Linux Forum. You should make sure to send powerpc patches to linuxppc-dev. Signed-off-by: Alessio Igor Bogani abog...@texware.it --- arch/powerpc/kernel/setup_64.c | 5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-) diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c index 2a178b0..71f44e5 100644 --- a/arch/powerpc/kernel/setup_64.c +++ b/arch/powerpc/kernel/setup_64.c @@ -497,9 +497,8 @@ static void __init emergency_stack_init(void) } /* - * Called into from start_kernel, after lock_kernel has been called. - * Initializes bootmem, which is unsed to manage page allocation until - * mem_init is called. + * Called into from start_kernel this initializes bootmem, which is unsed + * to manage page allocation until mem_init is called. You might as well fix the typo while you're there. unsed-used josh ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: Corrected data type mismatch
Milton Miller wrote: [added cc's based on from ff10b88b5a05c8f1646dd15fb9f6093c1384ff6d, which added the patched line ] https://patchwork.kernel.org/patch/323022/ On Sun, 14 Nov 2010 around 02:06:59 -, Hai Shan wrote: Corrected data type mismatch This merely hides the type mismatch by force casting it. Looking at the context I believe the intent is to copy the the value to or from the register content slot, not take the previous value of the register and use that as an address to copy to or from. OOPS! It is wrong here, The right one should be as following: - memcpy(mem, current-thread.evr[regno-32], + memcpy(mem, (void*)current-thread.evr[regno-32], dbg_reg_def[regno].size); Thanks milton Shan.Hai, I will send out the fix to Jason ASAP. Dongdong milton Signed-off-by: Hai Shan shan@windriver.com --- arch/powerpc/kernel/kgdb.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/kernel/kgdb.c b/arch/powerpc/kernel/kgdb.c index 7a9db64..c5ce65f 100644 --- a/arch/powerpc/kernel/kgdb.c +++ b/arch/powerpc/kernel/kgdb.c @@ -337,7 +337,7 @@ char *dbg_get_reg(int regno, void *mem, struct pt_regs *regs) /* FP registers 32 - 63 */ #if defined(CONFIG_FSL_BOOKE) defined(CONFIG_SPE) if (current) - memcpy(mem, current-thread.evr[regno-32], + memcpy(mem, (void *)current-thread.evr[regno-32], dbg_reg_def[regno].size); #else /* fp registers not used by kernel, leave zero */ @@ -362,7 +362,7 @@ int dbg_set_reg(int regno, void *mem, struct pt_regs *regs) if (regno = 32 regno 64) { /* FP registers 32 - 63 */ #if defined(CONFIG_FSL_BOOKE) defined(CONFIG_SPE) - memcpy(current-thread.evr[regno-32], mem, + memcpy((void *)current-thread.evr[regno-32], mem, dbg_reg_def[regno].size); #else /* fp registers not used by kernel, leave zero */ ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
[PATCH] kgdb, ppc: Corrected the address using of current-thread.evr register
Passing the address of current-thread.evr register to memcpy function. Signed-off-by: Dongdong Deng dongdong.d...@windriver.com CC: Hai Shan shan@windriver.com CC: Milton Miller milt...@bga.com CC: linuxppc-dev@lists.ozlabs.org --- arch/powerpc/kernel/kgdb.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/kernel/kgdb.c b/arch/powerpc/kernel/kgdb.c index 7a9db64..781acff 100644 --- a/arch/powerpc/kernel/kgdb.c +++ b/arch/powerpc/kernel/kgdb.c @@ -337,7 +337,7 @@ char *dbg_get_reg(int regno, void *mem, struct pt_regs *regs) /* FP registers 32 - 63 */ #if defined(CONFIG_FSL_BOOKE) defined(CONFIG_SPE) if (current) - memcpy(mem, current-thread.evr[regno-32], + memcpy(mem, (void *)current-thread.evr[regno-32], dbg_reg_def[regno].size); #else /* fp registers not used by kernel, leave zero */ @@ -362,7 +362,7 @@ int dbg_set_reg(int regno, void *mem, struct pt_regs *regs) if (regno = 32 regno 64) { /* FP registers 32 - 63 */ #if defined(CONFIG_FSL_BOOKE) defined(CONFIG_SPE) - memcpy(current-thread.evr[regno-32], mem, + memcpy((void *)current-thread.evr[regno-32], mem, dbg_reg_def[regno].size); #else /* fp registers not used by kernel, leave zero */ -- 1.6.0.4 ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [Kgdb-bugreport] [PATCH] kgdb, ppc: Corrected the address using of current-thread.evr register
Hello. On 16-11-2010 15:58, Dongdong Deng wrote: Passing the address of current-thread.evr register to memcpy function. Signed-off-by: Dongdong Dengdongdong.d...@windriver.com CC: Hai Shanshan@windriver.com CC: Milton Millermilt...@bga.com CC: linuxppc-dev@lists.ozlabs.org --- arch/powerpc/kernel/kgdb.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/kernel/kgdb.c b/arch/powerpc/kernel/kgdb.c index 7a9db64..781acff 100644 --- a/arch/powerpc/kernel/kgdb.c +++ b/arch/powerpc/kernel/kgdb.c @@ -337,7 +337,7 @@ char *dbg_get_reg(int regno, void *mem, struct pt_regs *regs) /* FP registers 32 - 63 */ #if defined(CONFIG_FSL_BOOKE) defined(CONFIG_SPE) if (current) - memcpy(mem, current-thread.evr[regno-32], + memcpy(mem, (void *)current-thread.evr[regno-32], dbg_reg_def[regno].size); #else /* fp registers not used by kernel, leave zero */ @@ -362,7 +362,7 @@ int dbg_set_reg(int regno, void *mem, struct pt_regs *regs) if (regno= 32 regno 64) { /* FP registers 32 - 63 */ #if defined(CONFIG_FSL_BOOKE) defined(CONFIG_SPE) - memcpy(current-thread.evr[regno-32], mem, + memcpy((void *)current-thread.evr[regno-32], mem, Doesn't any pointer type get converted to 'void *' automatically? These casts are not really needed... WBR, Sergei ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: Corrected data type mismatch
On Nov 16, 2010, at 8:07 PM, DDD wrote: Milton Miller wrote: [added cc's based on from ff10b88b5a05c8f1646dd15fb9f6093c1384ff6d, which added the patched line ] https://patchwork.kernel.org/patch/323022/ On Sun, 14 Nov 2010 around 02:06:59 -, Hai Shan wrote: Corrected data type mismatch This merely hides the type mismatch by force casting it. Looking at the context I believe the intent is to copy the the value to or from the register content slot, not take the previous value of the register and use that as an address to copy to or from. OOPS! It is wrong here, The right one should be as following: - memcpy(mem, current-thread.evr[regno-32], + memcpy(mem, (void*)current-thread.evr[regno-32], dbg_reg_def[regno].size); Thanks milton Shan.Hai, I will send out the fix to Jason ASAP. Sorry for my crude fix :) Dongdong milton Signed-off-by: Hai Shan shan@windriver.com --- arch/powerpc/kernel/kgdb.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/kernel/kgdb.c b/arch/powerpc/kernel/kgdb.c index 7a9db64..c5ce65f 100644 --- a/arch/powerpc/kernel/kgdb.c +++ b/arch/powerpc/kernel/kgdb.c @@ -337,7 +337,7 @@ char *dbg_get_reg(int regno, void *mem, struct pt_regs *regs) /* FP registers 32 - 63 */ #if defined(CONFIG_FSL_BOOKE) defined(CONFIG_SPE) if (current) - memcpy(mem, current-thread.evr[regno-32], + memcpy(mem, (void *)current-thread.evr[regno-32], dbg_reg_def[regno].size); #else /* fp registers not used by kernel, leave zero */ @@ -362,7 +362,7 @@ int dbg_set_reg(int regno, void *mem, struct pt_regs *regs) if (regno = 32 regno 64) { /* FP registers 32 - 63 */ #if defined(CONFIG_FSL_BOOKE) defined(CONFIG_SPE) - memcpy(current-thread.evr[regno-32], mem, + memcpy((void *)current-thread.evr[regno-32], mem, dbg_reg_def[regno].size); #else /* fp registers not used by kernel, leave zero */ -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/ ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
RE: [PATCH][v3] fsl_rio: move machine_check handler into machine_check_e500 machine_check_e500mc
From: Xie Shaohui-B21989 [mailto:b21...@freescale.com] Ok, I'll remove the ret, do you have any comment for the error handler patch? http://patchwork.ozlabs.org/patch/69962/ I will reply to the original patch message. Alex. ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
RE: [PATCH 4/4][v2] rapidio, powerpc/85xx: Error interrupt handler for sRIO.
From: Shaohui Xie [mailto:b21...@freescale.com] The sRIO controller reports errors to the core with one signal, it uses register EPWISR to provides the core quick access to where the error occurred. The EPWISR indicates that there are 4 interrupts sources, port1, port2, message unit and port write receive, but the sRIO driver does not support port2 for now, still the handler takes care of port2. Currently the handler only clear error status without any recovery. Do these dual-RIO controllers have only one port-write interrupt? (sorry, user manuals are not available for download from FSL). @@ -1082,14 +1142,24 @@ fsl_rio_port_write_handler(int irq, void *dev_instance) ipwsr = in_be32(priv-msg_regs-pwsr); epwisr = in_be32(priv-regs_win + RIO_EPWISR); - if (epwisr 0x8000) { + if (epwisr EPWISR_ERR_PINT1) { tmp = in_be32(priv-regs_win + RIO_LTLEDCSR); pr_info(RIO_LTLEDCSR = 0x%x\n, tmp); - out_be32(priv-regs_win + RIO_LTLEDCSR, 0); + port_error_handler(port, 0); + } + + if (epwisr EPWISR_ERR_PINT2) { + pr_info(RIO: port2 error\n); + port_error_handler(port, 1); + } + + if (epwisr EPWISR_ERR_MU) { + pr_info(RIO: message unit error\n); + msg_unit_error_handler(port); } - if (!(epwisr 0x0001)) - return IRQ_HANDLED; + if (!(epwisr EPWISR_ERR_PW)) + return IRQ_NONE; #ifdef DEBUG_PW pr_debug(PW Int-IPWMR: 0x%08x IPWSR: 0x%08x (, ipwmr, ipwsr); This part is out of sync with mainline code tree (37-rc1). Probably it should be updated to make it easier to apply your patch. Besides that, works as expected on my RIO setup. Regards, Alex. ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
RE: Corrected data type mismatch
OOPS! It is wrong here, The right one should be as following: - memcpy(mem, current-thread.evr[regno-32], + memcpy(mem, (void*)current-thread.evr[regno-32], dbg_reg_def[regno].size); The (void *) cast should be unnecessary David ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
[PATCH] powerpc: Update a comment
The commit 5e3d20a remove bkl from startup code so setup_arch() it isn't called with bkl held anymore. Update the comment on top of that function. Fix also a typo. This work was supported by a hardware donation from the CE Linux Forum. Signed-off-by: Alessio Igor Bogani abog...@texware.it --- arch/powerpc/kernel/setup_64.c |5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-) diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c index 2a178b0..ce6f61c 100644 --- a/arch/powerpc/kernel/setup_64.c +++ b/arch/powerpc/kernel/setup_64.c @@ -497,9 +497,8 @@ static void __init emergency_stack_init(void) } /* - * Called into from start_kernel, after lock_kernel has been called. - * Initializes bootmem, which is unsed to manage page allocation until - * mem_init is called. + * Called into from start_kernel this initializes bootmem, which is used + * to manage page allocation until mem_init is called. */ void __init setup_arch(char **cmdline_p) { -- 1.7.0.4 ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [PATCH] Move ams driver to macintosh
On Tue, 2010-11-16 at 08:59 +0100, Jean Delvare wrote: Going through backlog... Do you want me to carry this in powerpc or you'll deal with it directly ? Signed-off-by: Jean Delvare kh...@linux-fr.org Cc: Guenter Roeck guenter.ro...@ericsson.com Cc: Stelian Pop stel...@popies.net Cc: Michael Hanselmann linux-ker...@hansmi.ch Acked-by: Benjamin Herrenschmidt b...@kernel.crashing.org I'm glad you like this patch, as it has already been applied to Linus' tree ;) Hah, you guys are too quick :-) Cheers, Ben. ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
[PATCH 0/5] Series short description
The following series implements a set of changes to refactor dts (device tree source) files for systems using the mpc5200b SoC. The dtc changes allow a base dts to be defined in a common dts file included with '/include/ filename'. This base dts can then be updated and modified by merging in a second device tree defined in the system specific dts file. The rest of the changes are the refactoring of the mpc5200b dts files. --- John Bonesio (5): scripts: dtc: Merge in changes from the dtc repository powerpc/5200: dts: rename nodes to prepare for refactoring dts files powerpc/5200: dts: remove unused properties powerpc/5200: dts: Remove incorrect combatible strings powerpc/5200: dts: refactor dts files arch/powerpc/boot/dts/cm5200.dts| 198 +++-- arch/powerpc/boot/dts/digsy_mtc.dts | 179 +++ arch/powerpc/boot/dts/lite5200b.dts | 210 ++- arch/powerpc/boot/dts/media5200.dts | 216 +++ arch/powerpc/boot/dts/motionpro.dts | 198 +++-- arch/powerpc/boot/dts/mpc5200b.dtsi | 276 +++ arch/powerpc/boot/dts/mucmc52.dts | 176 ++ arch/powerpc/boot/dts/pcm030.dts| 201 ++--- arch/powerpc/boot/dts/pcm032.dts| 205 ++ arch/powerpc/boot/dts/uc101.dts | 162 - 10 files changed, 499 insertions(+), 1522 deletions(-) create mode 100644 arch/powerpc/boot/dts/mpc5200b.dtsi -- Signature ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
[PATCH 2/5] powerpc/5200: dts: rename nodes to prepare for refactoring dts files
This patch renames nodes in dts fils for MPC5200b files to prepare for refactoring of these files later. When refactoring it will be easier to verify the results if the node names aren't changing at the same time. Signed-off-by: John Bonesio bo...@secretlab.ca --- arch/powerpc/boot/dts/cm5200.dts|8 arch/powerpc/boot/dts/digsy_mtc.dts |6 +++--- arch/powerpc/boot/dts/lite5200b.dts |2 +- arch/powerpc/boot/dts/media5200.dts |2 +- arch/powerpc/boot/dts/motionpro.dts | 10 +- arch/powerpc/boot/dts/mucmc52.dts |6 +++--- arch/powerpc/boot/dts/pcm030.dts|6 +++--- arch/powerpc/boot/dts/pcm032.dts|6 +++--- arch/powerpc/boot/dts/uc101.dts |6 +++--- 9 files changed, 26 insertions(+), 26 deletions(-) diff --git a/arch/powerpc/boot/dts/cm5200.dts b/arch/powerpc/boot/dts/cm5200.dts index dd38608..9369dcd 100644 --- a/arch/powerpc/boot/dts/cm5200.dts +++ b/arch/powerpc/boot/dts/cm5200.dts @@ -160,25 +160,25 @@ reg = 0x1f00 0x100; }; - ser...@2000 { // PSC1 + p...@2000 { // PSC1 compatible = fsl,mpc5200b-psc-uart,fsl,mpc5200-psc-uart; reg = 0x2000 0x100; interrupts = 2 1 0; }; - ser...@2200 { // PSC2 + p...@2200 { // PSC2 compatible = fsl,mpc5200b-psc-uart,fsl,mpc5200-psc-uart; reg = 0x2200 0x100; interrupts = 2 2 0; }; - ser...@2400 { // PSC3 + p...@2400 { // PSC3 compatible = fsl,mpc5200b-psc-uart,fsl,mpc5200-psc-uart; reg = 0x2400 0x100; interrupts = 2 3 0; }; - ser...@2c00 { // PSC6 + p...@2c00 { // PSC6 compatible = fsl,mpc5200b-psc-uart,fsl,mpc5200-psc-uart; reg = 0x2c00 0x100; interrupts = 2 4 0; diff --git a/arch/powerpc/boot/dts/digsy_mtc.dts b/arch/powerpc/boot/dts/digsy_mtc.dts index 8e9be6b..f0592de 100644 --- a/arch/powerpc/boot/dts/digsy_mtc.dts +++ b/arch/powerpc/boot/dts/digsy_mtc.dts @@ -155,13 +155,13 @@ reg = 0x1f00 0x100; }; - ser...@2600 { // PSC4 + p...@2600 { // PSC4 compatible = fsl,mpc5200b-psc-uart,fsl,mpc5200-psc-uart; reg = 0x2600 0x100; interrupts = 2 11 0; }; - ser...@2800 { // PSC5 + p...@2800 { // PSC5 compatible = fsl,mpc5200b-psc-uart,fsl,mpc5200-psc-uart; reg = 0x2800 0x100; interrupts = 2 12 0; @@ -217,7 +217,7 @@ }; }; - lpb { + localbus { compatible = fsl,mpc5200b-lpb,simple-bus; #address-cells = 2; #size-cells = 1; diff --git a/arch/powerpc/boot/dts/lite5200b.dts b/arch/powerpc/boot/dts/lite5200b.dts index 59702ac..a74b790 100644 --- a/arch/powerpc/boot/dts/lite5200b.dts +++ b/arch/powerpc/boot/dts/lite5200b.dts @@ -172,7 +172,7 @@ reg = 0x1f00 0x100; }; - ser...@2000 { // PSC1 + p...@2000 { // PSC1 compatible = fsl,mpc5200b-psc-uart,fsl,mpc5200-psc-uart; cell-index = 0; reg = 0x2000 0x100; diff --git a/arch/powerpc/boot/dts/media5200.dts b/arch/powerpc/boot/dts/media5200.dts index 0c3902b..a70ef68 100644 --- a/arch/powerpc/boot/dts/media5200.dts +++ b/arch/powerpc/boot/dts/media5200.dts @@ -183,7 +183,7 @@ }; // PSC6 in uart mode - console: ser...@2c00 { // PSC6 + console: p...@2c00 {// PSC6 compatible = fsl,mpc5200b-psc-uart,fsl,mpc5200-psc-uart; cell-index = 5; port-number = 0; // Logical port assignment diff --git a/arch/powerpc/boot/dts/motionpro.dts b/arch/powerpc/boot/dts/motionpro.dts index 6ca4fc1..f6261ea 100644 --- a/arch/powerpc/boot/dts/motionpro.dts +++ b/arch/powerpc/boot/dts/motionpro.dts @@ -100,7 +100,7 @@ interrupts = 1 14 0; }; - motionpro-...@660 { // Motion-PRO status LED + ti...@660 { // Motion-PRO status LED compatible = promess,motionpro-led; label = motionpro-statusled; reg = 0x660 0x10; @@ -108,7 +108,7 @@ blink-delay = 100; //
[PATCH 3/5] powerpc/5200: dts: remove unused properties
This patch remove unused properties in dts files in preparation of refactoring the dts files for MPC5200b based boards. Signed-off-by: John Bonesio bo...@secretlab.ca --- arch/powerpc/boot/dts/cm5200.dts|2 -- arch/powerpc/boot/dts/lite5200b.dts |3 --- arch/powerpc/boot/dts/media5200.dts |2 -- arch/powerpc/boot/dts/motionpro.dts |2 -- arch/powerpc/boot/dts/pcm030.dts|2 -- arch/powerpc/boot/dts/pcm032.dts|2 -- 6 files changed, 0 insertions(+), 13 deletions(-) diff --git a/arch/powerpc/boot/dts/cm5200.dts b/arch/powerpc/boot/dts/cm5200.dts index 9369dcd..d549897 100644 --- a/arch/powerpc/boot/dts/cm5200.dts +++ b/arch/powerpc/boot/dts/cm5200.dts @@ -230,8 +230,6 @@ reg = 0 0 0x200; bank-width = 2; device-width = 2; - #size-cells = 1; - #address-cells = 1; }; }; }; diff --git a/arch/powerpc/boot/dts/lite5200b.dts b/arch/powerpc/boot/dts/lite5200b.dts index a74b790..c0a4e45 100644 --- a/arch/powerpc/boot/dts/lite5200b.dts +++ b/arch/powerpc/boot/dts/lite5200b.dts @@ -174,7 +174,6 @@ p...@2000 { // PSC1 compatible = fsl,mpc5200b-psc-uart,fsl,mpc5200-psc-uart; - cell-index = 0; reg = 0x2000 0x100; interrupts = 2 1 0; }; @@ -198,7 +197,6 @@ // PSC4 in uart mode example //ser...@2600 { // PSC4 // compatible = fsl,mpc5200b-psc-uart,fsl,mpc5200-psc-uart; - // cell-index = 3; // reg = 0x2600 0x100; // interrupts = 2 11 0; //}; @@ -206,7 +204,6 @@ // PSC5 in uart mode example //ser...@2800 { // PSC5 // compatible = fsl,mpc5200b-psc-uart,fsl,mpc5200-psc-uart; - // cell-index = 4; // reg = 0x2800 0x100; // interrupts = 2 12 0; //}; diff --git a/arch/powerpc/boot/dts/media5200.dts b/arch/powerpc/boot/dts/media5200.dts index a70ef68..e027f45 100644 --- a/arch/powerpc/boot/dts/media5200.dts +++ b/arch/powerpc/boot/dts/media5200.dts @@ -185,8 +185,6 @@ // PSC6 in uart mode console: p...@2c00 {// PSC6 compatible = fsl,mpc5200b-psc-uart,fsl,mpc5200-psc-uart; - cell-index = 5; - port-number = 0; // Logical port assignment reg = 0x2c00 0x100; interrupts = 2 4 0; }; diff --git a/arch/powerpc/boot/dts/motionpro.dts b/arch/powerpc/boot/dts/motionpro.dts index f6261ea..3ab4666 100644 --- a/arch/powerpc/boot/dts/motionpro.dts +++ b/arch/powerpc/boot/dts/motionpro.dts @@ -277,8 +277,6 @@ reg = 0 0 0x0100; bank-width = 2; device-width = 2; - #size-cells = 1; - #address-cells = 1; }; }; }; diff --git a/arch/powerpc/boot/dts/pcm030.dts b/arch/powerpc/boot/dts/pcm030.dts index 3a4f554..f3e30bb 100644 --- a/arch/powerpc/boot/dts/pcm030.dts +++ b/arch/powerpc/boot/dts/pcm030.dts @@ -196,7 +196,6 @@ p...@2400 { /* PSC3 in UART mode */ compatible = fsl,mpc5200b-psc-uart,fsl,mpc5200-psc-uart; - cell-index = 2; reg = 0x2400 0x100; interrupts = 2 3 0; }; @@ -207,7 +206,6 @@ p...@2c00 { /* PSC6 in UART mode */ compatible = fsl,mpc5200b-psc-uart,fsl,mpc5200-psc-uart; - cell-index = 5; reg = 0x2c00 0x100; interrupts = 2 4 0; }; diff --git a/arch/powerpc/boot/dts/pcm032.dts b/arch/powerpc/boot/dts/pcm032.dts index 17596c7..e0f2702 100644 --- a/arch/powerpc/boot/dts/pcm032.dts +++ b/arch/powerpc/boot/dts/pcm032.dts @@ -196,7 +196,6 @@ p...@2400 { /* PSC3 in UART mode */ compatible = fsl,mpc5200b-psc-uart,fsl,mpc5200-psc-uart; - cell-index = 2; reg = 0x2400 0x100; interrupts = 2 3 0; }; @@ -207,7 +206,6 @@ p...@2c00 { /* PSC6 in UART mode */ compatible = fsl,mpc5200b-psc-uart,fsl,mpc5200-psc-uart; - cell-index = 5; reg = 0x2c00 0x100; interrupts = 2 4 0; }; ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
[PATCH 4/5] powerpc/5200: dts: Remove incorrect combatible strings
This patch removes some incorrect compatible strings on the local plus bus node in dts files for MPC5200b based systems. Signed-off-by: John Bonesio bo...@secretlab.ca --- arch/powerpc/boot/dts/lite5200b.dts |2 +- arch/powerpc/boot/dts/mucmc52.dts |2 +- arch/powerpc/boot/dts/pcm032.dts|2 +- arch/powerpc/boot/dts/uc101.dts |2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/powerpc/boot/dts/lite5200b.dts b/arch/powerpc/boot/dts/lite5200b.dts index c0a4e45..ed8d7ae 100644 --- a/arch/powerpc/boot/dts/lite5200b.dts +++ b/arch/powerpc/boot/dts/lite5200b.dts @@ -295,7 +295,7 @@ }; localbus { - compatible = fsl,mpc5200b-lpb,fsl,mpc5200-lpb,simple-bus; + compatible = fsl,mpc5200b-lpb,simple-bus; #address-cells = 2; #size-cells = 1; diff --git a/arch/powerpc/boot/dts/mucmc52.dts b/arch/powerpc/boot/dts/mucmc52.dts index 8dc212d..b9d3559 100644 --- a/arch/powerpc/boot/dts/mucmc52.dts +++ b/arch/powerpc/boot/dts/mucmc52.dts @@ -217,7 +217,7 @@ }; localbus { - compatible = fsl,mpc5200b-lpb,fsl,mpc5200-lpb,simple-bus; + compatible = fsl,mpc5200b-lpb,simple-bus; #address-cells = 2; #size-cells = 1; diff --git a/arch/powerpc/boot/dts/pcm032.dts b/arch/powerpc/boot/dts/pcm032.dts index e0f2702..085a646 100644 --- a/arch/powerpc/boot/dts/pcm032.dts +++ b/arch/powerpc/boot/dts/pcm032.dts @@ -292,7 +292,7 @@ }; localbus { - compatible = fsl,mpc5200b-lpb,fsl,mpc5200-lpb,simple-bus; + compatible = fsl,mpc5200b-lpb,simple-bus; #address-cells = 2; #size-cells = 1; diff --git a/arch/powerpc/boot/dts/uc101.dts b/arch/powerpc/boot/dts/uc101.dts index e00441a..70299a4 100644 --- a/arch/powerpc/boot/dts/uc101.dts +++ b/arch/powerpc/boot/dts/uc101.dts @@ -229,7 +229,7 @@ }; localbus { - compatible = fsl,mpc5200b-lpb,fsl,mpc5200-lpb,simple-bus; + compatible = fsl,mpc5200b-lpb,simple-bus; #address-cells = 2; #size-cells = 1; ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [PATCH 2/2] powerpc: pcm030/032: add pagesize to dts
Even worse, I seem to recall that I had once seen a manufacturer increasing the page-size from one charge to the next without changing the part-number, so I got this feeling you can't map pagesize to manufacturer/type which I still have. Sadly, this was long ago, so I can't proof it right now. Will try to dig up some datasheets when in the office tomorrow. Had a look, couldn't find anything :( And now? Regards, Wolfram -- Pengutronix e.K. | Wolfram Sang| Industrial Linux Solutions | http://www.pengutronix.de/ | signature.asc Description: Digital signature ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [PATCH] kgdb, ppc: Corrected the address using of current-thread.evr register
On 11/16/2010 06:58 AM, Dongdong Deng wrote: Passing the address of current-thread.evr register to memcpy function. It turns out that out of all of my test configs and targets I did not have any that defined both CONFIG_FSL_BOOKE and CONFIG_SPE else this would have been caught in testing because will definitely crash dereferencing the contents of the evr registers. Signed-off-by: Dongdong Deng dongdong.d...@windriver.com CC: Hai Shan shan@windriver.com CC: Milton Miller milt...@bga.com CC: linuxppc-dev@lists.ozlabs.org --- arch/powerpc/kernel/kgdb.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/kernel/kgdb.c b/arch/powerpc/kernel/kgdb.c index 7a9db64..781acff 100644 --- a/arch/powerpc/kernel/kgdb.c +++ b/arch/powerpc/kernel/kgdb.c @@ -337,7 +337,7 @@ char *dbg_get_reg(int regno, void *mem, struct pt_regs *regs) /* FP registers 32 - 63 */ #if defined(CONFIG_FSL_BOOKE) defined(CONFIG_SPE) if (current) - memcpy(mem, current-thread.evr[regno-32], + memcpy(mem, (void *)current-thread.evr[regno-32], dbg_reg_def[regno].size); As Sergei already pointed out, the (void *) casts should not be needed here. This would have been fixed correctly had I seen the compile warnings from the CONFIG_SPE at the test phase. Namely at the compile phase doesn't even complete: arch/powerpc/kernel/kgdb.c: In function 'dbg_get_reg': arch/powerpc/kernel/kgdb.c:341: error: passing argument 2 of 'memcpy' makes pointer from integer without a cast arch/powerpc/include/asm/string.h:25: note: expected 'const void *' but argument is of type 'long unsigned int' arch/powerpc/kernel/kgdb.c: In function 'dbg_set_reg': arch/powerpc/kernel/kgdb.c:366: error: passing argument 1 of 'memcpy' makes pointer from integer without a cast arch/powerpc/include/asm/string.h:25: note: expected 'void *' but argument is of type 'long unsigned int' Moral of the story... I now have a board and config with the SPE turned on, and after boot testing confirmed the evr registers are working. I plan to have a pull request out to Linus with this fix and several other accumulated regression fixes sometime in the next 48 hours. Thanks, Jason. ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [PATCH 2/2] powerpc: pcm030/032: add pagesize to dts
On Tue, Nov 16, 2010 at 10:45:37PM +0100, Wolfram Sang wrote: Even worse, I seem to recall that I had once seen a manufacturer increasing the page-size from one charge to the next without changing the part-number, so I got this feeling you can't map pagesize to manufacturer/type which I still have. Sadly, this was long ago, so I can't proof it right now. Will try to dig up some datasheets when in the office tomorrow. Had a look, couldn't find anything :( And now? Well, it seems that there are enough people in pagesize camp anyway, I'd say just go ahead with the current approach. :-) It's an additional information, so won't do any harm anyway... Thanks, -- Anton Vorontsov email: cbouatmai...@gmail.com irc://irc.freenode.net/bd2 ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
[PATCH 0/5] Add the ability to link device blobs into vmlinux
From: Dirk Brandewie dirk.brande...@gmail.com This patch set adds the ability to link device tree blob(s) directly into the vmlinux image and specify the blob to be used via a kernel command line option. Patch 1 implements the changes to include/asm-generic/vmlinux.lds.h, add generic rules for building and linking the DTB's into vmlinux. Patch 2 adds the command line option, the functions for the platform code to retrieve the value passed in and locate the matching blob in the image. This patch has been tested on x86. Patch 3-5 show using the generic dts-dtb rule in x86, microblaze and powerpc. The microblaze and powerpc patches have only been compile tested. Dirk Brandewie (5): of: Add support for linking device tree blobs into vmlinux of/fdt: add kernel command line option for dtb_compat string x86/of: Add building device tree blob(s) into image. of/powerpc: Move build to use generic dts-dtb rule of/microblaze: Move build to use generic dts-dtb rule Documentation/kernel-parameters.txt |7 + arch/microblaze/boot/Makefile | 13 + arch/powerpc/boot/Makefile |7 - arch/x86/Kconfig|6 +++- arch/x86/kernel/Makefile|6 arch/x86/kernel/dts/Kconfig |7 + drivers/of/fdt.c| 52 +++ include/asm-generic/vmlinux.lds.h | 19 +++- include/linux/of_fdt.h |4 +++ scripts/Makefile.lib| 20 + 10 files changed, 119 insertions(+), 22 deletions(-) create mode 100644 arch/x86/kernel/dts/Kconfig -- 1.7.2.3 ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
[PATCH 1/5] of: Add support for linking device tree blobs into vmlinux
From: Dirk Brandewie dirk.brande...@gmail.com This patch adds support for linking device tree blobs into vmlinux. Modifies asm-generic/vmlinux.lds.h to add linking .dtb.init.rodata sections into the .init.data section of the vmlinux image. Modifies scripts/Makefile.lib to add a kbuild command to compile DTS files to device tree blobs and a rule to create objects to wrap the blobs for linking. The DTB's are placed on 32 byte boundries to allow parsing the blob with driver/of/fdt.c during early boot without having to copy the blob to get the structure alignment GCC expects. A DTB is linked in by adding the DTB object to the list of objects to be linked into vmlinux in the archtecture specific Makefile using obj-y += foo.dtb.o Signed-off-by: Dirk Brandewie dirk.brande...@gmail.com --- include/asm-generic/vmlinux.lds.h | 19 +-- scripts/Makefile.lib | 20 2 files changed, 37 insertions(+), 2 deletions(-) diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h index bd69d79..ea671e7 100644 --- a/include/asm-generic/vmlinux.lds.h +++ b/include/asm-generic/vmlinux.lds.h @@ -67,7 +67,14 @@ * Align to a 32 byte boundary equal to the * alignment gcc 4.5 uses for a struct */ -#define STRUCT_ALIGN() . = ALIGN(32) +#define STRUCT_ALIGNMENT 32 +#define STRUCT_ALIGN() . = ALIGN(STRUCT_ALIGNMENT) + +/* Device tree blobs linked into the kernel need to have proper + * structure alignment to be parsed by the flat device tree library + * used in early boot +*/ +#define DTB_ALIGNMENT STRUCT_ALIGNMENT /* The actual configuration determine if the init/exit sections * are handled as text/data or they can be discarded (which @@ -146,6 +153,13 @@ #define TRACE_SYSCALLS() #endif + +#define KERNEL_DTB() \ + . = ALIGN(DTB_ALIGNMENT); \ + VMLINUX_SYMBOL(__dtb_start) = .;\ + *(.dtb.init.rodata) \ + VMLINUX_SYMBOL(__dtb_end) = .; + /* .data section */ #define DATA_DATA \ *(.data)\ @@ -468,7 +482,8 @@ MCOUNT_REC()\ DEV_DISCARD(init.rodata)\ CPU_DISCARD(init.rodata)\ - MEM_DISCARD(init.rodata) + MEM_DISCARD(init.rodata)\ + KERNEL_DTB() #define INIT_TEXT \ *(.init.text) \ diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib index 4c72c11..29db062 100644 --- a/scripts/Makefile.lib +++ b/scripts/Makefile.lib @@ -200,6 +200,26 @@ quiet_cmd_gzip = GZIP$@ cmd_gzip = (cat $(filter-out FORCE,$^) | gzip -f -9 $@) || \ (rm -f $@ ; false) +# DTC +# --- +$(obj)/%.dtb.S: $(obj)/%.dtb FORCE + @echo '#include asm-generic/vmlinux.lds.h' $@ + @echo '.section .dtb.init.rodata,a' $@ + @echo '.balign DTB_ALIGNMENT' $@ + @echo '.global __dtb_$(*F)_begin' $@ + @echo '__dtb_$(*F)_begin:' $@ + @echo '.incbin $ ' $@ + @echo '__dtb_$(*F)_end:' $@ + @echo '.global __dtb_$(*F)_end' $@ + @echo '.balign DTB_ALIGNMENT' $@ + +DTC = $(objtree)/scripts/dtc/dtc + +quiet_cmd_dtc = DTC$@ + cmd_dtc = $(DTC) -O dtb -o $(obj)/$*.dtb -b 0 $(DTS_FLAGS) $(src)/dts/$*.dts + +$(obj)/%.dtb: $(src)/dts/%.dts + $(call if_changed,dtc) # Bzip2 # --- -- 1.7.2.3 ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
[PATCH 2/5] of/fdt: add kernel command line option for dtb_compat string
From: Dirk Brandewie dirk.brande...@gmail.com Adds a kernel command line option dtb_compat=string and functions for architecture/platform specific code to retrieve the command line string and locate the compatible DTB linked into the kernel of_flat_dt_get_dtb_compatible_string() returns a pointer string passed from the command line or a pointer to an empty string. of_flat_dt_find_compatible_dtb() returns a pointer to a DTB that is compatible with the compatible string or a NULL pointer if no matching DTB is present. Signed-off-by: Dirk Brandewie dirk.brande...@gmail.com --- Documentation/kernel-parameters.txt |7 + drivers/of/fdt.c| 52 +++ include/linux/of_fdt.h |4 +++ 3 files changed, 63 insertions(+), 0 deletions(-) diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt index ed45e98..f9b77fa 100644 --- a/Documentation/kernel-parameters.txt +++ b/Documentation/kernel-parameters.txt @@ -655,6 +655,13 @@ and is between 256 and 4096 characters. It is defined in the file dscc4.setup=[NET] + dtb_compat= [KNL] + Specify the compatible string for the device + tree blob present in the kernel image. This + string will be used to select the first device + tree blob whose compatible property matches + the string passed on the kernel commandline. + dynamic_printk Enables pr_debug()/dev_dbg() calls if CONFIG_DYNAMIC_PRINTK_DEBUG has been enabled. These can also be switched on/off via diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c index c1360e0..c0858ce 100644 --- a/drivers/of/fdt.c +++ b/drivers/of/fdt.c @@ -15,6 +15,8 @@ #include linux/of_fdt.h #include linux/string.h #include linux/errno.h +#include asm-generic/vmlinux.lds.h + #ifdef CONFIG_PPC #include asm/machdep.h @@ -604,3 +606,53 @@ void __init unflatten_device_tree(void) pr_debug( - unflatten_device_tree()\n); } + +#define MAX_DTB_COMPAT_STR 64 +char dtb_compat_name[MAX_DTB_COMPAT_STR] = ; + +char __init *of_flat_dt_get_dtb_compatible_string(void) +{ + return dtb_compat_name; +} + + +extern uint8_t __dtb_start[]; +extern uint8_t __dtb_end[]; +void __init *of_flat_dt_find_compatible_dtb(char *name) +{ + void *rc = NULL; + unsigned long root, size; + struct boot_param_header *orig_initial_boot_params; + uint8_t *blob; + + orig_initial_boot_params = initial_boot_params; + blob = __dtb_start; + initial_boot_params = (struct boot_param_header *)blob; + + while (blob __dtb_end + (be32_to_cpu(initial_boot_params-magic) == OF_DT_HEADER)) { + root = of_get_flat_dt_root(); + if (of_flat_dt_is_compatible(root, name) 0) { + rc = blob; + break; + } + + size = be32_to_cpu(initial_boot_params-totalsize); + blob = PTR_ALIGN(blob + size, DTB_ALIGNMENT); + initial_boot_params = (struct boot_param_header *)blob; + } + + if (rc == NULL) + initial_boot_params = orig_initial_boot_params; + return rc; +} + + +static int __init of_flat_dtb_compat_setup(char *line) +{ + strncpy(dtb_compat_name, line, MAX_DTB_COMPAT_STR); + return 1; +} + +early_param(dtb_compat, of_flat_dtb_compat_setup); + diff --git a/include/linux/of_fdt.h b/include/linux/of_fdt.h index 7bbf5b3..29561f4 100644 --- a/include/linux/of_fdt.h +++ b/include/linux/of_fdt.h @@ -58,6 +58,7 @@ struct boot_param_header { }; #if defined(CONFIG_OF_FLATTREE) + /* TBD: Temporary export of fdt globals - remove when code fully merged */ extern int __initdata dt_root_addr_cells; extern int __initdata dt_root_size_cells; @@ -82,6 +83,9 @@ extern void early_init_dt_add_memory_arch(u64 base, u64 size); extern u64 early_init_dt_alloc_memory_arch(u64 size, u64 align); extern u64 dt_mem_next_cell(int s, __be32 **cellp); +extern char *of_flat_dt_get_dtb_compatible_string(void); +extern void *of_flat_dt_find_compatible_dtb(char *name); + /* * If BLK_DEV_INITRD, the fdt early init code will call this function, * to be provided by the arch code. start and end are specified as -- 1.7.2.3 ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
[PATCH 3/5] x86/of: Add building device tree blob(s) into image.
From: Dirk Brandewie dirk.brande...@gmail.com This patch adds linking device tree blobs into vmlinux. DTB's are added by adding the blob object name to list of objects to be linked into the image. e.g: obj-$(CONFIG_TEST_DTB) += test.dtb.o The set of DTB linked into the image is controlled the Kconfig file in arch/x86/kernel/dts/Kconfig Signed-off-by: Dirk Brandewie dirk.brande...@gmail.com --- arch/x86/Kconfig|6 +- arch/x86/kernel/Makefile|6 ++ arch/x86/kernel/dts/Kconfig |7 +++ 3 files changed, 18 insertions(+), 1 deletions(-) create mode 100644 arch/x86/kernel/dts/Kconfig diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index 5904f38..f2f516a 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -299,13 +299,17 @@ config X86_BIGSMP ---help--- This option is needed for the systems that have more than 8 CPUs -config X86_OF +menuconfig X86_OF bool Support for device tree select OF select OF_FLATTREE ---help--- Device tree support on X86. +if X86_OF +source arch/x86/kernel/dts/Kconfig +endif + if X86_32 config X86_EXTENDED_PLATFORM bool Support for extended (non-PC) x86 platforms diff --git a/arch/x86/kernel/Makefile b/arch/x86/kernel/Makefile index 586df14..49e017d 100644 --- a/arch/x86/kernel/Makefile +++ b/arch/x86/kernel/Makefile @@ -114,6 +114,12 @@ obj-$(CONFIG_SWIOTLB) += pci-swiotlb.o obj-$(CONFIG_X86_OF) += prom.o ### +# device tree blobs +obj-$(CONFIG_CE4100_DTB) += ce4100.dtb.o +obj-$(CONFIG_TEST_DTB) += test.dtb.o + + +### # 64 bit specific files ifeq ($(CONFIG_X86_64),y) obj-$(CONFIG_AUDIT) += audit_64.o diff --git a/arch/x86/kernel/dts/Kconfig b/arch/x86/kernel/dts/Kconfig new file mode 100644 index 000..d3e5cd4 --- /dev/null +++ b/arch/x86/kernel/dts/Kconfig @@ -0,0 +1,7 @@ +config CE4100_DTB + bool Intel CE4100 + +config TEST_DTB + bool Test DTS + + -- 1.7.2.3 ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
[PATCH 4/5] of/powerpc: Move build to use generic dts-dtb rule
From: Dirk Brandewie dirk.brande...@gmail.com This patch changes arch/powerpc/boot/Makefile to use the generic rule build the device tree blobs in scripts/Makefile.lib Signed-off-by: Dirk Brandewie dirk.brande...@gmail.com --- arch/powerpc/boot/Makefile |7 --- 1 files changed, 0 insertions(+), 7 deletions(-) diff --git a/arch/powerpc/boot/Makefile b/arch/powerpc/boot/Makefile index fae8192..d90c674 100644 --- a/arch/powerpc/boot/Makefile +++ b/arch/powerpc/boot/Makefile @@ -147,8 +147,6 @@ targets += $(patsubst $(obj)/%,%,$(obj-boot) wrapper.a) extra-y:= $(obj)/wrapper.a $(obj-plat) $(obj)/empty.o \ $(obj)/zImage.lds $(obj)/zImage.coff.lds $(obj)/zImage.ps3.lds -dtstree:= $(srctree)/$(src)/dts - wrapper:=$(srctree)/$(src)/wrapper wrapperbits:= $(extra-y) $(addprefix $(obj)/,addnote hack-coff mktree) \ $(wrapper) FORCE @@ -331,11 +329,6 @@ $(obj)/treeImage.initrd.%: vmlinux $(obj)/%.dtb $(wrapperbits) $(obj)/treeImage.%: vmlinux $(obj)/%.dtb $(wrapperbits) $(call if_changed,wrap,treeboot-$*,,$(obj)/$*.dtb) -# Rule to build device tree blobs -DTC = $(objtree)/scripts/dtc/dtc - -$(obj)/%.dtb: $(dtstree)/%.dts - $(DTC) -O dtb -o $(obj)/$*.dtb -b 0 $(DTS_FLAGS) $(dtstree)/$*.dts # If there isn't a platform selected then just strip the vmlinux. ifeq (,$(image-y)) -- 1.7.2.3 ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
[PATCH 5/5] of/microblaze: Move build to use generic dts-dtb rule
From: Dirk Brandewie dirk.brande...@gmail.com This patch changes arch/microblaze/boot/Makefile to use the generic rule build the device tree blobs in scripts/Makefile.lib Signed-off-by: Dirk Brandewie dirk.brande...@gmail.com --- arch/microblaze/boot/Makefile | 13 + 1 files changed, 1 insertions(+), 12 deletions(-) diff --git a/arch/microblaze/boot/Makefile b/arch/microblaze/boot/Makefile index be01d78..4fda765 100644 --- a/arch/microblaze/boot/Makefile +++ b/arch/microblaze/boot/Makefile @@ -10,9 +10,6 @@ targets := linux.bin linux.bin.gz simpleImage.% OBJCOPYFLAGS := -O binary -# Where the DTS files live -dtstree := $(srctree)/$(src)/dts - # Ensure system.dtb exists $(obj)/linked_dtb.o: $(obj)/system.dtb @@ -51,14 +48,6 @@ $(obj)/simpleImage.%: vmlinux FORCE $(call if_changed,strip) @echo 'Kernel: $@ is ready' ' (#'`cat .version`')' -# Rule to build device tree blobs -DTC = $(objtree)/scripts/dtc/dtc - -# Rule to build device tree blobs -quiet_cmd_dtc = DTC $@ - cmd_dtc = $(DTC) -O dtb -o $(obj)/$*.dtb -b 0 -p 1024 $(dtstree)/$*.dts - -$(obj)/%.dtb: $(dtstree)/%.dts FORCE - $(call if_changed,dtc) +DTS_FLAGS := -p 1024 clean-files += *.dtb simpleImage.*.unstrip linux.bin.ub -- 1.7.2.3 ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [PATCH 2/5] of/fdt: add kernel command line option for dtb_compat string
On Tue, Nov 16, 2010 at 3:41 PM, dirk.brande...@gmail.com wrote: From: Dirk Brandewie dirk.brande...@gmail.com Adds a kernel command line option dtb_compat=string and functions for architecture/platform specific code to retrieve the command line string and locate the compatible DTB linked into the kernel of_flat_dt_get_dtb_compatible_string() returns a pointer string passed from the command line or a pointer to an empty string. of_flat_dt_find_compatible_dtb() returns a pointer to a DTB that is compatible with the compatible string or a NULL pointer if no matching DTB is present. Signed-off-by: Dirk Brandewie dirk.brande...@gmail.com --- [...] +void __init *of_flat_dt_find_compatible_dtb(char *name) +{ + void *rc = NULL; + unsigned long root, size; + struct boot_param_header *orig_initial_boot_params; + uint8_t *blob; + + orig_initial_boot_params = initial_boot_params; + blob = __dtb_start; + initial_boot_params = (struct boot_param_header *)blob; + + while (blob __dtb_end + (be32_to_cpu(initial_boot_params-magic) == OF_DT_HEADER)) { The kernel needs to complain *loudly* if this occurs because it represents a bug. I'm tempted to say use BUG, but that would halt the kernel and prevent any possibility of kernel log output. WARN_ON() is probably best. g. ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
[PATCH] powerpc: Per process DSCR
In order to add per process control of the DSCR, the following patch emulates read/write of the DSCR from userspace and saves and restores it on context switch. We add emulated stats to track how many times we do this. While writing this patch a few things were apparent: - How will this work with the global DSCR setting in /sys/devices/system/cpu/cpu*/dscr? Do we deprecate it? One thought is to add a new sysfs entry (eg dscr_enabled), which tells us to override any per process settings. Another way would be to overload the dscr sysfs entry and make -1 mean the system wide dscr setting is disabled. - Do we need an out of band method of changing the DSCR so another process or could modify it? We may want to modify the DSCR of a long running process, eg a HPC job. - To improve context switch speed we should probably check the old and new DSCR values are identical and avoid the SPR write. Signed-off-by: Anton Blanchard an...@samba.org --- Index: powerpc.git/arch/powerpc/include/asm/emulated_ops.h === --- powerpc.git.orig/arch/powerpc/include/asm/emulated_ops.h2010-10-26 08:27:15.241519117 +1100 +++ powerpc.git/arch/powerpc/include/asm/emulated_ops.h 2010-10-26 08:30:29.033192033 +1100 @@ -52,6 +52,10 @@ extern struct ppc_emulated { #ifdef CONFIG_VSX struct ppc_emulated_entry vsx; #endif +#ifdef CONFIG_PPC64 + struct ppc_emulated_entry mfdscr; + struct ppc_emulated_entry mtdscr; +#endif } ppc_emulated; extern u32 ppc_warn_emulated; Index: powerpc.git/arch/powerpc/include/asm/ppc-opcode.h === --- powerpc.git.orig/arch/powerpc/include/asm/ppc-opcode.h 2010-10-26 08:21:09.307248476 +1100 +++ powerpc.git/arch/powerpc/include/asm/ppc-opcode.h 2010-10-26 08:41:51.383886171 +1100 @@ -39,6 +39,10 @@ #define PPC_INST_RFCI 0x4c66 #define PPC_INST_RFDI 0x4c4e #define PPC_INST_RFMCI 0x4c4c +#define PPC_INST_MFSPR_DSCR0x7c1102a6 +#define PPC_INST_MFSPR_DSCR_MASK 0xfc1f +#define PPC_INST_MTSPR_DSCR0x7c1103a6 +#define PPC_INST_MTSPR_DSCR_MASK 0xfc1f #define PPC_INST_STRING0x7c00042a #define PPC_INST_STRING_MASK 0xfc0007fe Index: powerpc.git/arch/powerpc/include/asm/processor.h === --- powerpc.git.orig/arch/powerpc/include/asm/processor.h 2010-10-26 08:15:39.811410266 +1100 +++ powerpc.git/arch/powerpc/include/asm/processor.h2010-10-26 08:15:48.981017521 +1100 @@ -240,6 +240,9 @@ struct thread_struct { #ifdef CONFIG_KVM_BOOK3S_32_HANDLER void* kvm_shadow_vcpu; /* KVM internal data */ #endif /* CONFIG_KVM_BOOK3S_32_HANDLER */ +#ifdef CONFIG_PPC64 + unsigned long dscr; +#endif }; #define ARCH_MIN_TASKALIGN 16 Index: powerpc.git/arch/powerpc/kernel/traps.c === --- powerpc.git.orig/arch/powerpc/kernel/traps.c2010-10-26 08:20:13.849632922 +1100 +++ powerpc.git/arch/powerpc/kernel/traps.c 2010-10-26 08:43:18.200159027 +1100 @@ -919,6 +919,26 @@ static int emulate_instruction(struct pt return emulate_isel(regs, instword); } +#ifdef CONFIG_PPC64 + /* Emulate the mfspr rD, DSCR. */ + if (((instword PPC_INST_MFSPR_DSCR_MASK) == PPC_INST_MFSPR_DSCR) + cpu_has_feature(CPU_FTR_DSCR)) { + PPC_WARN_EMULATED(mfdscr, regs); + rd = (instword 21) 0x1f; + regs-gpr[rd] = mfspr(SPRN_DSCR); + return 0; + } + + /* Emulate the mtspr DSCR, rD. */ + if (((instword PPC_INST_MTSPR_DSCR_MASK) == PPC_INST_MTSPR_DSCR) + cpu_has_feature(CPU_FTR_DSCR)) { + PPC_WARN_EMULATED(mtdscr, regs); + rd = (instword 21) 0x1f; + mtspr(SPRN_DSCR, regs-gpr[rd]); + return 0; + } +#endif + return -EINVAL; } Index: powerpc.git/arch/powerpc/kernel/entry_64.S === --- powerpc.git.orig/arch/powerpc/kernel/entry_64.S 2010-10-26 08:45:18.075013145 +1100 +++ powerpc.git/arch/powerpc/kernel/entry_64.S 2010-10-26 08:50:38.991238792 +1100 @@ -421,6 +421,12 @@ BEGIN_FTR_SECTION std r24,THREAD_VRSAVE(r3) END_FTR_SECTION_IFSET(CPU_FTR_ALTIVEC) #endif /* CONFIG_ALTIVEC */ +#ifdef CONFIG_PPC64 +BEGIN_FTR_SECTION + mfspr r25,SPRN_DSCR + std r25,THREAD_DSCR(r3) +END_FTR_SECTION_IFSET(CPU_FTR_DSCR) +#endif and.r0,r0,r22 beq+1f andcr22,r22,r0 @@ -522,6 +528,12 @@ BEGIN_FTR_SECTION mtspr SPRN_VRSAVE,r0 /* if G4, restore VRSAVE reg */ END_FTR_SECTION_IFSET(CPU_FTR_ALTIVEC) #endif /*
Re: [PATCH 1/5] of: Add support for linking device tree blobs into vmlinux
Thanks for doing this. However I have a few comments... On 11/16/2010 02:41 PM, dirk.brande...@gmail.com wrote: From: Dirk Brandewiedirk.brande...@gmail.com This patch adds support for linking device tree blobs into vmlinux. Modifies asm-generic/vmlinux.lds.h to add linking .dtb.init.rodata sections into the .init.data section of the vmlinux image. Modifies scripts/Makefile.lib to add a kbuild command to compile DTS files to device tree blobs and a rule to create objects to wrap the blobs for linking. The DTB's are placed on 32 byte boundries to allow parsing the blob with driver/of/fdt.c during early boot without having to copy the blob to get the structure alignment GCC expects. A DTB is linked in by adding the DTB object to the list of objects to be linked into vmlinux in the archtecture specific Makefile using obj-y += foo.dtb.o Signed-off-by: Dirk Brandewiedirk.brande...@gmail.com --- include/asm-generic/vmlinux.lds.h | 19 +-- scripts/Makefile.lib | 20 2 files changed, 37 insertions(+), 2 deletions(-) diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h index bd69d79..ea671e7 100644 --- a/include/asm-generic/vmlinux.lds.h +++ b/include/asm-generic/vmlinux.lds.h @@ -67,7 +67,14 @@ * Align to a 32 byte boundary equal to the * alignment gcc 4.5 uses for a struct */ -#define STRUCT_ALIGN() . = ALIGN(32) +#define STRUCT_ALIGNMENT 32 +#define STRUCT_ALIGN() . = ALIGN(STRUCT_ALIGNMENT) + +/* Device tree blobs linked into the kernel need to have proper + * structure alignment to be parsed by the flat device tree library + * used in early boot +*/ +#define DTB_ALIGNMENT STRUCT_ALIGNMENT /* The actual configuration determine if the init/exit sections * are handled as text/data or they can be discarded (which @@ -146,6 +153,13 @@ #define TRACE_SYSCALLS() #endif + +#define KERNEL_DTB() \ + . = ALIGN(DTB_ALIGNMENT); \ + VMLINUX_SYMBOL(__dtb_start) = .;\ + *(.dtb.init.rodata) \ + VMLINUX_SYMBOL(__dtb_end) = .; + /* .data section */ #define DATA_DATA \ *(.data)\ @@ -468,7 +482,8 @@ MCOUNT_REC()\ DEV_DISCARD(init.rodata)\ CPU_DISCARD(init.rodata)\ - MEM_DISCARD(init.rodata) + MEM_DISCARD(init.rodata)\ + KERNEL_DTB() I thought the init.rodata was only for data used by __init things. Although the current linker scripts do not put it in the section that gets recycled as usable memory. IIRC the unflattened version of the device tree has pointers to the flattened data. Since the device tree nodes are live for the entire kernel lifecycle, shouldn't the device tree blobs be in non-init memory? #define INIT_TEXT \ *(.init.text) \ diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib index 4c72c11..29db062 100644 --- a/scripts/Makefile.lib +++ b/scripts/Makefile.lib @@ -200,6 +200,26 @@ quiet_cmd_gzip = GZIP$@ cmd_gzip = (cat $(filter-out FORCE,$^) | gzip -f -9 $@) || \ (rm -f $@ ; false) +# DTC +# --- +$(obj)/%.dtb.S: $(obj)/%.dtb FORCE Why FORCE? + @echo '#includeasm-generic/vmlinux.lds.h' $@ + @echo '.section .dtb.init.rodata,a' $@ + @echo '.balign DTB_ALIGNMENT' $@ + @echo '.global __dtb_$(*F)_begin' $@ + @echo '__dtb_$(*F)_begin:' $@ + @echo '.incbin $ ' $@ + @echo '__dtb_$(*F)_end:' $@ + @echo '.global __dtb_$(*F)_end' $@ + @echo '.balign DTB_ALIGNMENT' $@ + +DTC = $(objtree)/scripts/dtc/dtc + +quiet_cmd_dtc = DTC$@ + cmd_dtc = $(DTC) -O dtb -o $(obj)/$*.dtb -b 0 $(DTS_FLAGS) $(src)/dts/$*.dts + +$(obj)/%.dtb: $(src)/dts/%.dts + $(call if_changed,dtc) Do all the generated files get cleaned up? I will try it tomorrow to see for sure. Thanks, David Daney ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: Can't boot benh/powerpc.git kernel
On Tue, 2010-11-16 at 14:26 +1100, Michael Neuling wrote: In message 1289520464.4752.12.ca...@localhost you wrote: On Thu, 2010-11-11 at 09:06 +1100, Benjamin Herrenschmidt wrote: On Wed, 2010-11-10 at 11:54 -0800, Jim Keniston wrote: I got Ben's linux/kernel/git/benh/powerpc.git source and built it (.config file attached*). It hangs on boot. When I boot it with loglevel=8, its last words are: First, please try with Linus upstream. The master branch in my git tree is quite stale, and my next and merge branch are too at the moment as I'm still travelling. All our current stuff was merged during the last merge window so there's nothing new for you to pickup in my tree at the moment :-) If the problem still occurs, I'll have a look next week. Cheers, Ben. I built from Linus's git tree, and that kernel doesn't boot, either. (It doesn't hang, but rather panics during boot. I can provide a console log if you like.) Yes please. Linus' tree with pseries_defconfig boots fine for me on my POWER5 box. v2.6.36 and v2.6.37-rc1 boot fine for me. I'll post my nvram-related patches against v2.6.37-rc1. So it's broken between 37-rc1 and whereever you grabbed Linus tree. That's a fairly small window. Can you bisect it? I was apparently comparing apples to oranges. Given the fatal configuration options (DEBUG_SLAB and/or DEBUG_PAGEALLOC) 2.6.37-rc1 fails the same as a more recent snapshot of Linus's tree. I updated my view today, and it still fails to boot with DEBUG_SLAB and/or DEBUG_PAGEALLOC, and boots OK without them. It also fails to boot with SLUB and SLUB_DEBUG enabled, even with SLUB_DEBUG_ON disabled. Ben has access to my system, and will look at it in a few days. Jim Mikey ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: Can't boot benh/powerpc.git kernel
In message 1289958663.3028.175.ca...@localhost you wrote: On Tue, 2010-11-16 at 14:26 +1100, Michael Neuling wrote: In message 1289520464.4752.12.ca...@localhost you wrote: On Thu, 2010-11-11 at 09:06 +1100, Benjamin Herrenschmidt wrote: On Wed, 2010-11-10 at 11:54 -0800, Jim Keniston wrote: I got Ben's linux/kernel/git/benh/powerpc.git source and built it (.config file attached*). It hangs on boot. When I boot it with loglevel=8, its last words are: First, please try with Linus upstream. The master branch in my git tree is quite stale, and my next and merge branch are too at the moment as I'm still travelling. All our current stuff was merged during the last merge window so there's nothing new for you to pickup in my tree at the moment :-) If the problem still occurs, I'll have a look next week. Cheers, Ben. I built from Linus's git tree, and that kernel doesn't boot, either. (It doesn't hang, but rather panics during boot. I can provide a console log if you like.) Yes please. Linus' tree with pseries_defconfig boots fine for me on my POWER5 box. v2.6.36 and v2.6.37-rc1 boot fine for me. I'll post my nvram-related patches against v2.6.37-rc1. So it's broken between 37-rc1 and whereever you grabbed Linus tree. That's a fairly small window. Can you bisect it? I was apparently comparing apples to oranges. Given the fatal configuration options (DEBUG_SLAB and/or DEBUG_PAGEALLOC) 2.6.37-rc1 fails the same as a more recent snapshot of Linus's tree. I updated my view today, and it still fails to boot with DEBUG_SLAB and/or DEBUG_PAGEALLOC, and boots OK without them. I can't reproduce any of these. I modified pseries_defconfig to enable DEBUG_SLAB and it still works for me on my POWER5 here % grep SLAB .config CONFIG_SLAB=y CONFIG_SLABINFO=y CONFIG_DEBUG_SLAB=y # CONFIG_DEBUG_SLAB_LEAK is not set I also can't reproduce with DEBUG_PAGEALLOC enabeled either. It also fails to boot with SLUB and SLUB_DEBUG enabled, even with SLUB_DEBUG_ON disabled. pseries_defconfig uses this configuration and boots for me. % grep SLUB .config CONFIG_SLUB_DEBUG=y CONFIG_SLUB=y # CONFIG_SLUB_DEBUG_ON is not set # CONFIG_SLUB_STATS is not set Ben has access to my system, and will look at it in a few days. Can you please try pseries_defconfig? Mikey ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [PATCH 1/5] of: Add support for linking device tree blobs into vmlinux
On 11/16/2010 04:39 PM, David Daney wrote: Thanks for doing this. However I have a few comments... On 11/16/2010 02:41 PM, dirk.brande...@gmail.com wrote: From: Dirk Brandewiedirk.brande...@gmail.com /* .data section */ #define DATA_DATA \ *(.data) \ @@ -468,7 +482,8 @@ MCOUNT_REC() \ DEV_DISCARD(init.rodata) \ CPU_DISCARD(init.rodata) \ - MEM_DISCARD(init.rodata) + MEM_DISCARD(init.rodata) \ + KERNEL_DTB() I thought the init.rodata was only for data used by __init things. Although the current linker scripts do not put it in the section that gets recycled as usable memory. IIRC the unflattened version of the device tree has pointers to the flattened data. Since the device tree nodes are live for the entire kernel lifecycle, shouldn't the device tree blobs be in non-init memory? The contents of the blob get copied to allocated memory during unflatten_device_tree() so the blob that is linked in is no longer needed after init. #define INIT_TEXT \ *(.init.text) \ diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib index 4c72c11..29db062 100644 --- a/scripts/Makefile.lib +++ b/scripts/Makefile.lib @@ -200,6 +200,26 @@ quiet_cmd_gzip = GZIP $@ cmd_gzip = (cat $(filter-out FORCE,$^) | gzip -f -9 $@) || \ (rm -f $@ ; false) +# DTC +# --- +$(obj)/%.dtb.S: $(obj)/%.dtb FORCE Why FORCE? Crud left over from debugging I will remove. + @echo '#includeasm-generic/vmlinux.lds.h' $@ + @echo '.section .dtb.init.rodata,a' $@ + @echo '.balign DTB_ALIGNMENT' $@ + @echo '.global __dtb_$(*F)_begin' $@ + @echo '__dtb_$(*F)_begin:' $@ + @echo '.incbin $ ' $@ + @echo '__dtb_$(*F)_end:' $@ + @echo '.global __dtb_$(*F)_end' $@ + @echo '.balign DTB_ALIGNMENT' $@ + +DTC = $(objtree)/scripts/dtc/dtc + +quiet_cmd_dtc = DTC $@ + cmd_dtc = $(DTC) -O dtb -o $(obj)/$*.dtb -b 0 $(DTS_FLAGS) $(src)/dts/$*.dts + +$(obj)/%.dtb: $(src)/dts/%.dts + $(call if_changed,dtc) Do all the generated files get cleaned up? I will try it tomorrow to see for sure. Looks like I need to add the generated .S files to clean-files Thanks, David Daney ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [PATCH 1/5] of: Add support for linking device tree blobs into vmlinux
On Tue, Nov 16, 2010 at 7:21 PM, Dirk Brandewie dirk.brande...@gmail.com wrote: On 11/16/2010 04:39 PM, David Daney wrote: Thanks for doing this. However I have a few comments... On 11/16/2010 02:41 PM, dirk.brande...@gmail.com wrote: From: Dirk Brandewiedirk.brande...@gmail.com /* .data section */ #define DATA_DATA \ *(.data) \ @@ -468,7 +482,8 @@ MCOUNT_REC() \ DEV_DISCARD(init.rodata) \ CPU_DISCARD(init.rodata) \ - MEM_DISCARD(init.rodata) + MEM_DISCARD(init.rodata) \ + KERNEL_DTB() I thought the init.rodata was only for data used by __init things. Although the current linker scripts do not put it in the section that gets recycled as usable memory. IIRC the unflattened version of the device tree has pointers to the flattened data. Since the device tree nodes are live for the entire kernel lifecycle, shouldn't the device tree blobs be in non-init memory? The contents of the blob get copied to allocated memory during unflatten_device_tree() so the blob that is linked in is no longer needed after init. Have you written a patch to add this behaviour? The current code doesn't. :-) g. ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [PATCH] Fix float to unsigned conversion failure with SPE enabled
Josh Boyer wrote: On Sat, Nov 13, 2010 at 11:11 PM, Hai Shan haishan@gmail.com wrote: Fixed the failure on converting minus float to unsigned int with SPE enabled Signed-off-by: Hai Shan shan@windriver.com You should make sure to send PowerPC patches to linuxppc-dev. Thanks for your suggestion, I will send it to linuxppc-dev. Regards Shan Hai josh --- arch/powerpc/math-emu/math_efp.c | 17 + 1 files changed, 13 insertions(+), 4 deletions(-) diff --git a/arch/powerpc/math-emu/math_efp.c b/arch/powerpc/math-emu/math_efp.c index 41f4ef3..338a128 100644 --- a/arch/powerpc/math-emu/math_efp.c +++ b/arch/powerpc/math-emu/math_efp.c @@ -320,7 +320,9 @@ int do_spe_mathemu(struct pt_regs *regs) } else { _FP_ROUND_ZERO(1, SB); } - FP_TO_INT_S(vc.wp[1], SB, 32, ((func 0x3) != 0)); + /* SB_s: convert from minus float to unsigned int */ + FP_TO_INT_S(vc.wp[1], SB, 32, + ((func 0x3) != 0) || SB_s); goto update_regs; default: @@ -458,7 +460,11 @@ cmp_s: } else { _FP_ROUND_ZERO(2, DB); } - FP_TO_INT_D(vc.wp[1], DB, 32, ((func 0x3) != 0)); + /* DB_s: convert from minus long double to +* unsigned long long +*/ + FP_TO_INT_D(vc.wp[1], DB, 32, + ((func 0x3) != 0) || DB_s); goto update_regs; default: @@ -589,8 +595,11 @@ cmp_d: _FP_ROUND_ZERO(1, SB0); _FP_ROUND_ZERO(1, SB1); } - FP_TO_INT_S(vc.wp[0], SB0, 32, ((func 0x3) != 0)); - FP_TO_INT_S(vc.wp[1], SB1, 32, ((func 0x3) != 0)); + /* SB*_s: convert from minus float to unsigned int */ + FP_TO_INT_S(vc.wp[0], SB0, 32, + ((func 0x3) != 0) || SB0_s); + FP_TO_INT_S(vc.wp[1], SB1, 32, + ((func 0x3) != 0) || SB1_s); goto update_regs; default: -- 1.7.0.4 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/ ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
math_efp.c: Fixed SPE data type conversion failure
The following test case failed on Powerpc sbc8548 with CONFIG_SPE static float fm; static signed int si_min = (-2147483647 - 1); static unsigned int ui; int main() { fm = (float) si_min; ; ui = (unsigned int)fm; printf(ui=%d, should be %d\n, ui, si_min); return 0; } Result: ui=-1, should be -2147483648 The reason is failure to emulate the minus float to unsigned integer conversion instruction in the SPE driver. ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
[PATCH] Fix SPE float to integer conversion failure
Conversion from float to integer should based on both the instruction encoding and the sign of the operand. Signed-off-by: Shan Hai shan@windriver.com --- arch/powerpc/math-emu/math_efp.c | 12 1 files changed, 8 insertions(+), 4 deletions(-) diff --git a/arch/powerpc/math-emu/math_efp.c b/arch/powerpc/math-emu/math_efp.c index 41f4ef3..64faf10 100644 --- a/arch/powerpc/math-emu/math_efp.c +++ b/arch/powerpc/math-emu/math_efp.c @@ -320,7 +320,8 @@ int do_spe_mathemu(struct pt_regs *regs) } else { _FP_ROUND_ZERO(1, SB); } - FP_TO_INT_S(vc.wp[1], SB, 32, ((func 0x3) != 0)); + FP_TO_INT_S(vc.wp[1], SB, 32, + (((func 0x3) != 0) || SB_s)); goto update_regs; default: @@ -458,7 +459,8 @@ cmp_s: } else { _FP_ROUND_ZERO(2, DB); } - FP_TO_INT_D(vc.wp[1], DB, 32, ((func 0x3) != 0)); + FP_TO_INT_D(vc.wp[1], DB, 32, + (((func 0x3) != 0) || DB_s)); goto update_regs; default: @@ -589,8 +591,10 @@ cmp_d: _FP_ROUND_ZERO(1, SB0); _FP_ROUND_ZERO(1, SB1); } - FP_TO_INT_S(vc.wp[0], SB0, 32, ((func 0x3) != 0)); - FP_TO_INT_S(vc.wp[1], SB1, 32, ((func 0x3) != 0)); + FP_TO_INT_S(vc.wp[0], SB0, 32, + (((func 0x3) != 0) || SB0_s)); + FP_TO_INT_S(vc.wp[1], SB1, 32, + (((func 0x3) != 0) || SB1_s)); goto update_regs; default: -- 1.7.0.2 ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [PATCH 2/5] powerpc/5200: dts: rename nodes to prepare for refactoring dts files
On Tue, Nov 16, 2010 at 12:50:02PM -0800, John Bonesio wrote: This patch renames nodes in dts fils for MPC5200b files to prepare for refactoring of these files later. When refactoring it will be easier to verify the results if the node names aren't changing at the same time. Signed-off-by: John Bonesio bo...@secretlab.ca David, as you can see, the current features in DTC require the mpc5200 dts files to back off from the generic names recommended practise. ie. a psc in serial port mode is can no longer be called serial@addr without completely deleting the psc node and replacing it with a serial node. Neither John nor I foresaw this situation until John actually tried implementing a shared mpc5200.dtsi file. What do you think? Is node rename a feature that dtc should have? g. --- arch/powerpc/boot/dts/cm5200.dts|8 arch/powerpc/boot/dts/digsy_mtc.dts |6 +++--- arch/powerpc/boot/dts/lite5200b.dts |2 +- arch/powerpc/boot/dts/media5200.dts |2 +- arch/powerpc/boot/dts/motionpro.dts | 10 +- arch/powerpc/boot/dts/mucmc52.dts |6 +++--- arch/powerpc/boot/dts/pcm030.dts|6 +++--- arch/powerpc/boot/dts/pcm032.dts|6 +++--- arch/powerpc/boot/dts/uc101.dts |6 +++--- 9 files changed, 26 insertions(+), 26 deletions(-) diff --git a/arch/powerpc/boot/dts/cm5200.dts b/arch/powerpc/boot/dts/cm5200.dts index dd38608..9369dcd 100644 --- a/arch/powerpc/boot/dts/cm5200.dts +++ b/arch/powerpc/boot/dts/cm5200.dts @@ -160,25 +160,25 @@ reg = 0x1f00 0x100; }; - ser...@2000 { // PSC1 + p...@2000 { // PSC1 compatible = fsl,mpc5200b-psc-uart,fsl,mpc5200-psc-uart; reg = 0x2000 0x100; interrupts = 2 1 0; }; - ser...@2200 { // PSC2 + p...@2200 { // PSC2 compatible = fsl,mpc5200b-psc-uart,fsl,mpc5200-psc-uart; reg = 0x2200 0x100; interrupts = 2 2 0; }; - ser...@2400 { // PSC3 + p...@2400 { // PSC3 compatible = fsl,mpc5200b-psc-uart,fsl,mpc5200-psc-uart; reg = 0x2400 0x100; interrupts = 2 3 0; }; - ser...@2c00 { // PSC6 + p...@2c00 { // PSC6 compatible = fsl,mpc5200b-psc-uart,fsl,mpc5200-psc-uart; reg = 0x2c00 0x100; interrupts = 2 4 0; diff --git a/arch/powerpc/boot/dts/digsy_mtc.dts b/arch/powerpc/boot/dts/digsy_mtc.dts index 8e9be6b..f0592de 100644 --- a/arch/powerpc/boot/dts/digsy_mtc.dts +++ b/arch/powerpc/boot/dts/digsy_mtc.dts @@ -155,13 +155,13 @@ reg = 0x1f00 0x100; }; - ser...@2600 { // PSC4 + p...@2600 { // PSC4 compatible = fsl,mpc5200b-psc-uart,fsl,mpc5200-psc-uart; reg = 0x2600 0x100; interrupts = 2 11 0; }; - ser...@2800 { // PSC5 + p...@2800 { // PSC5 compatible = fsl,mpc5200b-psc-uart,fsl,mpc5200-psc-uart; reg = 0x2800 0x100; interrupts = 2 12 0; @@ -217,7 +217,7 @@ }; }; - lpb { + localbus { compatible = fsl,mpc5200b-lpb,simple-bus; #address-cells = 2; #size-cells = 1; diff --git a/arch/powerpc/boot/dts/lite5200b.dts b/arch/powerpc/boot/dts/lite5200b.dts index 59702ac..a74b790 100644 --- a/arch/powerpc/boot/dts/lite5200b.dts +++ b/arch/powerpc/boot/dts/lite5200b.dts @@ -172,7 +172,7 @@ reg = 0x1f00 0x100; }; - ser...@2000 { // PSC1 + p...@2000 { // PSC1 compatible = fsl,mpc5200b-psc-uart,fsl,mpc5200-psc-uart; cell-index = 0; reg = 0x2000 0x100; diff --git a/arch/powerpc/boot/dts/media5200.dts b/arch/powerpc/boot/dts/media5200.dts index 0c3902b..a70ef68 100644 --- a/arch/powerpc/boot/dts/media5200.dts +++ b/arch/powerpc/boot/dts/media5200.dts @@ -183,7 +183,7 @@ }; // PSC6 in uart mode - console: ser...@2c00 { // PSC6 + console: p...@2c00 {// PSC6 compatible = fsl,mpc5200b-psc-uart,fsl,mpc5200-psc-uart; cell-index = 5; port-number = 0; // Logical port assignment diff --git a/arch/powerpc/boot/dts/motionpro.dts b/arch/powerpc/boot/dts/motionpro.dts index
Re: [PATCH 3/5] powerpc/5200: dts: remove unused properties
On Tue, Nov 16, 2010 at 12:50:10PM -0800, John Bonesio wrote: This patch remove unused properties in dts files in preparation of refactoring the dts files for MPC5200b based boards. Signed-off-by: John Bonesio bo...@secretlab.ca --- arch/powerpc/boot/dts/cm5200.dts|2 -- arch/powerpc/boot/dts/lite5200b.dts |3 --- arch/powerpc/boot/dts/media5200.dts |2 -- arch/powerpc/boot/dts/motionpro.dts |2 -- arch/powerpc/boot/dts/pcm030.dts|2 -- arch/powerpc/boot/dts/pcm032.dts|2 -- 6 files changed, 0 insertions(+), 13 deletions(-) diff --git a/arch/powerpc/boot/dts/cm5200.dts b/arch/powerpc/boot/dts/cm5200.dts index 9369dcd..d549897 100644 --- a/arch/powerpc/boot/dts/cm5200.dts +++ b/arch/powerpc/boot/dts/cm5200.dts @@ -230,8 +230,6 @@ reg = 0 0 0x200; bank-width = 2; device-width = 2; - #size-cells = 1; - #address-cells = 1; }; }; }; diff --git a/arch/powerpc/boot/dts/lite5200b.dts b/arch/powerpc/boot/dts/lite5200b.dts index a74b790..c0a4e45 100644 --- a/arch/powerpc/boot/dts/lite5200b.dts +++ b/arch/powerpc/boot/dts/lite5200b.dts @@ -174,7 +174,6 @@ p...@2000 { // PSC1 compatible = fsl,mpc5200b-psc-uart,fsl,mpc5200-psc-uart; - cell-index = 0; reg = 0x2000 0x100; interrupts = 2 1 0; }; @@ -198,7 +197,6 @@ // PSC4 in uart mode example //ser...@2600 { // PSC4 // compatible = fsl,mpc5200b-psc-uart,fsl,mpc5200-psc-uart; - // cell-index = 3; // reg = 0x2600 0x100; // interrupts = 2 11 0; //}; @@ -206,7 +204,6 @@ // PSC5 in uart mode example //ser...@2800 { // PSC5 // compatible = fsl,mpc5200b-psc-uart,fsl,mpc5200-psc-uart; - // cell-index = 4; // reg = 0x2800 0x100; // interrupts = 2 12 0; //}; How about deleting the commented out nodes entirely since they can now be captured in the mpc5200.dtsi file. diff --git a/arch/powerpc/boot/dts/media5200.dts b/arch/powerpc/boot/dts/media5200.dts index a70ef68..e027f45 100644 --- a/arch/powerpc/boot/dts/media5200.dts +++ b/arch/powerpc/boot/dts/media5200.dts @@ -185,8 +185,6 @@ // PSC6 in uart mode console: p...@2c00 {// PSC6 compatible = fsl,mpc5200b-psc-uart,fsl,mpc5200-psc-uart; - cell-index = 5; - port-number = 0; // Logical port assignment reg = 0x2c00 0x100; interrupts = 2 4 0; }; diff --git a/arch/powerpc/boot/dts/motionpro.dts b/arch/powerpc/boot/dts/motionpro.dts index f6261ea..3ab4666 100644 --- a/arch/powerpc/boot/dts/motionpro.dts +++ b/arch/powerpc/boot/dts/motionpro.dts @@ -277,8 +277,6 @@ reg = 0 0 0x0100; bank-width = 2; device-width = 2; - #size-cells = 1; - #address-cells = 1; }; }; }; diff --git a/arch/powerpc/boot/dts/pcm030.dts b/arch/powerpc/boot/dts/pcm030.dts index 3a4f554..f3e30bb 100644 --- a/arch/powerpc/boot/dts/pcm030.dts +++ b/arch/powerpc/boot/dts/pcm030.dts @@ -196,7 +196,6 @@ p...@2400 { /* PSC3 in UART mode */ compatible = fsl,mpc5200b-psc-uart,fsl,mpc5200-psc-uart; - cell-index = 2; reg = 0x2400 0x100; interrupts = 2 3 0; }; @@ -207,7 +206,6 @@ p...@2c00 { /* PSC6 in UART mode */ compatible = fsl,mpc5200b-psc-uart,fsl,mpc5200-psc-uart; - cell-index = 5; reg = 0x2c00 0x100; interrupts = 2 4 0; }; diff --git a/arch/powerpc/boot/dts/pcm032.dts b/arch/powerpc/boot/dts/pcm032.dts index 17596c7..e0f2702 100644 --- a/arch/powerpc/boot/dts/pcm032.dts +++ b/arch/powerpc/boot/dts/pcm032.dts @@ -196,7 +196,6 @@ p...@2400 { /* PSC3 in UART mode */ compatible = fsl,mpc5200b-psc-uart,fsl,mpc5200-psc-uart; - cell-index = 2; reg = 0x2400 0x100; interrupts = 2 3 0; }; @@ -207,7 +206,6 @@ p...@2c00 { /* PSC6 in UART mode */ compatible = fsl,mpc5200b-psc-uart,fsl,mpc5200-psc-uart; - cell-index = 5; reg = 0x2c00 0x100; interrupts = 2 4 0;
Re: [PATCH 4/5] powerpc/5200: dts: Remove incorrect combatible strings
On Tue, Nov 16, 2010 at 12:50:19PM -0800, John Bonesio wrote: This patch removes some incorrect compatible strings on the local plus bus node in dts files for MPC5200b based systems. Signed-off-by: John Bonesio bo...@secretlab.ca --- arch/powerpc/boot/dts/lite5200b.dts |2 +- arch/powerpc/boot/dts/mucmc52.dts |2 +- arch/powerpc/boot/dts/pcm032.dts|2 +- arch/powerpc/boot/dts/uc101.dts |2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/powerpc/boot/dts/lite5200b.dts b/arch/powerpc/boot/dts/lite5200b.dts index c0a4e45..ed8d7ae 100644 --- a/arch/powerpc/boot/dts/lite5200b.dts +++ b/arch/powerpc/boot/dts/lite5200b.dts @@ -295,7 +295,7 @@ }; localbus { - compatible = fsl,mpc5200b-lpb,fsl,mpc5200-lpb,simple-bus; + compatible = fsl,mpc5200b-lpb,simple-bus; Actually, this is change backwards; all of the mpc5200b localbus nodes should be: compatible = fsl,mpc5200b-lpb,fsl,mpc5200-lpb,simple-bus; #address-cells = 2; #size-cells = 1; diff --git a/arch/powerpc/boot/dts/mucmc52.dts b/arch/powerpc/boot/dts/mucmc52.dts index 8dc212d..b9d3559 100644 --- a/arch/powerpc/boot/dts/mucmc52.dts +++ b/arch/powerpc/boot/dts/mucmc52.dts @@ -217,7 +217,7 @@ }; localbus { - compatible = fsl,mpc5200b-lpb,fsl,mpc5200-lpb,simple-bus; + compatible = fsl,mpc5200b-lpb,simple-bus; #address-cells = 2; #size-cells = 1; diff --git a/arch/powerpc/boot/dts/pcm032.dts b/arch/powerpc/boot/dts/pcm032.dts index e0f2702..085a646 100644 --- a/arch/powerpc/boot/dts/pcm032.dts +++ b/arch/powerpc/boot/dts/pcm032.dts @@ -292,7 +292,7 @@ }; localbus { - compatible = fsl,mpc5200b-lpb,fsl,mpc5200-lpb,simple-bus; + compatible = fsl,mpc5200b-lpb,simple-bus; #address-cells = 2; #size-cells = 1; diff --git a/arch/powerpc/boot/dts/uc101.dts b/arch/powerpc/boot/dts/uc101.dts index e00441a..70299a4 100644 --- a/arch/powerpc/boot/dts/uc101.dts +++ b/arch/powerpc/boot/dts/uc101.dts @@ -229,7 +229,7 @@ }; localbus { - compatible = fsl,mpc5200b-lpb,fsl,mpc5200-lpb,simple-bus; + compatible = fsl,mpc5200b-lpb,simple-bus; #address-cells = 2; #size-cells = 1; ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [PATCH 1/5] scripts: dtc: Merge in changes from the dtc repository
On Tue, Nov 16, 2010 at 15:49, John Bonesio bo...@secretlab.ca wrote: Pull in recent changes from the main dtc repository. These changes primarily allow multiple device trees to be declared which are merged by dtc. This feature allows us to include a basic dts file and then provide more information for the specific system through the merging functionality. Hmm, is there some documentation for how to use this feature? Specifically I have a custom board with multiple discrete computers on it which are only very slightly physically different from each other and I'd like to be able to avoid maintaining 2 nearly-exact copies of the same DTS file. Cheers, Kyle Moffett ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [PATCH 1/5] scripts: dtc: Merge in changes from the dtc repository
On Tue, Nov 16, 2010 at 10:56 PM, Kyle Moffett k...@moffetthome.net wrote: On Tue, Nov 16, 2010 at 15:49, John Bonesio bo...@secretlab.ca wrote: Pull in recent changes from the main dtc repository. These changes primarily allow multiple device trees to be declared which are merged by dtc. This feature allows us to include a basic dts file and then provide more information for the specific system through the merging functionality. Hmm, is there some documentation for how to use this feature? Specifically I have a custom board with multiple discrete computers on it which are only very slightly physically different from each other and I'd like to be able to avoid maintaining 2 nearly-exact copies of the same DTS file. Not yet, but there will be. g. ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [PATCH 3/5] x86/of: Add building device tree blob(s) into image.
On Tue, Nov 16, 2010 at 02:41:38PM -0800, dirk.brande...@gmail.com wrote: From: Dirk Brandewie dirk.brande...@gmail.com This patch adds linking device tree blobs into vmlinux. DTB's are added by adding the blob object name to list of objects to be linked into the image. e.g: obj-$(CONFIG_TEST_DTB) += test.dtb.o The set of DTB linked into the image is controlled the Kconfig file in arch/x86/kernel/dts/Kconfig Signed-off-by: Dirk Brandewie dirk.brande...@gmail.com --- arch/x86/Kconfig|6 +- arch/x86/kernel/Makefile|6 ++ arch/x86/kernel/dts/Kconfig |7 +++ 3 files changed, 18 insertions(+), 1 deletions(-) create mode 100644 arch/x86/kernel/dts/Kconfig diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index 5904f38..f2f516a 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -299,13 +299,17 @@ config X86_BIGSMP ---help--- This option is needed for the systems that have more than 8 CPUs -config X86_OF +menuconfig X86_OF bool Support for device tree select OF select OF_FLATTREE ---help--- Device tree support on X86. +if X86_OF +source arch/x86/kernel/dts/Kconfig +endif + if X86_32 config X86_EXTENDED_PLATFORM bool Support for extended (non-PC) x86 platforms diff --git a/arch/x86/kernel/Makefile b/arch/x86/kernel/Makefile index 586df14..49e017d 100644 --- a/arch/x86/kernel/Makefile +++ b/arch/x86/kernel/Makefile @@ -114,6 +114,12 @@ obj-$(CONFIG_SWIOTLB)+= pci-swiotlb.o obj-$(CONFIG_X86_OF) += prom.o ### +# device tree blobs +obj-$(CONFIG_CE4100_DTB) += ce4100.dtb.o +obj-$(CONFIG_TEST_DTB) += test.dtb.o + + +### # 64 bit specific files ifeq ($(CONFIG_X86_64),y) obj-$(CONFIG_AUDIT) += audit_64.o diff --git a/arch/x86/kernel/dts/Kconfig b/arch/x86/kernel/dts/Kconfig new file mode 100644 index 000..d3e5cd4 --- /dev/null +++ b/arch/x86/kernel/dts/Kconfig @@ -0,0 +1,7 @@ +config CE4100_DTB + bool Intel CE4100 + +config TEST_DTB + bool Test DTS + + As previously mentioned, this isn't going to scale. Need to look at allowing the user to specify a list of .dtbs that will be linked in. g. -- 1.7.2.3 ___ devicetree-discuss mailing list devicetree-disc...@lists.ozlabs.org https://lists.ozlabs.org/listinfo/devicetree-discuss ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [PATCH 4/5] of/powerpc: Move build to use generic dts-dtb rule
On Tue, Nov 16, 2010 at 02:41:39PM -0800, dirk.brande...@gmail.com wrote: From: Dirk Brandewie dirk.brande...@gmail.com This patch changes arch/powerpc/boot/Makefile to use the generic rule build the device tree blobs in scripts/Makefile.lib Signed-off-by: Dirk Brandewie dirk.brande...@gmail.com --- arch/powerpc/boot/Makefile |7 --- 1 files changed, 0 insertions(+), 7 deletions(-) diff --git a/arch/powerpc/boot/Makefile b/arch/powerpc/boot/Makefile index fae8192..d90c674 100644 --- a/arch/powerpc/boot/Makefile +++ b/arch/powerpc/boot/Makefile @@ -147,8 +147,6 @@ targets += $(patsubst $(obj)/%,%,$(obj-boot) wrapper.a) extra-y := $(obj)/wrapper.a $(obj-plat) $(obj)/empty.o \ $(obj)/zImage.lds $(obj)/zImage.coff.lds $(obj)/zImage.ps3.lds -dtstree := $(srctree)/$(src)/dts - wrapper :=$(srctree)/$(src)/wrapper wrapperbits := $(extra-y) $(addprefix $(obj)/,addnote hack-coff mktree) \ $(wrapper) FORCE @@ -331,11 +329,6 @@ $(obj)/treeImage.initrd.%: vmlinux $(obj)/%.dtb $(wrapperbits) $(obj)/treeImage.%: vmlinux $(obj)/%.dtb $(wrapperbits) $(call if_changed,wrap,treeboot-$*,,$(obj)/$*.dtb) -# Rule to build device tree blobs -DTC = $(objtree)/scripts/dtc/dtc - -$(obj)/%.dtb: $(dtstree)/%.dts - $(DTC) -O dtb -o $(obj)/$*.dtb -b 0 $(DTS_FLAGS) $(dtstree)/$*.dts This patch needs to modify the rules that have %.dtb dependencies to go looking in arch/powerpc/boot/dts instead of arch/powerpc/boot because the rule change will change where .dtb files get generated. Also, this patch and patch 5 need to be merged with patch 1 so that the series remains bisectable. g. # If there isn't a platform selected then just strip the vmlinux. ifeq (,$(image-y)) -- 1.7.2.3 ___ devicetree-discuss mailing list devicetree-disc...@lists.ozlabs.org https://lists.ozlabs.org/listinfo/devicetree-discuss ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [PATCH 1/5] scripts: dtc: Merge in changes from the dtc repository
On Tue, Nov 16, 2010 at 1:49 PM, John Bonesio bo...@secretlab.ca wrote: Pull in recent changes from the main dtc repository. These changes primarily allow multiple device trees to be declared which are merged by dtc. This feature allows us to include a basic dts file and then provide more information for the specific system through the merging functionality. Signed-off-by: John Bonesio bo...@secretlab.ca --- 0 files changed, 0 insertions(+), 0 deletions(-) ??? Something isn't right in patch generation. Also: ~/hacking/linux-2.6$ xc-6xx make -j3 GEN /home/grant/hacking/linux-2.6.build/6xx/Makefile HOSTCC scripts/kconfig/zconf.tab.o HOSTLD scripts/kconfig/conf scripts/kconfig/conf --silentoldconfig Kconfig # # configuration written to .config # GEN /home/grant/hacking/linux-2.6.build/6xx/Makefile CHK include/linux/version.h UPD include/linux/version.h HOSTCC scripts/dtc/checks.o In file included from /home/grant/hacking/linux-2.6/scripts/dtc/checks.c:21: /home/grant/hacking/linux-2.6/scripts/dtc/dtc.h:37: fatal error: util.h: No such file or directory compilation terminated. make[3]: *** [scripts/dtc/checks.o] Error 1 make[2]: *** [scripts/dtc] Error 2 make[1]: *** [scripts] Error 2 make[1]: *** Waiting for unfinished jobs make: *** [sub-make] Error 2 (devicetree/test) ~/hacking/linux-2.6$ Looks like the updated dtc is broken. g. ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [PATCH 1/5] of: Add support for linking device tree blobs into vmlinux
On 11/16/2010 06:58 PM, Grant Likely wrote: On Tue, Nov 16, 2010 at 7:21 PM, Dirk Brandewie dirk.brande...@gmail.com wrote: On 11/16/2010 04:39 PM, David Daney wrote: Thanks for doing this. However I have a few comments... On 11/16/2010 02:41 PM, dirk.brande...@gmail.com wrote: From: Dirk Brandewiedirk.brande...@gmail.com /* .data section */ #define DATA_DATA \ *(.data) \ @@ -468,7 +482,8 @@ MCOUNT_REC() \ DEV_DISCARD(init.rodata) \ CPU_DISCARD(init.rodata) \ - MEM_DISCARD(init.rodata) + MEM_DISCARD(init.rodata) \ + KERNEL_DTB() I thought the init.rodata was only for data used by __init things. Although the current linker scripts do not put it in the section that gets recycled as usable memory. IIRC the unflattened version of the device tree has pointers to the flattened data. Since the device tree nodes are live for the entire kernel lifecycle, shouldn't the device tree blobs be in non-init memory? The contents of the blob get copied to allocated memory during unflatten_device_tree() so the blob that is linked in is no longer needed after init. Have you written a patch to add this behaviour? The current code doesn't. :-) I misspoke, my blob gets copied to allocated memory during unflatten_device_tree. my early_init_dt_alloc_memory_arch() returns the physical address of a kmalloc'd buffer. You would want copy the dtb that your platform is going to use to non-init memory. --Dirk ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [PATCH 1/5] scripts: dtc: Merge in changes from the dtc repository
Arg! I had this working. I'll look into it. - John On 11/16/2010 10:11 PM, Grant Likely wrote: On Tue, Nov 16, 2010 at 1:49 PM, John Bonesio bo...@secretlab.ca wrote: Pull in recent changes from the main dtc repository. These changes primarily allow multiple device trees to be declared which are merged by dtc. This feature allows us to include a basic dts file and then provide more information for the specific system through the merging functionality. Signed-off-by: John Bonesio bo...@secretlab.ca --- 0 files changed, 0 insertions(+), 0 deletions(-) ??? Something isn't right in patch generation. Also: ~/hacking/linux-2.6$ xc-6xx make -j3 GEN /home/grant/hacking/linux-2.6.build/6xx/Makefile HOSTCC scripts/kconfig/zconf.tab.o HOSTLD scripts/kconfig/conf scripts/kconfig/conf --silentoldconfig Kconfig # # configuration written to .config # GEN /home/grant/hacking/linux-2.6.build/6xx/Makefile CHK include/linux/version.h UPD include/linux/version.h HOSTCC scripts/dtc/checks.o In file included from /home/grant/hacking/linux-2.6/scripts/dtc/checks.c:21: /home/grant/hacking/linux-2.6/scripts/dtc/dtc.h:37: fatal error: util.h: No such file or directory compilation terminated. make[3]: *** [scripts/dtc/checks.o] Error 1 make[2]: *** [scripts/dtc] Error 2 make[1]: *** [scripts] Error 2 make[1]: *** Waiting for unfinished jobs make: *** [sub-make] Error 2 (devicetree/test) ~/hacking/linux-2.6$ Looks like the updated dtc is broken. g. ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [PATCH 4/5] of/powerpc: Move build to use generic dts-dtb rule
On 11/16/2010 10:06 PM, Grant Likely wrote: On Tue, Nov 16, 2010 at 02:41:39PM -0800, dirk.brande...@gmail.com wrote: From: Dirk Brandewiedirk.brande...@gmail.com This patch changes arch/powerpc/boot/Makefile to use the generic rule build the device tree blobs in scripts/Makefile.lib Signed-off-by: Dirk Brandewiedirk.brande...@gmail.com --- arch/powerpc/boot/Makefile |7 --- 1 files changed, 0 insertions(+), 7 deletions(-) diff --git a/arch/powerpc/boot/Makefile b/arch/powerpc/boot/Makefile index fae8192..d90c674 100644 --- a/arch/powerpc/boot/Makefile +++ b/arch/powerpc/boot/Makefile @@ -147,8 +147,6 @@ targets += $(patsubst $(obj)/%,%,$(obj-boot) wrapper.a) extra-y:= $(obj)/wrapper.a $(obj-plat) $(obj)/empty.o \ $(obj)/zImage.lds $(obj)/zImage.coff.lds $(obj)/zImage.ps3.lds -dtstree := $(srctree)/$(src)/dts - wrapper:=$(srctree)/$(src)/wrapper wrapperbits:= $(extra-y) $(addprefix $(obj)/,addnote hack-coff mktree) \ $(wrapper) FORCE @@ -331,11 +329,6 @@ $(obj)/treeImage.initrd.%: vmlinux $(obj)/%.dtb $(wrapperbits) $(obj)/treeImage.%: vmlinux $(obj)/%.dtb $(wrapperbits) $(call if_changed,wrap,treeboot-$*,,$(obj)/$*.dtb) -# Rule to build device tree blobs -DTC = $(objtree)/scripts/dtc/dtc - -$(obj)/%.dtb: $(dtstree)/%.dts -$(DTC) -O dtb -o $(obj)/$*.dtb -b 0 $(DTS_FLAGS) $(dtstree)/$*.dts This patch needs to modify the rules that have %.dtb dependencies to go looking in arch/powerpc/boot/dts instead of arch/powerpc/boot because the rule change will change where .dtb files get generated. The rule in patch 1 takes of this. The dts directory is relative to the arch/powerpc/boot/Makefile +quiet_cmd_dtc = DTC$@ + cmd_dtc = $(DTC) -O dtb -o $(obj)/$*.dtb -b 0 $(DTS_FLAGS) $(src)/dts/$*.dts + Also, this patch and patch 5 need to be merged with patch 1 so that the series remains bisectable. I tested building a powerpc image with patch 1 applied and patch 4 unapplied and the image built without errors and the dtb was present in the wrapped image. unfortunately I don't have a system to do runtime testing. I could not build the uboot image type I am missing mkimage. I did build the dtbImage, zImage and cuImage types before and after this patch was applied. --Dirk g. # If there isn't a platform selected then just strip the vmlinux. ifeq (,$(image-y)) -- 1.7.2.3 ___ devicetree-discuss mailing list devicetree-disc...@lists.ozlabs.org https://lists.ozlabs.org/listinfo/devicetree-discuss ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [PATCH 3/5] x86/of: Add building device tree blob(s) into image.
On 11/16/2010 10:02 PM, Grant Likely wrote: On Tue, Nov 16, 2010 at 02:41:38PM -0800, dirk.brande...@gmail.com wrote: From: Dirk Brandewiedirk.brande...@gmail.com This patch adds linking device tree blobs into vmlinux. DTB's are added by adding the blob object name to list of objects to be linked into the image. e.g: obj-$(CONFIG_TEST_DTB) += test.dtb.o The set of DTB linked into the image is controlled the Kconfig file in arch/x86/kernel/dts/Kconfig Signed-off-by: Dirk Brandewiedirk.brande...@gmail.com --- arch/x86/Kconfig|6 +- arch/x86/kernel/Makefile|6 ++ arch/x86/kernel/dts/Kconfig |7 +++ 3 files changed, 18 insertions(+), 1 deletions(-) create mode 100644 arch/x86/kernel/dts/Kconfig diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index 5904f38..f2f516a 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -299,13 +299,17 @@ config X86_BIGSMP ---help--- This option is needed for the systems that have more than 8 CPUs -config X86_OF +menuconfig X86_OF bool Support for device tree select OF select OF_FLATTREE ---help--- Device tree support on X86. +if X86_OF +source arch/x86/kernel/dts/Kconfig +endif + if X86_32 config X86_EXTENDED_PLATFORM bool Support for extended (non-PC) x86 platforms diff --git a/arch/x86/kernel/Makefile b/arch/x86/kernel/Makefile index 586df14..49e017d 100644 --- a/arch/x86/kernel/Makefile +++ b/arch/x86/kernel/Makefile @@ -114,6 +114,12 @@ obj-$(CONFIG_SWIOTLB) += pci-swiotlb.o obj-$(CONFIG_X86_OF) += prom.o ### +# device tree blobs +obj-$(CONFIG_CE4100_DTB) += ce4100.dtb.o +obj-$(CONFIG_TEST_DTB) += test.dtb.o + + +### # 64 bit specific files ifeq ($(CONFIG_X86_64),y) obj-$(CONFIG_AUDIT) += audit_64.o diff --git a/arch/x86/kernel/dts/Kconfig b/arch/x86/kernel/dts/Kconfig new file mode 100644 index 000..d3e5cd4 --- /dev/null +++ b/arch/x86/kernel/dts/Kconfig @@ -0,0 +1,7 @@ +config CE4100_DTB + bool Intel CE4100 + +config TEST_DTB + bool Test DTS + + As previously mentioned, this isn't going to scale. Need to look at allowing the user to specify a list of .dtbs that will be linked in. These config variables will likely get pushed into being set when the platform configuration is selected. I still need to talk to the x86 maintainers and my distribution team to figure out what is going to happen here. g. -- 1.7.2.3 ___ devicetree-discuss mailing list devicetree-disc...@lists.ozlabs.org https://lists.ozlabs.org/listinfo/devicetree-discuss ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev