AT91 Reset cleanup
cover AT91 Reset cleanup
Hi,
the following patch series will merge the ddr controler header file for sam9 and cap9 and cleanup the reset by
swtich to arm_pm_restart
fix the sam9g45 and cap9 reset
make rstc soc independent
The following changes since commit 15327570807209b5c088382af23ed3fc47558d87:
ARM: at91/gpio: fix display of number of irq setuped (2011-11-28 22:53:09 +0800)
are available in the git repository at:
git://github.com/at91linux/linux-at91.git for-arnd-3.3-reset
Jean-Christophe PLAGNIOL-VILLARD (6):
ARM: at91: fix cap9 ddrsdr register
ARM: at91: merge at91cap9_ddrsdr.h in at91sam9_ddrsdr.h
ARM: at91: introduce AT91_SAM9_ALT_RESET to select the at91sam9 alternative reset
ARM: restart: at91: use new restart hook
ARM: at91: Fix at91sam9g45 and at91cap9 reset
ARM: at91: make rstc soc independent
arch/arm/mach-at91/Kconfig | 14 +++ arch/arm/mach-at91/Makefile | 14 ++- arch/arm/mach-at91/at91cap9.c | 9 +-- arch/arm/mach-at91/at91rm9200.c | 4 +- arch/arm/mach-at91/at91sam9260.c | 3 +- arch/arm/mach-at91/at91sam9261.c | 3 +- arch/arm/mach-at91/at91sam9263.c | 3 +- arch/arm/mach-at91/at91sam9_alt_reset.S | 16 +-- arch/arm/mach-at91/at91sam9g45.c | 9 +-- arch/arm/mach-at91/at91sam9g45_reset.S | 40 ++++++++ arch/arm/mach-at91/at91sam9rl.c | 3 +- arch/arm/mach-at91/generic.h | 5 +- arch/arm/mach-at91/include/mach/at91_rstc.h | 18 +++- arch/arm/mach-at91/include/mach/at91cap9.h | 2 +- arch/arm/mach-at91/include/mach/at91cap9_ddrsdr.h | 108 --------------------- arch/arm/mach-at91/include/mach/at91sam9260.h | 2 +- arch/arm/mach-at91/include/mach/at91sam9261.h | 2 +- arch/arm/mach-at91/include/mach/at91sam9263.h | 2 +- arch/arm/mach-at91/include/mach/at91sam9_ddrsdr.h | 30 ++++-- arch/arm/mach-at91/include/mach/at91sam9g45.h | 2 +- arch/arm/mach-at91/include/mach/at91sam9rl.h | 2 +- arch/arm/mach-at91/include/mach/system.h | 5 - arch/arm/mach-at91/pm.c | 9 +-- arch/arm/mach-at91/pm.h | 8 +- arch/arm/mach-at91/pm_slowclock.S | 5 +- arch/arm/mach-at91/setup.c | 9 ++ 26 files changed, 142 insertions(+), 185 deletions(-) create mode 100644 arch/arm/mach-at91/at91sam9g45_reset.S delete mode 100644 arch/arm/mach-at91/include/mach/at91cap9_ddrsdr.h
Best Regards,
J.
cover AT91 Reset cleanup
Quoted 13 lines · Jean-Christophe PLAGNIOL-VILLARD
Hi,
the following patch series will merge the ddr controler header file for sam9 and cap9 and cleanup the reset by
swtich to
arm_pm_restart
fix the sam9g45 and cap9 reset
make rstc soc independentThe following changes since commit
15327570807209b5c088382af23ed3fc47558d87:ARM: at91/gpio: fix display of number of irq setuped (2011-11-28 22:53:09 +0800)
Quoted 8 lines
are available in the git repository at:
git://github.com/at91linux/linux-at91.gitfor-arnd-3.3-resetJean-Christophe PLAGNIOL-VILLARD (6):
ARM: at91: fix cap9 ddrsdr register
ARM: at91: mergeat91cap9_ddrsdr.hinat91sam9_ddrsdr.h
ARM: at91: introduceAT91_SAM9_ALT_RESETto select the at91sam9 alternative reset
ARM: restart: at91: use new restart hook
Well, it looks like you've taken my work here and committed it as yourself. That's plagerism. Don't do it - and fix it before someone pulls your crap.
cover AT91 Reset cleanup
Quoted 17 lines · Russell King - ARM Linux
Quoted 16 lines · Jean-Christophe PLAGNIOL-VILLARD
Hi,
the following patch series will merge the ddr controler header file for sam9 and cap9 and cleanup the reset by
swtich to
arm_pm_restart
fix the sam9g45 and cap9 reset
make rstc soc independentThe following changes since commit
15327570807209b5c088382af23ed3fc47558d87:ARM: at91/gpio: fix display of number of irq setuped (2011-11-28 22:53:09 +0800)
are available in the git repository at:
git://github.com/at91linux/linux-at91.gitfor-arnd-3.3-reset
Quoted 8 lines
Quoted 5 lines
Jean-Christophe PLAGNIOL-VILLARD (6):
ARM: at91: fix cap9 ddrsdr register
ARM: at91: mergeat91cap9_ddrsdr.hinat91sam9_ddrsdr.h
ARM: at91: introduceAT91_SAM9_ALT_RESETto select the at91sam9 alternative reset
ARM: restart: at91: use new restart hookWell, it looks like you've taken my work here and committed it as yourself. That's plagerism. Don't do it - and fix it before someone pulls your crap.
sorry I didn't take your work as mine
Best Regards,
J.
cover AT91 Reset cleanup
In reply to Russell King - ARM LinuxQuoted 1 line
On Tue, Nov 29, 2011 at 06:35:14PM +0100, Jean-Christophe PLAGNIOL-VILLARD
Quoted 16 lines · wrote:
Quoted 16 lines
Hi,
the following patch series will merge the ddr controler header file for sam9 and cap9 and cleanup the reset by
swtich to
arm_pm_restart
fix the sam9g45 and cap9 reset
make rstc soc independentThe following changes since commit
15327570807209b5c088382af23ed3fc47558d87:
ARM: at91/gpio: fix display of number of irq setuped (2011-11-28 22:53:09 +0800)are available in the git repository at:
git://github.com/at91linux/linux-at91.gitfor-arnd-3.3-reset
Quoted 8 lines
Quoted 5 lines
Jean-Christophe PLAGNIOL-VILLARD (6):
ARM: at91: fix cap9 ddrsdr register
ARM: at91: mergeat91cap9_ddrsdr.hinat91sam9_ddrsdr.h
ARM: at91: introduceAT91_SAM9_ALT_RESETto select the at91sam9 alternative reset ARM: restart: at91: use new restart hookWell, it looks like you've taken my work here and committed it as yourself. That's plagerism. Don't do it - and fix it before someone pulls your crap.
Hey,
looking at the patch in question, it looks so trivial the clash is just possible. Why not just put two SoB lines there and maybe From: and be done with it?
M
cover AT91 Reset cleanup
Quoted 24 lines · Marek Vasut
Quoted 1 line
On Tue, Nov 29, 2011 at 06:35:14PM +0100, Jean-Christophe PLAGNIOL-VILLARD
Quoted 22 lines · wrote:
Quoted 21 lines
Hi,
the following patch series will merge the ddr controler header file for sam9 and cap9 and cleanup the reset by
swtich to
arm_pm_restart
fix the sam9g45 and cap9 reset
make rstc soc independentThe following changes since commit
15327570807209b5c088382af23ed3fc47558d87:
ARM: at91/gpio: fix display of number of irq setuped (2011-11-28 22:53:09 +0800)are available in the git repository at:
git://github.com/at91linux/linux-at91.gitfor-arnd-3.3-resetJean-Christophe PLAGNIOL-VILLARD (6):
ARM: at91: fix cap9 ddrsdr register
ARM: at91: mergeat91cap9_ddrsdr.hinat91sam9_ddrsdr.h
ARM: at91: introduceAT91_SAM9_ALT_RESETto select the at91sam9 alternative reset ARM: restart: at91: use new restart hook
Quoted 8 lines
Quoted 2 lines
Well, it looks like you've taken my work here and committed it as yourself. That's plagerism. Don't do it - and fix it before someone pulls your crap.
Hey,
looking at the patch in question, it looks so trivial the clash is just possible. Why not just put two SoB lines there and maybe From: and be done with it?
Look closer. The patch which was posted has my sign-off on it, it says it's from me, but according to the commit summary, it's author is Jean- Christophe.
So, it _is_ my patch which Jean has decided to _recommit_ into his tree taking it from my tree _without_ _asking_ _me_ whether it was either a good idea to do that, whether it was a finished patch, etc.
So all in all I'm pretty disgusted with Jean-Christophe over this.
I would like to see my patch updated at some point not to use arm_pm_restart, but to use the .restart method directly, like I've been doing for everyone else. In other words, this patch is NOT STABLE at the present time.
cover AT91 Reset cleanup
Quoted 8 lines · Marek Vasut
Quoted 7 lines
Quoted 2 lines
On Tue, Nov 29, 2011 at 06:35:14PM +0100, Jean-Christophe PLAGNIOL-VILLARD
Quoted 3 lines · wrote:
Quoted 3 lines
Hi,
the following patch series will merge the ddr controler header
file
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
for sam9 and cap9 and cleanup the reset by
swtich to
arm_pm_restart
fix the sam9g45 and cap9 reset
make rstc soc independentThe following changes since commit
15327570807209b5c088382af23ed3fc47558d87:
Quoted 22 lines
Quoted 16 lines
Quoted 12 lines
Quoted 11 lines
ARM: at91/gpio: fix display of number of irq setuped (2011-11-28 22:53:09 +0800)
are available in the git repository at:
git://github.com/at91linux/linux-at91.gitfor-arnd-3.3-resetJean-Christophe PLAGNIOL-VILLARD (6):
ARM: at91: fix cap9 ddrsdr register
ARM: at91: mergeat91cap9_ddrsdr.hinat91sam9_ddrsdr.h
ARM: at91: introduceAT91_SAM9_ALT_RESETto select the at91sam9 alternative reset ARM: restart: at91: use new restart hookQuoted 3 lines
Well, it looks like you've taken my work here and committed it as yourself. That's plagerism. Don't do it - and fix it before someone pulls your crap.
Quoted 5 lines
Hey,
looking at the patch in question, it looks so trivial the clash is just possible. Why not just put two SoB lines there and maybe From: and be done with it?
Quoted 7 lines
Look closer. The patch which was posted has my sign-off on it, it says it's from me, but according to the commit summary, it's author is Jean- Christophe.
So, it _is_ my patch which Jean has decided to _recommit_ into his tree taking it from my tree _without_ _asking_ _me_ whether it was either a good idea to do that, whether it was a finished patch, etc.
Ah ok, I see.
Quoted 2 lines
So all in all I'm pretty disgusted with Jean-Christophe over this.
Oh come on, calm down. Just keep an eye on him so he won't do it again and be done with it ;-) And Jean should certainly drop the patch if it's unfinished stuff.
Quoted 5 lines
I would like to see my patch updated at some point not to use
arm_pm_restart, but to use the .restart method directly, like I've been doing for everyone else. In other words, this patch is NOT STABLE at the present time.
OK
cover AT91 Reset cleanup
Quoted 2 lines · Marek Vasut
Just keep an eye on him so he won't do it again and be done with it ;-) And Jean should certainly drop the patch if it's unfinished stuff.
Oh so I should say nothing and let people take my work hand over fist. No thanks, that's not the game I play.
cover AT91 Reset cleanup
Quoted 6 lines · Marek Vasut
Quoted 2 lines
Just keep an eye on him so he won't do it again and be done with it ;-) And Jean should certainly drop the patch if it's unfinished stuff.
Oh so I should say nothing and let people take my work hand over fist. No thanks, that's not the game I play.
I never said that and I understand your point clearly, don't be mistaken. What I meant was more like -- don't get that angry so fast and don't use so strong words, it's only a piece of code afterall.
cover AT91 Reset cleanup
Quoted 10 lines · Marek Vasut
Quoted 6 lines · Marek Vasut
Quoted 2 lines
Just keep an eye on him so he won't do it again and be done with it ;-) And Jean should certainly drop the patch if it's unfinished stuff.
Oh so I should say nothing and let people take my work hand over fist. No thanks, that's not the game I play.
I never said that and I understand your point clearly, don't be mistaken. What I meant was more like -- don't get that angry so fast and don't use so strong words, it's only a piece of code afterall.
Sorry, I wasn't getting angry - am I not allowed to point out my disgust at someone who's been around for quite some time making such a mistake?
cover AT91 Reset cleanup
Quoted 9 lines · Marek Vasut
Quoted 8 lines
Quoted 7 lines · Marek Vasut
Quoted 3 lines
Just keep an eye on him so he won't do it again and be done with it ;-) And Jean should certainly drop the patch if it's unfinished stuff.
Oh so I should say nothing and let people take my work hand over fist. No thanks, that's not the game I play.
Quoted 6 lines
Quoted 3 lines
I never said that and I understand your point clearly, don't be mistaken. What I meant was more like -- don't get that angry so fast and don't use so strong words, it's only a piece of code afterall.
Sorry, I wasn't getting angry - am I not allowed to point out my disgust at someone who's been around for quite some time making such a mistake?
Don't even the best of us make mistakes?
M
cover AT91 Reset cleanup
In reply to Russell King - ARM LinuxQuoted 8 lines · Russell King - ARM Linux
Quoted 7 lines · Marek Vasut
Quoted 6 lines · Marek Vasut
Quoted 2 lines
Just keep an eye on him so he won't do it again and be done with it ;-) And Jean should certainly drop the patch if it's unfinished stuff.
Oh so I should say nothing and let people take my work hand over fist. No thanks, that's not the game I play.
Quoted 6 lines
Quoted 3 lines
I never said that and I understand your point clearly, don't be mistaken. What I meant was more like -- don't get that angry so fast and don't use so strong words, it's only a piece of code afterall.
Sorry, I wasn't getting angry - am I not allowed to point out my disgust at someone who's been around for quite some time making such a mistake?
Russell is right I did the mistake not on purpose but I did
I apologize end of the story
Best Regards,
J.
PATCH 1/6 ARM: at91: fix cap9 ddrsdr register
In reply to Jean-Christophe PLAGNIOL-VILLARDfix AT91_DDRSDRC_MODE it's 3bit
add missing AT91_DDRSDRC_NR_14, AT91_DDRSDRC_DBW (16 and 32 bits support)
--- arch/arm/mach-at91/include/mach/at91cap9_ddrsdr.h | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-)
arch/arm/mach-at91/include/mach/at91cap9_ddrsdr.h +5 -1
@@ -16,7 +16,7 @@#define AT91CAP9_DDRSDR_H #define AT91_DDRSDRC_MR 0x00/* Mode Register */ -#define AT91_DDRSDRC_MODE (0xf << 0)/* Command Mode */ +#define AT91_DDRSDRC_MODE (0x7 << 0)/* Command Mode */ #define AT91_DDRSDRC_MODE_NORMAL 0#define AT91_DDRSDRC_MODE_NOP 1#define AT91_DDRSDRC_MODE_PRECHARGE 2
@@ -42,6 +42,7 @@#define AT91_DDRSDRC_NR_11 (0 << 2)#define AT91_DDRSDRC_NR_12 (1 << 2)#define AT91_DDRSDRC_NR_13 (2 << 2) +#define AT91_DDRSDRC_NR_14 (3 << 2)#define AT91_DDRSDRC_CAS (7 << 4)/* CAS Latency */ #define AT91_DDRSDRC_CAS_2 (2 << 4)#define AT91_DDRSDRC_CAS_3 (3 << 4)
@@ -86,6 +87,9 @@#define AT91_DDRSDRC_MD_LOW_POWER_SDR 1#define AT91_DDRSDRC_MD_DDR 2#define AT91_DDRSDRC_MD_LOW_POWER_DDR 3 +#define AT91_DDRSDRC_DBW (1 << 4)/* Data Bus Width */ +#define AT91_DDRSDRC_DBW_32BITS (0 << 4) +#define AT91_DDRSDRC_DBW_16BITS (1 << 4)#define AT91_DDRSDRC_DLLR 0x20/* DLL Information Register */ #define AT91_DDRSDRC_MDINC (1 << 0)/* Master Delay increment */
Signature · 1 line
1.7.7
PATCH 2/6 ARM: at91: merge at91cap9_ddrsdr.h in at91sam9_ddrsdr.h
In reply to Jean-Christophe PLAGNIOL-VILLARD--- arch/arm/mach-at91/include/mach/at91cap9_ddrsdr.h | 112 --------------------- arch/arm/mach-at91/include/mach/at91sam9_ddrsdr.h | 30 ++++-- arch/arm/mach-at91/pm.h | 8 +- arch/arm/mach-at91/pm_slowclock.S | 5 +- 4 files changed, 26 insertions(+), 129 deletions(-) delete mode 100644 arch/arm/mach-at91/include/mach/at91cap9_ddrsdr.h
arch/arm/mach-at91/include/mach/at91cap9_ddrsdr.h deleted +0 -112
@@ -1,112 +0,0 @@ -/* -* arch/arm/mach-at91/include/mach/at91cap9_ddrsdr.h -* -* (C) 2008 Andrew Victor -* -* DDR/SDR Controller (DDRSDRC) - System peripherals registers. -* Based on AT91CAP9 datasheet revision B. -* -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. -*/ - -#ifndef AT91CAP9_DDRSDR_H -#define AT91CAP9_DDRSDR_H - -#define AT91_DDRSDRC_MR 0x00/* Mode Register */ -#define AT91_DDRSDRC_MODE (0x7 << 0)/* Command Mode */ -#define AT91_DDRSDRC_MODE_NORMAL 0 -#define AT91_DDRSDRC_MODE_NOP 1 -#define AT91_DDRSDRC_MODE_PRECHARGE 2 -#define AT91_DDRSDRC_MODE_LMR 3 -#define AT91_DDRSDRC_MODE_REFRESH 4 -#define AT91_DDRSDRC_MODE_EXT_LMR 5 -#define AT91_DDRSDRC_MODE_DEEP 6 - -#define AT91_DDRSDRC_RTR 0x04/* Refresh Timer Register */ -#define AT91_DDRSDRC_COUNT (0xfff << 0)/* Refresh Timer Counter */ - -#define AT91_DDRSDRC_CR 0x08/* Configuration Register */ -#define AT91_DDRSDRC_NC (3 << 0)/* Number of Column Bits */ -#define AT91_DDRSDRC_NC_SDR8 (0 << 0) -#define AT91_DDRSDRC_NC_SDR9 (1 << 0) -#define AT91_DDRSDRC_NC_SDR10 (2 << 0) -#define AT91_DDRSDRC_NC_SDR11 (3 << 0) -#define AT91_DDRSDRC_NC_DDR9 (0 << 0) -#define AT91_DDRSDRC_NC_DDR10 (1 << 0) -#define AT91_DDRSDRC_NC_DDR11 (2 << 0) -#define AT91_DDRSDRC_NC_DDR12 (3 << 0) -#define AT91_DDRSDRC_NR (3 << 2)/* Number of Row Bits */ -#define AT91_DDRSDRC_NR_11 (0 << 2) -#define AT91_DDRSDRC_NR_12 (1 << 2) -#define AT91_DDRSDRC_NR_13 (2 << 2) -#define AT91_DDRSDRC_NR_14 (3 << 2) -#define AT91_DDRSDRC_CAS (7 << 4)/* CAS Latency */ -#define AT91_DDRSDRC_CAS_2 (2 << 4) -#define AT91_DDRSDRC_CAS_3 (3 << 4) -#define AT91_DDRSDRC_CAS_25 (6 << 4) -#define AT91_DDRSDRC_DLL (1 << 7)/* Reset DLL */ -#define AT91_DDRSDRC_DICDS (1 << 8)/* Output impedance control */ - -#define AT91_DDRSDRC_T0PR 0x0C/* Timing 0 Register */ -#define AT91_DDRSDRC_TRAS (0xf << 0)/* Active to Precharge delay */ -#define AT91_DDRSDRC_TRCD (0xf << 4)/* Row to Column delay */ -#define AT91_DDRSDRC_TWR (0xf << 8)/* Write recovery delay */ -#define AT91_DDRSDRC_TRC (0xf << 12)/* Row cycle delay */ -#define AT91_DDRSDRC_TRP (0xf << 16)/* Row precharge delay */ -#define AT91_DDRSDRC_TRRD (0xf << 20)/* Active BankA to BankB */ -#define AT91_DDRSDRC_TWTR (1 << 24)/* Internal Write to Read delay */ -#define AT91_DDRSDRC_TMRD (0xf << 28)/* Load mode to active/refresh delay */ - -#define AT91_DDRSDRC_T1PR 0x10/* Timing 1 Register */ -#define AT91_DDRSDRC_TRFC (0x1f << 0)/* Row Cycle Delay */ -#define AT91_DDRSDRC_TXSNR (0xff << 8)/* Exit self-refresh to non-read */ -#define AT91_DDRSDRC_TXSRD (0xff << 16)/* Exit self-refresh to read */ -#define AT91_DDRSDRC_TXP (0xf << 24)/* Exit power-down delay */ - -#define AT91_DDRSDRC_LPR 0x18/* Low Power Register */ -#define AT91_DDRSDRC_LPCB (3 << 0)/* Low-power Configurations */ -#define AT91_DDRSDRC_LPCB_DISABLE 0 -#define AT91_DDRSDRC_LPCB_SELF_REFRESH 1 -#define AT91_DDRSDRC_LPCB_POWER_DOWN 2 -#define AT91_DDRSDRC_LPCB_DEEP_POWER_DOWN 3 -#define AT91_DDRSDRC_CLKFR (1 << 2)/* Clock Frozen */ -#define AT91_DDRSDRC_PASR (7 << 4)/* Partial Array Self Refresh */ -#define AT91_DDRSDRC_TCSR (3 << 8)/* Temperature Compensated Self Refresh */ -#define AT91_DDRSDRC_DS (3 << 10)/* Drive Strength */ -#define AT91_DDRSDRC_TIMEOUT (3 << 12)/* Time to define when Low Power Mode is enabled */ -#define AT91_DDRSDRC_TIMEOUT_0_CLK_CYCLES (0 << 12) -#define AT91_DDRSDRC_TIMEOUT_64_CLK_CYCLES (1 << 12) -#define AT91_DDRSDRC_TIMEOUT_128_CLK_CYCLES (2 << 12) - -#define AT91_DDRSDRC_MDR 0x1C/* Memory Device Register */ -#define AT91_DDRSDRC_MD (3 << 0)/* Memory Device Type */ -#define AT91_DDRSDRC_MD_SDR 0 -#define AT91_DDRSDRC_MD_LOW_POWER_SDR 1 -#define AT91_DDRSDRC_MD_DDR 2 -#define AT91_DDRSDRC_MD_LOW_POWER_DDR 3 -#define AT91_DDRSDRC_DBW (1 << 4)/* Data Bus Width */ -#define AT91_DDRSDRC_DBW_32BITS (0 << 4) -#define AT91_DDRSDRC_DBW_16BITS (1 << 4) - -#define AT91_DDRSDRC_DLLR 0x20/* DLL Information Register */ -#define AT91_DDRSDRC_MDINC (1 << 0)/* Master Delay increment */ -#define AT91_DDRSDRC_MDDEC (1 << 1)/* Master Delay decrement */ -#define AT91_DDRSDRC_MDOVF (1 << 2)/* Master Delay Overflow */ -#define AT91_DDRSDRC_SDCOVF (1 << 3)/* Slave Delay Correction Overflow */ -#define AT91_DDRSDRC_SDCUDF (1 << 4)/* Slave Delay Correction Underflow */ -#define AT91_DDRSDRC_SDERF (1 << 5)/* Slave Delay Correction error */ -#define AT91_DDRSDRC_MDVAL (0xff << 8)/* Master Delay value */ -#define AT91_DDRSDRC_SDVAL (0xff << 16)/* Slave Delay value */ -#define AT91_DDRSDRC_SDCVAL (0xff << 24)/* Slave Delay Correction value */ - -/* Register access macros */ -#define at91_ramc_read (num, reg) \ - at91_sys_read(AT91_DDRSDRC##num + reg) -#define at91_ramc_write (num, reg, value) \ - at91_sys_write(AT91_DDRSDRC##num + reg, value) - - -#endif
arch/arm/mach-at91/include/mach/at91sam9_ddrsdr.h +20 -10
@@ -46,10 +46,10 @@#define AT91_DDRSDRC_CAS_25 (6 << 4)#define AT91_DDRSDRC_RST_DLL (1 << 7)/* Reset DLL */ #define AT91_DDRSDRC_DICDS (1 << 8)/* Output impedance control */ -#define AT91_DDRSDRC_DIS_DLL (1 << 9)/* Disable DLL */ -#define AT91_DDRSDRC_OCD (1 << 12)/* Off-Chip Driver */ -#define AT91_DDRSDRC_DQMS (1 << 16)/* Mask Data is Shared */ -#define AT91_DDRSDRC_ACTBST (1 << 18)/* Active Bank X to Burst Stop Read Access Bank Y */ +#define AT91_DDRSDRC_DIS_DLL (1 << 9)/* Disable DLL [SAM9 Only] */ +#define AT91_DDRSDRC_OCD (1 << 12)/* Off-Chip Driver [SAM9 Only] */ +#define AT91_DDRSDRC_DQMS (1 << 16)/* Mask Data is Shared [SAM9 Only] */ +#define AT91_DDRSDRC_ACTBST (1 << 18)/* Active Bank X to Burst Stop Read Access Bank Y [SAM9 Only] */ #define AT91_DDRSDRC_T0PR 0x0C/* Timing 0 Register */ #define AT91_DDRSDRC_TRAS (0xf << 0)/* Active to Precharge delay */
@@ -59,7 +59,8 @@#define AT91_DDRSDRC_TRP (0xf << 16)/* Row precharge delay */ #define AT91_DDRSDRC_TRRD (0xf << 20)/* Active BankA to BankB */ #define AT91_DDRSDRC_TWTR (0x7 << 24)/* Internal Write to Read delay */ -#define AT91_DDRSDRC_RED_WRRD (0x1 << 27)/* Reduce Write to Read Delay */ +#define AT91CAP9_DDRSDRC_TWTR (1 << 24)/* Internal Write to Read delay */ +#define AT91_DDRSDRC_RED_WRRD (0x1 << 27)/* Reduce Write to Read Delay [SAM9 Only] */ #define AT91_DDRSDRC_TMRD (0xf << 28)/* Load mode to active/refresh delay */ #define AT91_DDRSDRC_T1PR 0x10/* Timing 1 Register */
@@ -68,13 +69,14 @@#define AT91_DDRSDRC_TXSRD (0xff << 16)/* Exit self-refresh to read */ #define AT91_DDRSDRC_TXP (0xf << 24)/* Exit power-down delay */ -#define AT91_DDRSDRC_T2PR 0x14/* Timing 2 Register */ +#define AT91_DDRSDRC_T2PR 0x14/* Timing 2 Register [SAM9 Only] */ #define AT91_DDRSDRC_TXARD (0xf << 0)/* Exit active power down delay to read command in mode "Fast Exit" */ #define AT91_DDRSDRC_TXARDS (0xf << 4)/* Exit active power down delay to read command in mode "Slow Exit" */ #define AT91_DDRSDRC_TRPA (0xf << 8)/* Row Precharge All delay */ #define AT91_DDRSDRC_TRTP (0x7 << 12)/* Read to Precharge delay */ #define AT91_DDRSDRC_LPR 0x1C/* Low Power Register */ +#define AT91CAP9_DDRSDRC_LPR 0x18/* Low Power Register */ #define AT91_DDRSDRC_LPCB (3 << 0)/* Low-power Configurations */ #define AT91_DDRSDRC_LPCB_DISABLE 0#define AT91_DDRSDRC_LPCB_SELF_REFRESH 1
@@ -92,32 +94,40 @@#define AT91_DDRSDRC_UPD_MR (3 << 20)/* Update load mode register and extended mode register */ #define AT91_DDRSDRC_MDR 0x20/* Memory Device Register */ +#define AT91CAP9_DDRSDRC_MDR 0x1C/* Memory Device Register */ #define AT91_DDRSDRC_MD (3 << 0)/* Memory Device Type */ #define AT91_DDRSDRC_MD_SDR 0#define AT91_DDRSDRC_MD_LOW_POWER_SDR 1 +#define AT91CAP9_DDRSDRC_MD_DDR 2#define AT91_DDRSDRC_MD_LOW_POWER_DDR 3 -#define AT91_DDRSDRC_MD_DDR2 6 +#define AT91_DDRSDRC_MD_DDR2 6/* [SAM9 Only] */ #define AT91_DDRSDRC_DBW (1 << 4)/* Data Bus Width */ #define AT91_DDRSDRC_DBW_32BITS (0 << 4)#define AT91_DDRSDRC_DBW_16BITS (1 << 4)#define AT91_DDRSDRC_DLL 0x24/* DLL Information Register */ +#define AT91CAP9_DDRSDRC_DLL 0x20/* DLL Information Register */ #define AT91_DDRSDRC_MDINC (1 << 0)/* Master Delay increment */ #define AT91_DDRSDRC_MDDEC (1 << 1)/* Master Delay decrement */ #define AT91_DDRSDRC_MDOVF (1 << 2)/* Master Delay Overflow */ +#define AT91CAP9_DDRSDRC_SDCOVF (1 << 3)/* Slave Delay Correction Overflow */ +#define AT91CAP9_DDRSDRC_SDCUDF (1 << 4)/* Slave Delay Correction Underflow */ +#define AT91CAP9_DDRSDRC_SDERF (1 << 5)/* Slave Delay Correction error */ #define AT91_DDRSDRC_MDVAL (0xff << 8)/* Master Delay value */ +#define AT91CAP9_DDRSDRC_SDVAL (0xff << 16)/* Slave Delay value */ +#define AT91CAP9_DDRSDRC_SDCVAL (0xff << 24)/* Slave Delay Correction value */ -#define AT91_DDRSDRC_HS 0x2C/* High Speed Register */ +#define AT91_DDRSDRC_HS 0x2C/* High Speed Register [SAM9 Only] */ #define AT91_DDRSDRC_DIS_ATCP_RD (1 << 2)/* Anticip read access is disabled */ #define AT91_DDRSDRC_DELAY (n) (0x30 + (0x4 * (n)))/* Delay I/O Register n */ -#define AT91_DDRSDRC_WPMR 0xE4/* Write Protect Mode Register */ +#define AT91_DDRSDRC_WPMR 0xE4/* Write Protect Mode Register [SAM9 Only] */ #define AT91_DDRSDRC_WP (1 << 0)/* Write protect enable */ #define AT91_DDRSDRC_WPKEY (0xffffff << 8)/* Write protect key */ #define AT91_DDRSDRC_KEY (0x444452 << 8)/* Write protect key = "DDR" */ -#define AT91_DDRSDRC_WPSR 0xE8/* Write Protect Status Register */ +#define AT91_DDRSDRC_WPSR 0xE8/* Write Protect Status Register [SAM9 Only] */ #define AT91_DDRSDRC_WPVS (1 << 0)/* Write protect violation status */ #define AT91_DDRSDRC_WPVSRC (0xffff << 8)/* Write protect violation source */
arch/arm/mach-at91/pm.h +4 -4
@@ -25,21 +25,21 @@ static inline u32 sdram_selfrefresh_enable(void) : : "r" (0))#elif defined(CONFIG_ARCH_AT91CAP9 ) -#include <mach/at91cap9_ddrsdr.h> +#include <mach/at91sam9_ddrsdr.h> static inline u32 sdram_selfrefresh_enable (void ) {u32 saved_lpr, lpr; - saved_lpr =at91_ramc_read (0 ,AT91_DDRSDRC_LPR ); + saved_lpr =at91_ramc_read (0 ,AT91CAP9_DDRSDRC_LPR ); lpr = saved_lpr & ~AT91_DDRSDRC_LPCB ; -at91_ramc_write (0 ,AT91_DDRSDRC_LPR , lpr |AT91_DDRSDRC_LPCB_SELF_REFRESH ); +at91_ramc_write (0 ,AT91CAP9_DDRSDRC_LPR , lpr |AT91_DDRSDRC_LPCB_SELF_REFRESH );return saved_lpr; } -#define sdram_selfrefresh_disable (saved_lpr) at91_ramc_write(0, AT91_DDRSDRC_LPR, saved_lpr) +#define sdram_selfrefresh_disable (saved_lpr) at91_ramc_write(0, AT91CAP9_DDRSDRC_LPR, saved_lpr)#define wait_for_interrupt_enable () cpu_do_idle()#elif defined(CONFIG_ARCH_AT91SAM9G45 )
arch/arm/mach-at91/pm_slowclock.S +2 -3
@@ -18,9 +18,8 @@ #if defined(CONFIG_ARCH_AT91RM9200) #include <mach/at91rm9200_mc.h> -#elif defined(CONFIG_ARCH_AT91CAP9) -#include <mach/at91cap9_ddrsdr.h> -#elif defined(CONFIG_ARCH_AT91SAM9G45) +#elif defined(CONFIG_ARCH_AT91CAP9) \ + || defined(CONFIG_ARCH_AT91SAM9G45) #include <mach/at91sam9_ddrsdr.h> #else #include <mach/at91sam9_sdramc.h>
Signature · 1 line
1.7.7
PATCH 3/6 ARM: at91: introduce AT91_SAM9_ALT_RESET to select the at91sam9 alternative reset
In reply to Jean-Christophe PLAGNIOL-VILLARD--- arch/arm/mach-at91/Kconfig | 9 +++++++++ arch/arm/mach-at91/Makefile | 13 +++++++------ 2 files changed, 16 insertions(+), 6 deletions(-)
arch/arm/mach-at91/Kconfig +9 -0
@@ -18,6 +18,9 @@ config HAVE_AT91_USART4 config HAVE_AT91_USART5 bool +config AT91_SAM9_ALT_RESET + bool + menu "Atmel AT91 System-on-Chip" choice
@@ -39,6 +42,7 @@ config ARCH_AT91SAM9260 select HAVE_AT91_USART4 select HAVE_AT91_USART5 select HAVE_NET_MACB + select AT91_SAM9_ALT_RESET config ARCH_AT91SAM9261 bool "AT91SAM9261"
@@ -46,6 +50,7 @@ config ARCH_AT91SAM9261 select GENERIC_CLOCKEVENTS select HAVE_FB_ATMEL select HAVE_AT91_DBGU0 + select AT91_SAM9_ALT_RESET config ARCH_AT91SAM9G10 bool "AT91SAM9G10"
@@ -53,6 +58,7 @@ config ARCH_AT91SAM9G10 select GENERIC_CLOCKEVENTS select HAVE_AT91_DBGU0 select HAVE_FB_ATMEL + select AT91_SAM9_ALT_RESET config ARCH_AT91SAM9263 bool "AT91SAM9263"
@@ -61,6 +67,7 @@ config ARCH_AT91SAM9263 select HAVE_FB_ATMEL select HAVE_NET_MACB select HAVE_AT91_DBGU1 + select AT91_SAM9_ALT_RESET config ARCH_AT91SAM9RL bool "AT91SAM9RL"
@@ -69,6 +76,7 @@ config ARCH_AT91SAM9RL select HAVE_AT91_USART3 select HAVE_FB_ATMEL select HAVE_AT91_DBGU0 + select AT91_SAM9_ALT_RESET config ARCH_AT91SAM9G20 bool "AT91SAM9G20"
@@ -79,6 +87,7 @@ config ARCH_AT91SAM9G20 select HAVE_AT91_USART4 select HAVE_AT91_USART5 select HAVE_NET_MACB + select AT91_SAM9_ALT_RESET config ARCH_AT91SAM9G45 bool "AT91SAM9G45"
arch/arm/mach-at91/Makefile +7 -6
@@ -8,15 +8,16 @@ obj-n := obj- := obj-$(CONFIG_AT91_PMC_UNIT) += clock.o +obj-$(CONFIG_AT91_SAM9_ALT_RESET) += at91sam9_alt_reset.o # CPU-specific support obj-$(CONFIG_ARCH_AT91RM9200) += at91rm9200.o at91rm9200_time.o at91rm9200_devices.o -obj-$(CONFIG_ARCH_AT91SAM9260) += at91sam9260.o at91sam926x_time.o at91sam9260_devices.o sam9_smc.o at91sam9_alt_reset.o -obj-$(CONFIG_ARCH_AT91SAM9261) += at91sam9261.o at91sam926x_time.o at91sam9261_devices.o sam9_smc.o at91sam9_alt_reset.o -obj-$(CONFIG_ARCH_AT91SAM9G10) += at91sam9261.o at91sam926x_time.o at91sam9261_devices.o sam9_smc.o at91sam9_alt_reset.o -obj-$(CONFIG_ARCH_AT91SAM9263) += at91sam9263.o at91sam926x_time.o at91sam9263_devices.o sam9_smc.o at91sam9_alt_reset.o -obj-$(CONFIG_ARCH_AT91SAM9RL) += at91sam9rl.o at91sam926x_time.o at91sam9rl_devices.o sam9_smc.o at91sam9_alt_reset.o -obj-$(CONFIG_ARCH_AT91SAM9G20) += at91sam9260.o at91sam926x_time.o at91sam9260_devices.o sam9_smc.o at91sam9_alt_reset.o +obj-$(CONFIG_ARCH_AT91SAM9260) += at91sam9260.o at91sam926x_time.o at91sam9260_devices.o sam9_smc.o +obj-$(CONFIG_ARCH_AT91SAM9261) += at91sam9261.o at91sam926x_time.o at91sam9261_devices.o sam9_smc.o +obj-$(CONFIG_ARCH_AT91SAM9G10) += at91sam9261.o at91sam926x_time.o at91sam9261_devices.o sam9_smc.o +obj-$(CONFIG_ARCH_AT91SAM9263) += at91sam9263.o at91sam926x_time.o at91sam9263_devices.o sam9_smc.o +obj-$(CONFIG_ARCH_AT91SAM9RL) += at91sam9rl.o at91sam926x_time.o at91sam9rl_devices.o sam9_smc.o +obj-$(CONFIG_ARCH_AT91SAM9G20) += at91sam9260.o at91sam926x_time.o at91sam9260_devices.o sam9_smc.o obj-$(CONFIG_ARCH_AT91SAM9G45) += at91sam9g45.o at91sam926x_time.o at91sam9g45_devices.o sam9_smc.o obj-$(CONFIG_ARCH_AT91CAP9) += at91cap9.o at91sam926x_time.o at91cap9_devices.o sam9_smc.o obj-$(CONFIG_ARCH_AT91X40) += at91x40.o at91x40_time.o
Signature · 1 line
1.7.7
PATCH 4/6 ARM: restart: at91: use new restart hook
In reply to Jean-Christophe PLAGNIOL-VILLARDFrom: Russell King <[email protected]>
Rather than using a private function pointer, use the existing arm_pm_restart function pointer instead. We no longer need to enable the I-cache in at91sam9_alt_reset() as the caches will now be on when this function is called.
Update the function names to use the 'restart' terminology rather than the 'reboot' terminology.
--- arch/arm/mach-at91/at91cap9.c | 4 ++-- arch/arm/mach-at91/at91rm9200.c | 4 ++-- arch/arm/mach-at91/at91sam9260.c | 2 +- arch/arm/mach-at91/at91sam9261.c | 2 +- arch/arm/mach-at91/at91sam9263.c | 2 +- arch/arm/mach-at91/at91sam9_alt_reset.S | 9 ++------- arch/arm/mach-at91/at91sam9g45.c | 4 ++-- arch/arm/mach-at91/at91sam9rl.c | 2 +- arch/arm/mach-at91/generic.h | 3 +-- arch/arm/mach-at91/include/mach/system.h | 5 ----- 10 files changed, 13 insertions(+), 24 deletions(-)
arch/arm/mach-at91/at91cap9.c +2 -2
@@ -312,7 +312,7 @@ static struct at91_gpio_bank at91cap9_gpio[] __initdata = { } }; -static void at91cap9_reset (void ) +static void at91cap9_restart (char mode,const char *cmd) {at91_sys_write (AT91_RSTC_CR ,AT91_RSTC_KEY |AT91_RSTC_PROCRST |AT91_RSTC_PERRST ); }
@@ -335,7 +335,7 @@ static void __init at91cap9_ioremap_registers(void)static void __init at91cap9_initialize (void ) { - at91_arch_reset = at91cap9_reset; + arm_pm_restart = at91cap9_restart; at91_extern_irq = (1 <<AT91CAP9_ID_IRQ0 ) | (1 <<AT91CAP9_ID_IRQ1 );/* Register GPIO subsystem */
arch/arm/mach-at91/at91rm9200.c +2 -2
@@ -289,7 +289,7 @@ static struct at91_gpio_bank at91rm9200_gpio[] __initdata = { } }; -static void at91rm9200_reset (void ) +static void at91rm9200_restart (char mode,const char *cmd) {/* * Perform a hardware reset with the use of the Watchdog timer.
@@ -314,7 +314,7 @@ static void __init at91rm9200_ioremap_registers(void)static void __init at91rm9200_initialize (void ) { - at91_arch_reset = at91rm9200_reset; + arm_pm_restart = at91rm9200_restart; at91_extern_irq = (1 <<AT91RM9200_ID_IRQ0 ) | (1 <<AT91RM9200_ID_IRQ1 ) | (1 <<AT91RM9200_ID_IRQ2 ) | (1 <<AT91RM9200_ID_IRQ3 ) | (1 <<AT91RM9200_ID_IRQ4 ) | (1 <<AT91RM9200_ID_IRQ5 )
arch/arm/mach-at91/at91sam9260.c +1 -1
@@ -327,7 +327,7 @@ static void __init at91sam9260_ioremap_registers(void)static void __init at91sam9260_initialize (void ) { - at91_arch_reset = at91sam9_alt_reset; + arm_pm_restart = at91sam9_alt_restart; at91_extern_irq = (1 <<AT91SAM9260_ID_IRQ0 ) | (1 <<AT91SAM9260_ID_IRQ1 ) | (1 <<AT91SAM9260_ID_IRQ2 );
arch/arm/mach-at91/at91sam9261.c +1 -1
@@ -287,7 +287,7 @@ static void __init at91sam9261_ioremap_registers(void)static void __init at91sam9261_initialize (void ) { - at91_arch_reset = at91sam9_alt_reset; + arm_pm_restart = at91sam9_alt_restart; at91_extern_irq = (1 <<AT91SAM9261_ID_IRQ0 ) | (1 <<AT91SAM9261_ID_IRQ1 ) | (1 <<AT91SAM9261_ID_IRQ2 );
arch/arm/mach-at91/at91sam9263.c +1 -1
@@ -306,7 +306,7 @@ static void __init at91sam9263_ioremap_registers(void)static void __init at91sam9263_initialize (void ) { - at91_arch_reset = at91sam9_alt_reset; + arm_pm_restart = at91sam9_alt_restart; at91_extern_irq = (1 <<AT91SAM9263_ID_IRQ0 ) | (1 <<AT91SAM9263_ID_IRQ1 );/* Register GPIO subsystem */
arch/arm/mach-at91/at91sam9_alt_reset.S +2 -7
@@ -14,20 +14,15 @@ */ #include <linux/linkage.h> -#include <asm/system.h> #include <mach/hardware.h> #include <mach/at91sam9_sdramc.h> #include <mach/at91_rstc.h> .arm - .globl at91sam9_alt_reset + .globl at91sam9_alt_restart -at91sam9_alt_reset: mrc p15, 0, r0, c1, c0, 0 - orr r0, r0, #CR_I - mcr p15, 0, r0, c1, c0, 0 @ enable I-cache - - ldr r0, .at91_va_base_sdramc @ preload constants +at91sam9_alt_restart: ldr r0, .at91_va_base_sdramc @ preload constants ldr r1, .at91_va_base_rstc_cr mov r2, #1
arch/arm/mach-at91/at91sam9g45.c +2 -2
@@ -316,7 +316,7 @@ static struct at91_gpio_bank at91sam9g45_gpio[] __initdata = { } }; -static void at91sam9g45_reset (void ) +static void at91sam9g45_restart (char mode,const char *cmd) {at91_sys_write (AT91_RSTC_CR ,AT91_RSTC_KEY |AT91_RSTC_PROCRST |AT91_RSTC_PERRST ); }
@@ -340,7 +340,7 @@ static void __init at91sam9g45_ioremap_registers(void)static void __init at91sam9g45_initialize (void ) { - at91_arch_reset = at91sam9g45_reset; + arm_pm_restart = at91sam9g45_restart; at91_extern_irq = (1 <<AT91SAM9G45_ID_IRQ0 );/* Register GPIO subsystem */
arch/arm/mach-at91/at91sam9rl.c +1 -1
@@ -292,7 +292,7 @@ static void __init at91sam9rl_ioremap_registers(void)static void __init at91sam9rl_initialize (void ) { - at91_arch_reset = at91sam9_alt_reset; + arm_pm_restart = at91sam9_alt_restart; at91_extern_irq = (1 <<AT91SAM9RL_ID_IRQ0 );/* Register GPIO subsystem */
arch/arm/mach-at91/generic.h +1 -2
@@ -58,7 +58,7 @@ extern void at91_irq_suspend(void);extern void at91_irq_resume (void );/* reset */ -extern void at91sam9_alt_reset (void ); +extern void at91sam9_alt_restart (char ,const char *);/* shutdown */ extern void at91_ioremap_shdwc (u32 base_addr);
@@ -74,5 +74,4 @@ struct at91_gpio_bank {extern void __init at91_gpio_init (struct at91_gpio_bank *,int nr_banks);extern void __init at91_gpio_irq_setup (void ); -extern void (*at91_arch_reset)(void );extern int at91_extern_irq;
arch/arm/mach-at91/include/mach/system.h +0 -5
@@ -47,13 +47,8 @@ static inline void arch_idle(void) #endif } -void (*at91_arch_reset)(void ); -static inline void arch_reset (char mode,const char *cmd) { -/* call the CPU-specific reset function */ -if (at91_arch_reset) - (at91_arch_reset)(); }#endif
Signature · 1 line
1.7.7
PATCH 5/6 ARM: at91: Fix at91sam9g45 and at91cap9 reset
In reply to Jean-Christophe PLAGNIOL-VILLARDAs on the other sam9 we to cleanly shutdown the DDR before rebooting
--- arch/arm/mach-at91/Kconfig | 5 ++++ arch/arm/mach-at91/Makefile | 1 + arch/arm/mach-at91/at91cap9.c | 8 +----- arch/arm/mach-at91/at91sam9g45.c | 6 ---- arch/arm/mach-at91/at91sam9g45_reset.S | 41 ++++++++++++++++++++++++++++++++ arch/arm/mach-at91/generic.h | 1 + 6 files changed, 49 insertions(+), 13 deletions(-) create mode 100644 arch/arm/mach-at91/at91sam9g45_reset.S
arch/arm/mach-at91/Kconfig +5 -0
@@ -21,6 +21,9 @@ config HAVE_AT91_USART5 config AT91_SAM9_ALT_RESET bool +config AT91_SAM9G45_ALT_RESET + bool + menu "Atmel AT91 System-on-Chip" choice
@@ -97,6 +100,7 @@ config ARCH_AT91SAM9G45 select HAVE_FB_ATMEL select HAVE_NET_MACB select HAVE_AT91_DBGU1 + select AT91_SAM9G45_ALT_RESET config ARCH_AT91CAP9 bool "AT91CAP9"
@@ -105,6 +109,7 @@ config ARCH_AT91CAP9 select HAVE_FB_ATMEL select HAVE_NET_MACB select HAVE_AT91_DBGU1 + select AT91_SAM9G45_ALT_RESET config ARCH_AT91X40 bool "AT91x40"
arch/arm/mach-at91/Makefile +1 -0
@@ -9,6 +9,7 @@ obj- := obj-$(CONFIG_AT91_PMC_UNIT) += clock.o obj-$(CONFIG_AT91_SAM9_ALT_RESET) += at91sam9_alt_reset.o +obj-$(CONFIG_AT91_SAM9G45_ALT_RESET) += at91sam9g45_reset.o # CPU-specific support obj-$(CONFIG_ARCH_AT91RM9200) += at91rm9200.o at91rm9200_time.o at91rm9200_devices.o
arch/arm/mach-at91/at91cap9.c +1 -7
@@ -21,7 +21,6 @@#include <mach/cpu.h> #include <mach/at91cap9.h> #include <mach/at91_pmc.h> -#include <mach/at91_rstc.h> #include "soc.h" #include "generic.h"
@@ -312,11 +311,6 @@ static struct at91_gpio_bank at91cap9_gpio[] __initdata = { } }; -static void at91cap9_restart (char mode,const char *cmd) -{ -at91_sys_write (AT91_RSTC_CR ,AT91_RSTC_KEY |AT91_RSTC_PROCRST |AT91_RSTC_PERRST ); -} -/* -------------------------------------------------------------------- * AT91CAP9 processor initialization * -------------------------------------------------------------------- */
@@ -335,7 +329,7 @@ static void __init at91cap9_ioremap_registers(void)static void __init at91cap9_initialize (void ) { - arm_pm_restart = at91cap9_restart; + arm_pm_restart = at91sam9g45_restart; at91_extern_irq = (1 <<AT91CAP9_ID_IRQ0 ) | (1 <<AT91CAP9_ID_IRQ1 );/* Register GPIO subsystem */
arch/arm/mach-at91/at91sam9g45.c +0 -6
@@ -18,7 +18,6 @@#include <asm/mach/map.h> #include <mach/at91sam9g45.h> #include <mach/at91_pmc.h> -#include <mach/at91_rstc.h> #include <mach/cpu.h> #include "soc.h"
@@ -316,11 +315,6 @@ static struct at91_gpio_bank at91sam9g45_gpio[] __initdata = { } }; -static void at91sam9g45_restart (char mode,const char *cmd) -{ -at91_sys_write (AT91_RSTC_CR ,AT91_RSTC_KEY |AT91_RSTC_PROCRST |AT91_RSTC_PERRST ); -} -/* -------------------------------------------------------------------- * AT91SAM9G45 processor initialization * -------------------------------------------------------------------- */
arch/arm/mach-at91/at91sam9g45_reset.S new file +41 -0
41 lines not on this page · raw message
arch/arm/mach-at91/generic.h +1 -0
@@ -59,6 +59,7 @@ extern void at91_irq_resume(void);/* reset */ extern void at91sam9_alt_restart (char ,const char *); +extern void at91sam9g45_restart (char ,const char *);/* shutdown */ extern void at91_ioremap_shdwc (u32 base_addr);
Signature · 1 line
1.7.7
PATCH 5/6 ARM: at91: Fix at91sam9g45 and at91cap9 reset
Quoted 10 lines · Jean-Christophe PLAGNIOL-VILLARD
arch/arm/mach-at91/at91sam9g45_reset.S new file +10
-0+ .globl at91sam9g45_restart + +at91sam9g45_restart: + ldr r0, .at91_va_base_sdramc0 @ preload constants + ldr r1, .at91_va_base_rstc_cr + + mov r2, #1 + mov r3, #AT91_DDRSDRC_LPCB_POWER_DOWN + ldr r4, =AT91_RSTC_KEY | AT91_RSTC_PERRST | AT91_RSTC_PROCRST +
arch/arm/mach-at91/at91sam9g45_reset.S line 39
Quoted 10 lines
arch/arm/mach-at91/at91sam9g45_reset.S new file +10
-0+ .balign 32 @ align to cache line + + str r2, [r0, #AT91_DDRSDRC_RTR] @ disable DDR0 access + str r3, [r0, #AT91_DDRSDRC_LPR] @ power down DDR0 + str r4, [r1] @ reset processor + + b . + +.at91_va_base_sdramc0: + .word AT91_VA_BASE_SYS + AT91_DDRSDRC0
So is the only change between this new file and arch/arm/mach-at91/at91sam9_alt_reset.S this line above?
arch/arm/mach-at91/at91sam9_alt_reset.S has:
.word AT91_VA_BASE_SYS + AT91_SDRAMC0
Maybe the at91sam9_alt_reset.S version should take this as an argument so the errata fix can be re-used on different AT91 versions, rather than having to duplicate code just because one register address has changed.
PATCH 5/6 ARM: at91: Fix at91sam9g45 and at91cap9 reset
Quoted 25 lines · Russell King - ARM Linux
Quoted 10 lines · Jean-Christophe PLAGNIOL-VILLARD
arch/arm/mach-at91/at91sam9g45_reset.S new file +10
-0+ .globl at91sam9g45_restart + +at91sam9g45_restart: + ldr r0, .at91_va_base_sdramc0 @ preload constants + ldr r1, .at91_va_base_rstc_cr + + mov r2, #1 + mov r3, #AT91_DDRSDRC_LPCB_POWER_DOWN + ldr r4, =AT91_RSTC_KEY | AT91_RSTC_PERRST | AT91_RSTC_PROCRST +arch/arm/mach-at91/at91sam9g45_reset.S line 39
Quoted 10 lines
arch/arm/mach-at91/at91sam9g45_reset.S new file +10
-0+ .balign 32 @ align to cache line + + str r2, [r0, #AT91_DDRSDRC_RTR] @ disable DDR0 access + str r3, [r0, #AT91_DDRSDRC_LPR] @ power down DDR0 + str r4, [r1] @ reset processor + + b . + +.at91_va_base_sdramc0: + .word AT91_VA_BASE_SYS + AT91_DDRSDRC0So is the only change between this new file and
arch/arm/mach-at91/at91sam9_alt_reset.Sthis line above?
Quoted 6 lines
arch/arm/mach-at91/at91sam9_alt_reset.Shas:.word AT91_VA_BASE_SYS + AT91_SDRAMC0Maybe the
at91sam9_alt_reset.Sversion should take this as an argument so the errata fix can be re-used on different AT91 versions, rather than having to duplicate code just because one register address has changed.
its not only the register base address but also the registers offset
I get the same idea but at the end when I did it I end with more code and the only patrt in common are
ldr r1, at91_va_base_rstc_cre mov r2, #1 ldr r4, =AT91_RSTC_KEY | AT91_RSTC_PERRST | AT91_RSTC_PROCRST str r4, [r1]
so I chosse to split it
as if I want to do the second way I need to pass 5 params to the asm fucntion and create one c function for sam9 and 9g45
Best Regards,
J.
PATCH 6/6 ARM: at91: make rstc soc independent
In reply to Jean-Christophe PLAGNIOL-VILLARD--- arch/arm/mach-at91/at91cap9.c | 1 + arch/arm/mach-at91/at91sam9260.c | 1 + arch/arm/mach-at91/at91sam9261.c | 1 + arch/arm/mach-at91/at91sam9263.c | 1 + arch/arm/mach-at91/at91sam9_alt_reset.S | 7 +++---- arch/arm/mach-at91/at91sam9g45.c | 1 + arch/arm/mach-at91/at91sam9g45_reset.S | 7 +++---- arch/arm/mach-at91/at91sam9rl.c | 1 + arch/arm/mach-at91/generic.h | 1 + arch/arm/mach-at91/include/mach/at91_rstc.h | 18 +++++++++++++++--- arch/arm/mach-at91/include/mach/at91cap9.h | 2 +- arch/arm/mach-at91/include/mach/at91sam9260.h | 2 +- arch/arm/mach-at91/include/mach/at91sam9261.h | 2 +- arch/arm/mach-at91/include/mach/at91sam9263.h | 2 +- arch/arm/mach-at91/include/mach/at91sam9g45.h | 2 +- arch/arm/mach-at91/include/mach/at91sam9rl.h | 2 +- arch/arm/mach-at91/pm.c | 9 ++------- arch/arm/mach-at91/setup.c | 9 +++++++++ 18 files changed, 45 insertions(+), 24 deletions(-)
arch/arm/mach-at91/at91cap9.c +1 -0
@@ -323,6 +323,7 @@ static void __init at91cap9_map_io(void)static void __init at91cap9_ioremap_registers (void ) {at91_ioremap_shdwc (AT91CAP9_BASE_SHDWC ); +at91_ioremap_rstc (AT91CAP9_BASE_RSTC );at91sam926x_ioremap_pit (AT91CAP9_BASE_PIT );at91sam9_ioremap_smc (0 ,AT91CAP9_BASE_SMC ); }
arch/arm/mach-at91/at91sam9260.c +1 -0
@@ -321,6 +321,7 @@ static void __init at91sam9260_map_io(void)static void __init at91sam9260_ioremap_registers (void ) {at91_ioremap_shdwc (AT91SAM9260_BASE_SHDWC ); +at91_ioremap_rstc (AT91SAM9260_BASE_RSTC );at91sam926x_ioremap_pit (AT91SAM9260_BASE_PIT );at91sam9_ioremap_smc (0 ,AT91SAM9260_BASE_SMC ); }
arch/arm/mach-at91/at91sam9261.c +1 -0
@@ -281,6 +281,7 @@ static void __init at91sam9261_map_io(void)static void __init at91sam9261_ioremap_registers (void ) {at91_ioremap_shdwc (AT91SAM9261_BASE_SHDWC ); +at91_ioremap_rstc (AT91SAM9261_BASE_RSTC );at91sam926x_ioremap_pit (AT91SAM9261_BASE_PIT );at91sam9_ioremap_smc (0 ,AT91SAM9261_BASE_SMC ); }
arch/arm/mach-at91/at91sam9263.c +1 -0
@@ -299,6 +299,7 @@ static void __init at91sam9263_map_io(void)static void __init at91sam9263_ioremap_registers (void ) {at91_ioremap_shdwc (AT91SAM9263_BASE_SHDWC ); +at91_ioremap_rstc (AT91SAM9263_BASE_RSTC );at91sam926x_ioremap_pit (AT91SAM9263_BASE_PIT );at91sam9_ioremap_smc (0 ,AT91SAM9263_BASE_SMC0 );at91sam9_ioremap_smc (1 ,AT91SAM9263_BASE_SMC1 );
arch/arm/mach-at91/at91sam9_alt_reset.S +3 -4
@@ -23,7 +23,8 @@ .globl at91sam9_alt_restart at91sam9_alt_restart: ldr r0, .at91_va_base_sdramc @ preload constants - ldr r1, .at91_va_base_rstc_cr + ldr r1, =at91_rstc_base + ldr r1, [r1] mov r2, #1 mov r3, #AT91_SDRAMC_LPCB_POWER_DOWN
@@ -33,11 +34,9 @@ at91sam9_alt_restart: ldr r0, .at91_va_base_sdramc @ preload constants str r2, [r0, #AT91_SDRAMC_TR] @ disable SDRAM access str r3, [r0, #AT91_SDRAMC_LPR] @ power down SDRAM - str r4, [r1] @ reset processor + str r4, [r1, #AT91_RSTC_CR] @ reset processor b . .at91_va_base_sdramc: .word AT91_VA_BASE_SYS + AT91_SDRAMC0 -.at91_va_base_rstc_cr: - .word AT91_VA_BASE_SYS + AT91_RSTC_CR
arch/arm/mach-at91/at91sam9g45.c +1 -0
@@ -328,6 +328,7 @@ static void __init at91sam9g45_map_io(void)static void __init at91sam9g45_ioremap_registers (void ) {at91_ioremap_shdwc (AT91SAM9G45_BASE_SHDWC ); +at91_ioremap_rstc (AT91SAM9G45_BASE_RSTC );at91sam926x_ioremap_pit (AT91SAM9G45_BASE_PIT );at91sam9_ioremap_smc (0 ,AT91SAM9G45_BASE_SMC ); }
arch/arm/mach-at91/at91sam9g45_reset.S +3 -4
@@ -21,7 +21,8 @@ at91sam9g45_restart: ldr r0, .at91_va_base_sdramc0 @ preload constants - ldr r1, .at91_va_base_rstc_cr + ldr r1, =at91_rstc_base + ldr r1, [r1] mov r2, #1 mov r3, #AT91_DDRSDRC_LPCB_POWER_DOWN
@@ -31,11 +32,9 @@ at91sam9g45_restart: str r2, [r0, #AT91_DDRSDRC_RTR] @ disable DDR0 access str r3, [r0, #AT91_DDRSDRC_LPR] @ power down DDR0 - str r4, [r1] @ reset processor + str r4, [r1, #AT91_RSTC_CR] @ reset processor b . .at91_va_base_sdramc0: .word AT91_VA_BASE_SYS + AT91_DDRSDRC0 -.at91_va_base_rstc_cr: - .word AT91_VA_BASE_SYS + AT91_RSTC_CR
arch/arm/mach-at91/at91sam9rl.c +1 -0
@@ -286,6 +286,7 @@ static void __init at91sam9rl_map_io(void)static void __init at91sam9rl_ioremap_registers (void ) {at91_ioremap_shdwc (AT91SAM9RL_BASE_SHDWC ); +at91_ioremap_rstc (AT91SAM9RL_BASE_RSTC );at91sam926x_ioremap_pit (AT91SAM9RL_BASE_PIT );at91sam9_ioremap_smc (0 ,AT91SAM9RL_BASE_SMC ); }
arch/arm/mach-at91/generic.h +1 -0
@@ -58,6 +58,7 @@ extern void at91_irq_suspend(void);extern void at91_irq_resume (void );/* reset */ +extern void at91_ioremap_rstc (u32 base_addr);extern void at91sam9_alt_restart (char ,const char *);extern void at91sam9g45_restart (char ,const char *);
arch/arm/mach-at91/include/mach/at91_rstc.h +15 -3
@@ -16,13 +16,25 @@#ifndef AT91_RSTC_H #define AT91_RSTC_H -#define AT91_RSTC_CR (AT91_RSTC + 0x00)/* Reset Controller Control Register */ +#ifndef __ASSEMBLY__ +extern void __iomem *at91_rstc_base; + +#define at91_rstc_read (field) \ + __raw_readl(at91_rstc_base + field) + +#define at91_rstc_write (field, value) \ + __raw_writel(value, at91_rstc_base + field); +#else +.extern at91_rstc_base +#endif + +#define AT91_RSTC_CR 0x00/* Reset Controller Control Register */ #define AT91_RSTC_PROCRST (1 << 0)/* Processor Reset */ #define AT91_RSTC_PERRST (1 << 2)/* Peripheral Reset */ #define AT91_RSTC_EXTRST (1 << 3)/* External Reset */ #define AT91_RSTC_KEY (0xa5 << 24)/* KEY Password */ -#define AT91_RSTC_SR (AT91_RSTC + 0x04)/* Reset Controller Status Register */ +#define AT91_RSTC_SR 0x04/* Reset Controller Status Register */ #define AT91_RSTC_URSTS (1 << 0)/* User Reset Status */ #define AT91_RSTC_RSTTYP (7 << 8)/* Reset Type */ #define AT91_RSTC_RSTTYP_GENERAL (0 << 8)
@@ -33,7 +45,7 @@#define AT91_RSTC_NRSTL (1 << 16)/* NRST Pin Level */ #define AT91_RSTC_SRCMP (1 << 17)/* Software Reset Command in Progress */ -#define AT91_RSTC_MR (AT91_RSTC + 0x08)/* Reset Controller Mode Register */ +#define AT91_RSTC_MR 0x08/* Reset Controller Mode Register */ #define AT91_RSTC_URSTEN (1 << 0)/* User Reset Enable */ #define AT91_RSTC_URSTIEN (1 << 4)/* User Reset Interrupt Enable */ #define AT91_RSTC_ERSTL (0xf << 8)/* External Reset Length */
arch/arm/mach-at91/include/mach/at91cap9.h +1 -1
@@ -83,7 +83,6 @@#define AT91_DDRSDRC0 (0xffffe600 - AT91_BASE_SYS)#define AT91_MATRIX (0xffffea00 - AT91_BASE_SYS)#define AT91_PMC (0xfffffc00 - AT91_BASE_SYS) -#define AT91_RSTC (0xfffffd00 - AT91_BASE_SYS)#define AT91_GPBR (cpu_is_at91cap9_revB() ? \ (0xfffffd50 - AT91_BASE_SYS) : \ (0xfffffd60 - AT91_BASE_SYS))
@@ -96,6 +95,7 @@#define AT91CAP9_BASE_PIOB 0xfffff400#define AT91CAP9_BASE_PIOC 0xfffff600#define AT91CAP9_BASE_PIOD 0xfffff800 +#define AT91CAP9_BASE_RSTC 0xfffffd00#define AT91CAP9_BASE_SHDWC 0xfffffd10#define AT91CAP9_BASE_RTT 0xfffffd20#define AT91CAP9_BASE_PIT 0xfffffd30
arch/arm/mach-at91/include/mach/at91sam9260.h +1 -1
@@ -83,7 +83,6 @@#define AT91_SDRAMC0 (0xffffea00 - AT91_BASE_SYS)#define AT91_MATRIX (0xffffee00 - AT91_BASE_SYS)#define AT91_PMC (0xfffffc00 - AT91_BASE_SYS) -#define AT91_RSTC (0xfffffd00 - AT91_BASE_SYS)#define AT91_GPBR (0xfffffd50 - AT91_BASE_SYS)#define AT91SAM9260_BASE_ECC 0xffffe800
@@ -92,6 +91,7 @@#define AT91SAM9260_BASE_PIOA 0xfffff400#define AT91SAM9260_BASE_PIOB 0xfffff600#define AT91SAM9260_BASE_PIOC 0xfffff800 +#define AT91SAM9260_BASE_RSTC 0xfffffd00#define AT91SAM9260_BASE_SHDWC 0xfffffd10#define AT91SAM9260_BASE_RTT 0xfffffd20#define AT91SAM9260_BASE_PIT 0xfffffd30
arch/arm/mach-at91/include/mach/at91sam9261.h +1 -1
@@ -68,7 +68,6 @@#define AT91_SDRAMC0 (0xffffea00 - AT91_BASE_SYS)#define AT91_MATRIX (0xffffee00 - AT91_BASE_SYS)#define AT91_PMC (0xfffffc00 - AT91_BASE_SYS) -#define AT91_RSTC (0xfffffd00 - AT91_BASE_SYS)#define AT91_GPBR (0xfffffd50 - AT91_BASE_SYS)#define AT91SAM9261_BASE_SMC 0xffffec00
@@ -76,6 +75,7 @@#define AT91SAM9261_BASE_PIOA 0xfffff400#define AT91SAM9261_BASE_PIOB 0xfffff600#define AT91SAM9261_BASE_PIOC 0xfffff800 +#define AT91SAM9261_BASE_RSTC 0xfffffd00#define AT91SAM9261_BASE_SHDWC 0xfffffd10#define AT91SAM9261_BASE_RTT 0xfffffd20#define AT91SAM9261_BASE_PIT 0xfffffd30
arch/arm/mach-at91/include/mach/at91sam9263.h +1 -1
@@ -78,7 +78,6 @@#define AT91_SDRAMC1 (0xffffe800 - AT91_BASE_SYS)#define AT91_MATRIX (0xffffec00 - AT91_BASE_SYS)#define AT91_PMC (0xfffffc00 - AT91_BASE_SYS) -#define AT91_RSTC (0xfffffd00 - AT91_BASE_SYS)#define AT91_GPBR (0xfffffd60 - AT91_BASE_SYS)#define AT91SAM9263_BASE_ECC0 0xffffe000
@@ -91,6 +90,7 @@#define AT91SAM9263_BASE_PIOC 0xfffff600#define AT91SAM9263_BASE_PIOD 0xfffff800#define AT91SAM9263_BASE_PIOE 0xfffffa00 +#define AT91SAM9263_BASE_RSTC 0xfffffd00#define AT91SAM9263_BASE_SHDWC 0xfffffd10#define AT91SAM9263_BASE_RTT0 0xfffffd20#define AT91SAM9263_BASE_PIT 0xfffffd30
arch/arm/mach-at91/include/mach/at91sam9g45.h +1 -1
@@ -90,7 +90,6 @@#define AT91_DDRSDRC0 (0xffffe600 - AT91_BASE_SYS)#define AT91_MATRIX (0xffffea00 - AT91_BASE_SYS)#define AT91_PMC (0xfffffc00 - AT91_BASE_SYS) -#define AT91_RSTC (0xfffffd00 - AT91_BASE_SYS)#define AT91_GPBR (0xfffffd60 - AT91_BASE_SYS)#define AT91SAM9G45_BASE_ECC 0xffffe200
@@ -102,6 +101,7 @@#define AT91SAM9G45_BASE_PIOC 0xfffff600#define AT91SAM9G45_BASE_PIOD 0xfffff800#define AT91SAM9G45_BASE_PIOE 0xfffffa00 +#define AT91SAM9G45_BASE_RSTC 0xfffffd00#define AT91SAM9G45_BASE_SHDWC 0xfffffd10#define AT91SAM9G45_BASE_RTT 0xfffffd20#define AT91SAM9G45_BASE_PIT 0xfffffd30
arch/arm/mach-at91/include/mach/at91sam9rl.h +1 -1
@@ -72,7 +72,6 @@#define AT91_SDRAMC0 (0xffffea00 - AT91_BASE_SYS)#define AT91_MATRIX (0xffffee00 - AT91_BASE_SYS)#define AT91_PMC (0xfffffc00 - AT91_BASE_SYS) -#define AT91_RSTC (0xfffffd00 - AT91_BASE_SYS)#define AT91_SCKCR (0xfffffd50 - AT91_BASE_SYS)#define AT91_GPBR (0xfffffd60 - AT91_BASE_SYS)
@@ -84,6 +83,7 @@#define AT91SAM9RL_BASE_PIOB 0xfffff600#define AT91SAM9RL_BASE_PIOC 0xfffff800#define AT91SAM9RL_BASE_PIOD 0xfffffa00 +#define AT91SAM9RL_BASE_RSTC 0xfffffd00#define AT91SAM9RL_BASE_SHDWC 0xfffffd10#define AT91SAM9RL_BASE_RTT 0xfffffd20#define AT91SAM9RL_BASE_PIT 0xfffffd30
arch/arm/mach-at91/pm.c +2 -7
@@ -34,7 +34,6 @@/* * Show the reason for the previous system reset. */ -#if defined(AT91_RSTC )#include <mach/at91_rstc.h> #include <mach/at91_shdwc.h>
@@ -58,10 +57,10 @@ static void __init show_reset_status(void)char *reason, *r2 = reset;u32 reset_type, wake_type; -if (!at91_shdwc_base) +if (!at91_shdwc_base || !at91_rstc_base)return ; - reset_type =at91_sys_read (AT91_RSTC_SR ) &AT91_RSTC_RSTTYP ; + reset_type =at91_rstc_read (AT91_RSTC_SR ) &AT91_RSTC_RSTTYP ; wake_type =at91_shdwc_read (AT91_SHDW_SR );switch (reset_type) {
@@ -102,10 +101,6 @@ static void __init show_reset_status(void) }pr_info ("AT91: Starting after %s %s\n" , reason, r2); } -#else -static void __init show_reset_status (void ) {} -#endif -static int at91_pm_valid_state (suspend_state_t state) {
arch/arm/mach-at91/setup.c +9 -0
@@ -299,6 +299,15 @@ void __init at91_ioremap_shdwc(u32 base_addr) pm_power_off = at91sam9_poweroff; } +void __iomem *at91_rstc_base; + +void __init at91_ioremap_rstc (u32 base_addr) +{ + at91_rstc_base =ioremap (base_addr,16 ); +if (!at91_rstc_base) +panic ("Impossible to ioremap at91_rstc_base\n" ); +} +void __init at91_initialize (unsigned long main_clock) { at91_boot_soc.ioremap_registers ();
Signature · 1 line
1.7.7