AT91SAM9XE add embedded flash support
Subsystems (2)
PATCH v2 1/1 AT91SAM9XE add embedded flash support
Add support for the embedded flash in the AT91SAM9XE128/256/512 SoCs:
- Environment can be put into that flash
- U-Boot can be in that flash
- Commands "cp" and "protect" are supported
--- arch/arm/cpu/arm926ejs/at91/Makefile | 1 + arch/arm/cpu/arm926ejs/at91/eflash.c | 277 ++++++++++++++++++++++++++++ arch/arm/include/asm/arch-at91/at91_dbu.h | 41 ++++ arch/arm/include/asm/arch-at91/at91_eefc.h | 51 +++++ 4 files changed, 370 insertions(+), 0 deletions(-) create mode 100644 arch/arm/cpu/arm926ejs/at91/eflash.c create mode 100644 arch/arm/include/asm/arch-at91/at91_dbu.h create mode 100644 arch/arm/include/asm/arch-at91/at91_eefc.h
arch/arm/cpu/arm926ejs/at91/Makefile +1 -0
@@ -34,6 +34,7 @@ COBJS-$(CONFIG_AT91SAM9263) += at91sam9263_devices.o COBJS-$(CONFIG_AT91SAM9RL) += at91sam9rl_devices.o COBJS-$(CONFIG_AT91SAM9M10G45) += at91sam9m10g45_devices.o COBJS-$(CONFIG_AT91SAM9G45) += at91sam9m10g45_devices.o +COBJS-$(CONFIG_AT91_EFLASH) += eflash.o COBJS-$(CONFIG_AT91_LED) += led.o COBJS-y += clock.o COBJS-y += cpu.o
arch/arm/cpu/arm926ejs/at91/eflash.c new file +277 -0
277 lines not on this page · raw message
arch/arm/include/asm/arch-at91/at91_dbu.h new file +41 -0
41 lines not on this page · raw message
arch/arm/include/asm/arch-at91/at91_eefc.h new file +51 -0
51 lines not on this page · raw message
Signature · 1 line
1.5.6.5
PATCH v2 1/1 AT91SAM9XE add embedded flash support
Dear "Reinhard Meyer (-VC)",
arch/arm/cpu/arm926ejs/at91/eflash.c line 128
Quoted 13 lines · In message <[email protected]> you wrote:
Add support for the embedded flash in the AT91SAM9XE128/256/512 SoCs:
- Environment can be put into that flash
- U-Boot can be in that flash
- Commands "cp" and "protect" are supportedSigned-off-by Reinhard Meyer <[email protected]>arch/arm/cpu/arm926ejs/at91/eflash.c new file +6
-0+for (i=0 ; i<nlocks; i++) { + tmp =readl (&eefc->frr);/* words 4+nplanes+1.. */ + flash_info[0 ].start[i] = addr; + flash_info[0 ].protect[i] =0 ; + addr += tmp; + };
No ';' here.
arch/arm/cpu/arm926ejs/at91/eflash.c line 156
Quoted 5 lines
arch/arm/cpu/arm926ejs/at91/eflash.c new file +5
-0+if (info->size >= (1 <<20 )) { + i =20 ; + }else { + i =10 ; + }
No braces needed for single line statements.
arch/arm/cpu/arm926ejs/at91/eflash.c line 160
Quoted 4 lines
arch/arm/cpu/arm926ejs/at91/eflash.c new file +4
-0+printf (" Size: %ld %cB in %d Sectors\n" , + info->size >> i, + (i ==20 ) ?'M' :'k' , + info->sector_count);
Please use available functions to print sizes like that (and always use SI units, i. e. MiB and KiB if that's what you mean).
arch/arm/cpu/arm926ejs/at91/eflash.c line 233
Quoted 5 lines
arch/arm/cpu/arm926ejs/at91/eflash.c new file +5
-0+int flash_erase (flash_info_t *info,int s_first,int s_last) +{ +DEBUGF ("erase first=%d last=%d\n" , s_first, s_last); +return 0 ; +}
Is this complete?
Best regards,
Wolfgang Denk
Signature · 6 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de What is wanted is not the will to believe, but the will to find out, which is the exact opposite. -- Bertrand Russell, "Skeptical Essays", 1928
PATCH v2 1/1 AT91SAM9XE add embedded flash support
Quoted 10 lines · Wolfgang Denk
Dear "Reinhard Meyer (-VC)",
Quoted 6 lines · In message <[email protected]> you wrote:
Add support for the embedded flash in the AT91SAM9XE128/256/512 SoCs:
- Environment can be put into that flash
- U-Boot can be in that flash
- Commands "cp" and "protect" are supportedSigned-off-by Reinhard Meyer <[email protected]>
Quoted 8 lines
arch/arm/cpu/arm926ejs/at91/eflash.c line 128
Quoted 6 lines
arch/arm/cpu/arm926ejs/at91/eflash.c new file +6
-0+for (i=0 ; i<nlocks; i++) { + tmp =readl (&eefc->frr);/* words 4+nplanes+1.. */ + flash_info[0 ].start[i] = addr; + flash_info[0 ].protect[i] =0 ; + addr += tmp; + };No ';' here.
OK, why thats there in the first place i don't know :)
The rest here I copied from existing flash code,
it would need fixing there as well :)
Quoted 17 lines
arch/arm/cpu/arm926ejs/at91/eflash.c line 156
Quoted 6 lines
arch/arm/cpu/arm926ejs/at91/eflash.c new file +5
-0+if (info->size >= (1 <<20 )) { + i =20 ; + }else { + i =10 ; + }No braces needed for single line statements.
arch/arm/cpu/arm926ejs/at91/eflash.c line 160
Quoted 4 lines
arch/arm/cpu/arm926ejs/at91/eflash.c new file +4
-0+printf (" Size: %ld %cB in %d Sectors\n" , + info->size >> i, + (i ==20 ) ?'M' :'k' , + info->sector_count);Please use available functions to print sizes like that (and always use SI units, i. e. MiB and KiB if that's what you mean).
Quoted 7 lines
arch/arm/cpu/arm926ejs/at91/eflash.c line 233
Quoted 5 lines
arch/arm/cpu/arm926ejs/at91/eflash.c new file +5
-0+int flash_erase (flash_info_t *info,int s_first,int s_last) +{ +DEBUGF ("erase first=%d last=%d\n" , s_first, s_last); +return 0 ; +}Is this complete?
That embedded flash does not need to be erased. In fact it does not have a sector erase command. Only "erase and write page" (512 bytes).
The function needs to be there for linking the code. See in the comments at the beginning of the file:
* Each page in a sector can be rewritten anytime.
* Since pages are erased when written, the "erase" does nothing.
I could write the sectors with 0xff or print a message "erasing the embedded flash not required".
Btw... you missed that debug() should probably be used :)
So, simple question: how do I get a new patch against the original state after editing the file? commit + format-patch master does not do the trick. It produces a patch with the new changes only.
Reinhard
PATCH v2 1/1 AT91SAM9XE add embedded flash support
Dear Reinhard Meyer,
Am 09.08.2010 07:13, schrieb Reinhard Meyer:
Quoted 4 lines
Quoted 1 line · Wolfgang Denk
Dear "Reinhard Meyer (-VC)",
So, simple question: how do I get a new patch against the original state after editing the file?
first of all you might want to have your patch against the current state (not the one it was when you introduced your patch).
'git rebase' does the trick, e.g. 'git checkout <my patch branch> && git rebase master'
Then you might want to do some changes to your first patch. Do them, and
a) 'git commit --amend' to add your changes to the very last commit or b) 'git commit' a new commit and then use 'git rebase -i' to squash the one in question together.
Quoted 4 lines
commit + format-patch master does
not do the trick. It produces a patch with the new changes only.Reinhard
rergards
Andreas Bie?mann
PATCH v2 1/1 AT91SAM9XE add embedded flash support
Andreas Bie?mann schrieb:
Dear Andreas Bie?mann,
Quoted 4 lines
Quoted 2 lines
So, simple question: how do I get a new patch against the original state after editing the file?
'git rebase' does the trick, e.g. 'git checkout <my patch branch> && git rebase master'
Here the problem starts... I have made changes to like 2 dozen files since then. I cannot switch branches, nor will a rebase work.
I do not want to ADD and COMMIT those changes yet, so I guess I am stuck in that branch for the time being.
Maybe my approach is wrong?
Reinhard
PATCH v2 1/1 AT91SAM9XE add embedded flash support
Dear Reinhard Meyer,
Am 09.08.2010 09:08, schrieb Reinhard Meyer:
Quoted 9 lines
Andreas Bie?mann schrieb:
Dear Andreas Bie?mann,Quoted 4 lines
Quoted 2 lines
So, simple question: how do I get a new patch against the original state after editing the file?
'git rebase' does the trick, e.g. 'git checkout <my patch branch> && git rebase master'
Here the problem starts... I have made changes to like 2 dozen files since then. I cannot switch branches, nor will a rebase work.
No problem, so how about:
1. git checkout master && git pull
2. git checkout -b my_branch_for_single_commit
3. git cherry-pick <hash of commit in question>
4. fix conflicts, make changes a.s.o.
5. generate clean commit on top of current master as already described
6. git format-patch ....
7. git checkout master && git branch -d my_branch_for_single_commmit
Quoted 2 lines
I do not want to ADD and COMMIT those changes yet, so I guess I am stuck in that branch for the time being.
Ah, i see ... you have uncommited changes in your current branch? Bad thing!
Quoted 1 line
Maybe my approach is wrong?
Consider creating a branch for each task you want to e.g. my_test_task1, my_test_task2. Use git to switch between them (checkout) and get changes from one branch to another (cherry-pick/merge). These test branches are cheap to create and delete. Btw it is ok to switch between branches with uncommited changes. You can e.g. switch, commit there and switch back.
Consider using a branch for patches to go upstream. You can switch to this branch every time you have to do changes in your patches. Use 'git rebase origin/master' to stay up to date. Then your local commits will be replaced by the one in upsteream (they have different hashes!) .. maybe 'git merge' will also work.
Consider generating small commits (small in means of timeline of feature). They are so easy to cherry-pick/squash in other branches ... Git is built to do rework of single commits up to the perfect one ;)
regards
Andreas Bie?mann
PATCH v2 1/1 AT91SAM9XE add embedded flash support
Dear Andreas Bie?mann
Quoted 2 lines
Ah, i see ... you have uncommited changes in your current branch? Bad thing!
Umm, the current branch would always have WIP. Always committing half done work to fix a problem in another branch seems tedious to me. Doing that I would have many dozen commits by now that I would have to squash later. Is that really the only way to go?
Reinhard
-------------- next part --------------
A non-text attachment was scrubbed...
Name: reinhard_meyer.vcf
Type: text/x-vcard
Size: 370 bytes
Desc: not available
Url : http://lists.denx.de/pipermail/u-boot/attachments/20100809/4952ad57/attachment.vcf
PATCH v2 1/1 AT91SAM9XE add embedded flash support
Quoted 1 line
Umm, the current branch would always have WIP.
Sure, me too.
Quoted 2 lines
Always committing half done work to fix a problem in another branch seems tedious to me.
No, because you can use "git rebase -i" later, and thus squash together different commits. I have lots of "temporary" commits (which, btw, allows me to push to the backup place).
Another useful tool is "git stash". It parks your current changes so you can switch branches, and reapply the changes laster when you are back (git stash apply).
/alessandro
PATCH v2 1/1 AT91SAM9XE add embedded flash support
In reply to Reinhard MeyerDear Reinhard Meyer,
Am 09.08.2010 09:39, schrieb Reinhard Meyer:
Quoted 9 lines
Dear Andreas Bie?mann
Quoted 2 lines
Ah, i see ... you have uncommited changes in your current branch? Bad thing!
Umm, the current branch would always have WIP. Always committing half done work to fix a problem in another branch seems tedious to me. Doing that I would have many dozen commits by now that I would have to squash later.
Is that really the only way to go?
Well you need to have a clean "Working Copy" (as it is called in SVN) to do the git tricks rebase a.s.o. Therefore you need to commit changes before doing the rework. Therefore it would be best to have a single branch collecting the patches to go upstream. This branch can be used to rework a patch for next submission.
But there is another solution. You can have a seperate repository ... When you use 'git clone' switches --local, --shared and --reference you can safe disk space.
Quoted 2 lines
Reinhard
Andreas
PATCH v2 1/1 AT91SAM9XE add embedded flash support
In reply to Reinhard MeyerDear Reinhard Meyer,
Am 09.08.2010 09:08, schrieb Reinhard Meyer:
Quoted 9 lines
Andreas Bie?mann schrieb:
Dear Andreas Bie?mann,Quoted 4 lines
Quoted 2 lines
So, simple question: how do I get a new patch against the original state after editing the file?
'git rebase' does the trick, e.g. 'git checkout <my patch branch> && git rebase master'
Here the problem starts... I have made changes to like 2 dozen files since then. I cannot switch branches, nor will a rebase work.
No problem, so how about:
1. git checkout master && git pull
2. git checkout -b my_branch_for_single_commit
3. git cherry-pick <hash of commit in question>
4. fix conflicts, make changes a.s.o.
5. generate clean commit on top of current master as already described
6. git format-patch ....
7. git checkout master && git branch -d my_branch_for_single_commmit
Quoted 2 lines
I do not want to ADD and COMMIT those changes yet, so I guess I am stuck in that branch for the time being.
Ah, i see ... you have uncommited changes in your current branch? Bad thing!
Quoted 1 line
Maybe my approach is wrong?
Consider creating a branch for each task you want to e.g. my_test_task1, my_test_task2. Use git to switch between them (checkout) and get changes from one branch to another (cherry-pick/merge). These test branches are cheap to create and delete. Btw it is ok to switch between branches with uncommited changes. You can e.g. switch, commit there and switch back.
Consider using a branch for patches to go upstream. You can switch to this branch every time you have to do changes in your patches. Use 'git rebase origin/master' to stay up to date. Then your local commits will be replaced by the one in upsteream (they have different hashes!) .. maybe 'git merge' will also work.
Consider generating small commits (small in means of timeline of feature). They are so easy to cherry-pick/squash in other branches ... Git is built to do rework of single commits up to the perfect one ;)
regards
Andreas Bie?mann
PATCH v3 1/1 AT91SAM9XE: add embedded flash support
In reply to Reinhard MeyerAdd support for the embedded flash in the AT91SAM9XE128/256/512 SoCs:
- Environment can be put into that flash
- U-Boot can be in that flash
- Commands "cp" and "protect" are supported
--- arch/arm/cpu/arm926ejs/at91/Makefile | 1 + arch/arm/cpu/arm926ejs/at91/eflash.c | 271 ++++++++++++++++++++++++++++ arch/arm/include/asm/arch-at91/at91_dbu.h | 41 +++++ arch/arm/include/asm/arch-at91/at91_eefc.h | 51 ++++++ 4 files changed, 364 insertions(+), 0 deletions(-) create mode 100644 arch/arm/cpu/arm926ejs/at91/eflash.c create mode 100644 arch/arm/include/asm/arch-at91/at91_dbu.h create mode 100644 arch/arm/include/asm/arch-at91/at91_eefc.h
arch/arm/cpu/arm926ejs/at91/Makefile +1 -0
@@ -34,6 +34,7 @@ COBJS-$(CONFIG_AT91SAM9263) += at91sam9263_devices.o COBJS-$(CONFIG_AT91SAM9RL) += at91sam9rl_devices.o COBJS-$(CONFIG_AT91SAM9M10G45) += at91sam9m10g45_devices.o COBJS-$(CONFIG_AT91SAM9G45) += at91sam9m10g45_devices.o +COBJS-$(CONFIG_AT91_EFLASH) += eflash.o COBJS-$(CONFIG_AT91_LED) += led.o COBJS-y += clock.o COBJS-y += cpu.o
arch/arm/cpu/arm926ejs/at91/eflash.c new file +271 -0
271 lines not on this page · raw message
arch/arm/include/asm/arch-at91/at91_dbu.h new file +41 -0
41 lines not on this page · raw message
arch/arm/include/asm/arch-at91/at91_eefc.h new file +51 -0
51 lines not on this page · raw message
Signature · 1 line
1.5.6.5