Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
W
White Rabbit Switch - Software
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
86
Issues
86
List
Board
Labels
Milestones
Merge Requests
4
Merge Requests
4
CI / CD
CI / CD
Pipelines
Schedules
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
White Rabbit Switch - Software
Commits
5d170c04
Commit
5d170c04
authored
Apr 02, 2012
by
Benoit Rat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
usb-loader: Dirty and magical fix to make work the DDR with v3.1
parent
b30e7b80
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
30 additions
and
12 deletions
+30
-12
mch_flasher.c
usb-loader/mch_flasher.c
+23
-11
isp-dataflash-at91sam9g45.bin
usb-loader/samba_applets/isp-dataflash-at91sam9g45.bin
+0
-0
isp-extram-at91sam9g45-NR13.bin
usb-loader/samba_applets/isp-extram-at91sam9g45-NR13.bin
+0
-0
isp-extram-at91sam9g45-NR14.bin
usb-loader/samba_applets/isp-extram-at91sam9g45-NR14.bin
+0
-0
isp-extram-at91sam9g45.bin
usb-loader/samba_applets/isp-extram-at91sam9g45.bin
+0
-0
build.sh
usb-loader/samba_applets/isp-project/build.sh
+7
-1
No files found.
usb-loader/mch_flasher.c
View file @
5d170c04
...
...
@@ -303,8 +303,6 @@ int samba_connect(int board_rev)
int
tstart
,
i
,
length
,
npages
;
int
c
;
serial_write
(
handshake
,
3
);
sys_delay
(
100
);
...
...
@@ -314,22 +312,28 @@ int samba_connect(int board_rev)
if
(
board_rev
==
BOARD_REV_V2
&&
id
!=
ID_SAM9263
)
die
(
"Not a 9263 CPU"
);
if
(
board_rev
==
BOARD_REV_V3
&&
id
!=
ID_SAM9G45
)
die
(
"Not a 9G45 CPU"
);
}
int
ddr_init
(
int
board_rev
,
int
NR
)
{
if
(
board_rev
==
BOARD_REV_V2
)
samba_load_applet
(
"isp-extram-at91sam9263"
,
INTERNAL_SRAM_BUF
);
else
if
(
board_rev
==
BOARD_REV_V3
)
samba_load_applet
(
"isp-extram-at91sam9g45"
,
INTERNAL_SRAM_BUF
);
else
if
(
board_rev
==
BOARD_REV_V3
)
{
if
(
NR
==
14
)
samba_load_applet
(
"isp-extram-at91sam9g45-NR14"
,
INTERNAL_SRAM_BUF
);
else
samba_load_applet
(
"isp-extram-at91sam9g45-NR13"
,
INTERNAL_SRAM_BUF
);
}
mbox_write
(
INTERNAL_SRAM_BUF
,
MBOX_COMMAND
,
APPLET_CMD_INIT
);
mbox_write
(
INTERNAL_SRAM_BUF
,
MBOX_TRACELEVEL
,
0
);
mbox_write
(
INTERNAL_SRAM_BUF
,
MBOX_EXTRAM_RAMTYPE
,
1
);
mbox_write
(
INTERNAL_SRAM_BUF
,
MBOX_EXTRAM_VDDMEM
,
0
);
mbox_write
(
INTERNAL_SRAM_BUF
,
MBOX_EXTRAM_BUSWIDTH
,
16
);
mbox_write
(
INTERNAL_SRAM_BUF
,
MBOX_EXTRAM_DDRMODEL
,
0
);
samba_run
(
INTERNAL_SRAM_BUF
,
100000000
);
if
((
samba_read
(
INTERNAL_SRAM_BUF
+
MBOX_COMMAND
,
4
,
10000000
))
!=
~
APPLET_CMD_INIT
)
die
(
"invalid response from applet init"
);
if
((
samba_read
(
INTERNAL_SRAM_BUF
+
MBOX_STATUS
,
4
,
10000000
))
!=
APPLET_SUCCESS
)
die
(
"invalid response from applet status"
);
return
0
;
...
...
@@ -439,6 +443,14 @@ main(int argc, char *argv[])
serial_open
(
serial_port
,
PORT_SPEED
);
fprintf
(
stderr
,
"Initializing SAM-BA: "
);
samba_connect
(
board_rev
);
fprintf
(
stderr
,
"Initializing DDR...
\n\n
"
);
ddr_init
(
board_rev
,
14
);
sys_delay
(
100
);
fprintf
(
stderr
,
"Initializing DDR...
\n\n
"
);
ddr_init
(
board_rev
,
13
);
fprintf
(
stderr
,
"Checking DDR...
\n\n
"
);
ddr_check
(
board_rev
);
...
...
@@ -446,14 +458,14 @@ main(int argc, char *argv[])
fprintf
(
stderr
,
"Initializing DataFlash...
\n\n
"
);
dataflash_init
(
board_rev
);
//
fprintf(stderr,"Erasing DataFlash...\n\n");
//
dataflash_erase_all();
fprintf
(
stderr
,
"Erasing DataFlash...
\n\n
"
);
dataflash_erase_all
();
fprintf
(
stderr
,
"Programming DataFlash...
\n
"
);
dataflash_program
(
argv
[
1
]);
printf
(
"Programming done!
\n
"
);
serial_close
();
serial_close
();
return
0
;
}
usb-loader/samba_applets/isp-dataflash-at91sam9g45.bin
View file @
5d170c04
No preview for this file type
usb-loader/samba_applets/isp-extram-at91sam9g45-NR13.bin
0 → 100755
View file @
5d170c04
File added
usb-loader/samba_applets/isp-extram-at91sam9g45-NR14.bin
0 → 100755
View file @
5d170c04
File added
usb-loader/samba_applets/isp-extram-at91sam9g45.bin
View file @
5d170c04
No preview for this file type
usb-loader/samba_applets/isp-project/build.sh
View file @
5d170c04
...
...
@@ -32,6 +32,13 @@ compile_module()
CROSS_COMPILE
=
/opt/wrs/misc/cd-g++lite/bin/arm-none-eabi-
root
=
"
$(
dirname
$(
pwd
)
/
$0
)
"
#### Check compiler
if
[[
-z
$(${
CROSS_COMPILE
}
gcc
--version
|
grep
"Sourcery G++ Lite 2008q3-39"
)
]]
;
then
echo
"You should use Sourcery G++ Lite 2008q3-39 to compile samba-applets"
echo
"see reference: http://www.at91.com/forum/viewtopic.php/f,8/t,5352/"
exit
1
;
fi
#### Compilation of dataflash module
compile_module dataflash
$1
...
...
@@ -44,7 +51,6 @@ DEFINES="-DAT91C_DDRC2_NR_XX=AT91C_DDRC2_NR_14"
compile_module extram
$1
cp
${
root
}
/../isp-extram-at91sam9g45.bin
${
root
}
/../isp-extram-at91sam9g45-NR14.bin
DEFINES
=
"-DAT91C_DDRC2_NR_XX=
$1
"
#### Compilation of extern ram module
compile_module extram
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment