Compare commits

...

469 Commits

Author SHA1 Message Date
b7aa212269 ENGR00177587 MX6Q_ARM2: add android config for this board.
add android config to this board.
only basic boot support.

Signed-off-by: Zhang Jiejing <jiejing.zhang@freescale.com>
2012-03-22 13:49:23 +08:00
29e05b14a9 ENGR00176328 change fastboot vid to google orignal
Change fastboot vender id to orignal ID to
avoid install USB driver.

Signed-off-by: Zhang Jiejing <jiejing.zhang@freescale.com>
2012-03-07 19:03:48 +08:00
d80db149d9 ENGR00176235 mx6 ARD: Add splash screen support
This patch adds splash screen support for MX6 ARD.
Changes:
- Configure GPIO_3 as I2C3_SCL
- Change MAX7310 I2C address as 0x30
- Enable LVDS power
Usage:
1. To enable splash screen by default, define
CONFIG_SPLASH_SCREEN in mx6q_sabreauto.h
2. Config U-boot with followed command:()
	setenv splashimage '0x30000000'
	#Set splash position as Center
	setenv splashpos 'm,m'
	#Set LVDS via LVDS bridge 0
	setenv lvds_num 0

Signed-off-by: Lily Zhang <r58066@freescale.com>
2012-03-06 20:57:49 +08:00
27b291ac05 ENGR00176186 mx6dq ARD: add MFG tool support
Add MFG tool support for i.MX6DQ ARD board

Signed-off-by: Lily Zhang <r58066@freescale.com>
2012-03-06 17:06:42 +08:00
3b6fe9f99a ENGR00175981-2 mx53 smd android: fix build error
Fix the following build error when building mx53_smd_android
config:
mx53_smd_android.h:175: error: expected identifier or xx
before string constant

Signed-off-by: Lily Zhang <r58066@freescale.com>
2012-03-02 19:15:19 +08:00
2706397c1c ENGR00175981-1 mx53 smd: add CPU 1.2GHz configuration
CONFIG_CPU_1_2G is used to enable 1.2GHz@1.3V. To enable
1.2GHz by default, enable CONFIG_CPU_1_2G into config file.
For example, uncomment CONFIG_CPU_1_2G in mx53_smd.h or
mx53_smd_android.h.

Signed-off-by: Lily Zhang <r58066@freescale.com>
2012-03-02 19:09:27 +08:00
6d9c499ea0 ENGR00175117 [MX6DL LPDDR2 Board] Apply Initializtion script and enable U-Boot
Apply script "Mx6DL_init_LPDDR2_400MHz_Micron_1.1.inc" in IVT, make U-boot
work for the LPDDR2 Board. The Make target name for the new board is
"MX6DL_ARM2_LPDDR2_CONFIG"

The script is provided by Chen Wei - B26879 for a quick bring up, which don't
have a corresponding compass link. It is uploaded to CR ticket page for
reference.

Originally for MX6DL DDR3 board, "CONFIG_MX6DL" is defined. It is used by
"board/freescale/mx6q_arm2/flash_header.S" to select the correct IVT. Since
MX6DL LPDDR2 board also define this macro, for distiguish purpose, another
2 macros "CONFIG_MX6DL_DDR3", "CONFIG_MX6DL_LDPPR2" are defined

Signed-off-by: Eric Sun <jian.sun@freescale.com>
2012-02-29 12:20:41 +08:00
951586a9fb ENGR00175091 MX6Q_SABRESD: android: add recovery check
define a new macro to show which mmc bus was main storage
in recovery check, only check the main storage /cache
partition.

Signed-off-by: Zhang Jiejing <jiejing.zhang@freescale.com>
2012-02-27 13:01:11 +08:00
7d6fd7e5ba ENGR00174868 mx6dl arm2: change the default console as ttymxc3
The default console on i.MX6DL ARM2 CPU board is
ttymxc3

Signed-off-by: Lily Zhang <r58066@freescale.com>
2012-02-27 13:01:10 +08:00
39320e8b20 ENGR00174841 [U-Boot]Add a command to erase any pre-saved environment
A "destroyenv" command is provided to erase any pre-save environment in the
boot storage. The command simply add 1 to the CRC section and write it back
to the storage. Per the logic of U-Boot, this means after a reset, the
software will recognize the stored environment settings as "damaged" and turn
to use the default one, which is defined in "default_environment"

With this command, platform bring up owner can maintain a "ready-to-use"
environment settings in software which others can use very conviniently.
U-boot users can also use it to do a environment restore if they want.

-----------------------------------
Usage Example:
> destroyenv

invalidate the CRC
write invalidate enviroment data to storage
Erasing SPI flash...Erasing SPI NOR flash 0xc0000 [0x2000 bytes]
..SUCCESS

Writing to SPI flash...Writing SPI NOR flash
0xc0000 [0x2000 bytes] <- ram 0x276009b8
SUCCESS

done
>
-----------------------------------

Signed-off-by: Eric Sun <jian.sun@freescale.com>
2012-02-27 13:01:09 +08:00
1f94eca51d ENGR00174821 booti: fix build error when not configure android partition.
fix build error when not configure android partition.

Signed-off-by: Zhang Jiejing <jiejing.zhang@freescale.com>
2012-02-27 13:01:09 +08:00
f532f697b8 ENGR00174536-2 MX6Q_SABRE[SD/Lite]: change bootcmd to booti
change boot command and recovery command to booti.

Signed-off-by: Zhang Jiejing <jiejing.zhang@freescale.com>
2012-02-27 13:01:08 +08:00
c530d9188d ENGR00174536-1 booti: add booti command support.
Support booti command which can boot from a boot.img
boot.img is a zImage + ramdisk.img + bootargs + boot addr
which include these info can be used to avoid mis match between
kernel and ramdisk, also can avoid commit to chagne default
bootargs.

For example:
> booti mmc1
command will read the boot.img from 1M offset,
and then parser the bootargs and ramdisk
then do the boot from that zImage.
> booti mmc1 recovery
will going to read the recovery's partition no
and offset and boot from recovery image.
this recovery image also a zImage + ramdisk

bootargs:
if uboot have define a env var 'bootargs', booti command
will use this bootargs as kernel cmdline

if you want use boot.img 's bootargs, just type:
> setenv bootargs
in uboot to clear the bootargs in uboot env.
our default uboot env will be NULL in config file.

also, android use boot.img to support OTA.

Signed-off-by: Zhang Jiejing <jiejing.zhang@freescale.com>
2012-02-27 12:59:45 +08:00
72e8b5a485 ENGR00174625: Remove build warnings for mx6q
Remove build warnings for mx6q.

Signed-off-by: Terry Lv <r65388@freescale.com>
2012-02-17 00:36:01 +08:00
362b35f6dc ENGR00174626: Fix cmd_regul build error
Fix cmd_regul build error.

Signed-off-by: Terry Lv <r65388@freescale.com>
2012-02-16 23:48:36 +08:00
c1ce2e692f ENGR00139213: Add read and change voltage support for mx6
dd read and change voltage support for mx6.
For help, pls type "help regul"
Detail command info:
regul list - List all regulators' name
regul show all - Display all regulators' voltage
regul show core - Show core voltage in mV
regul show periph - Show peripheral voltage in mV
regul show <regulator name> - Show regulator's voltage in mV
regul set core <voltage value> - Set core voltage in mV
regul set periph <voltage value> - Set periph voltage in mV
regul set <regulator name> <voltage value> - Set regulator's voltage in
mV

Example:
MX6Q ARM2 U-Boot > regul list
Name            Voltage
vddpu
vddcore
vddsoc
vdd2p5
vdd1p1
vdd3p0
MX6Q ARM2 U-Boot > regul show all
Name            Voltage
vddpu           1100000
vddcore         1100000
vddsoc          1200000
vdd2p5          2400000
vdd1p1          1100000
vdd3p0          3000000
MX6Q ARM2 U-Boot > regul show periph
Name            Voltage
periph:         1100000
MX6Q ARM2 U-Boot > regul show core
Name            Voltage
core:           1100000
MX6Q ARM2 U-Boot > regul set core 1100000
Set voltage succeed!
Name            Voltage
core:           1100000

Signed-off-by: Terry Lv <r65388@freescale.com>
2012-02-16 02:24:04 +08:00
6966515282 ENGR00174326 MX6Q_SABRESD: add android related function and config.
enable mfg profile.
enable recovery mode.

mx6q_sabresd board's usb otg have HW issue, disable it in
android profile.

Signed-off-by: Zhang Jiejing <jiejing.zhang@freescale.com>
2012-02-15 16:58:11 +08:00
ac94e04f45 ENGR00174407 imx6dl: add MFG tool support
Add MFG tool support in imx6dl U-boot

Signed-off-by: Lily Zhang <r58066@freescale.com>
2012-02-14 13:28:23 +08:00
8ab3dff572 ENGR00174230: Move partition command from nand to sata in mx6
Move partition command from nand to sata in mx6 for nand don't need
these partition command.

Signed-off-by: Terry Lv <r65388@freescale.com>
2012-02-13 23:44:25 +08:00
eb47941948 ENGR00174104-4: Fix iram build error in imx6
Fix a build error when part.c is built in iram u-boot building.

part.c:94: error: redefinition of 'get_dev'
/home/r65388/uboot-imx-v2009.08/uboot-imx/include/part.h:117: error:
previous definition of 'get_dev' was here
make[1]: *** [part.o] Error 1
make[1]: Leaving directory
`/home/r65388/uboot-imx-v2009.08/uboot-imx/disk'
make: *** [disk/libdisk.a] Error 2

Signed-off-by: Terry Lv <r65388@freescale.com>
2012-02-13 23:44:25 +08:00
2b3df5c860 ENGR00174104-3: Fix mx6 iram boot configs' issue
Two issues are fixed:
1. Enlarge malloc size to 10K.
2. Too many configs in sabresd's iram config, remove redundent configs.

Signed-off-by: Terry Lv <r65388@freescale.com>
2012-02-13 23:44:25 +08:00
9ce43df6a8 ENGR00174104-2: Add mx6dl iram boot config
Add mx6dl iram boot config.

Signed-off-by: Terry Lv <r65388@freescale.com>
2012-02-13 23:44:25 +08:00
012225eff5 ENGR00174104-1: Add conditional CONFIG to fix build break
Add CONFIG_MXC_FEC macro to fec init code.
Add CONFIG_VIDEO_MX5 to ipu init code.
Change temperature function as static.
For in iram boot, FEC configs is not needed, those FEC init code will
cause build errors.
These changes can reduce image size.

Signed-off-by: Terry Lv <r65388@freescale.com>
2012-02-13 23:44:03 +08:00
6931f342e1 ENGR00174221 imx6dl remove unnecessary configs for NAND
CONFIG_DOS_PARTITION, CONFIG_CMD_FAT, CONFIG_CMD_EXT2 are only for
MMC and SATA, remove from NAND config segment

Signed-off-by: Allen Xu <allen.xu@freescale.com>
2012-02-10 15:33:21 +08:00
abb19656fe ENGR00174155-3 i.mx6sdl: enable i.mx6solo config by default
remove arm_freq=800 from default env thus keep 1GHz for kernel

Signed-off-by: Jason Liu <r64343@freescale.com>
2012-02-10 14:50:18 +08:00
0f8cf0cc51 ENGR00174155-2 i.mx6sdl: enable i.mx6solo config by default
enable i.mx6solo config by default

Signed-off-by: Jason Liu <r64343@freescale.com>
2012-02-09 21:51:09 +08:00
29be0c2538 ENGR00174155: i.mx6sdl: add 32bit DDR support on ARM2 board
The 32bit DDR script got from the following link:
http://compass.freescale.net/livelink/livelink/225194568/
MX6DL_init_DDR3_400MHZ_32bit_1.0.inc.txt?func=doc.Fetch&nodeid=225194568

The DDR hw connection on the ARM2 board is 64bit wire, but we can make it use
as 32bit, the side effect is that DDR access size will reduce to the half

Signed-off-by: Jason Liu <r64343@freescale.com>
2012-02-09 21:48:01 +08:00
1a509004af ENGR00174055: i.mx6dl: ddr: update ddr script to 400M_64bit_v1.1
The script we get from the following link:

http://compass.freescale.net/livelink/livelink/225193471/MX6DL_init_
DDR3_400MHz_64bit_1.1.inc.txt?func=doc.Fetch&nodeid=225193471

Signed-off-by: Jason Liu <r64343@freescale.com>
2012-02-09 16:39:26 +08:00
9981c5c0e6 ENGR00173966-4: ARM2: add initial support for i.mx6sdl
This patch add the initial support for i.mx6dl ARM2 board
-SD/MMC basic
-DDR 400Mhz,
-FEC,basic

Due to i.mx6dl shares the same board with i.mx6q on ARM2,
the most common code should be the same as the i.mx6q ARM2
So, no need to create one seperate board file for i.mx6dl.

But We can't simply resue anything from the board file since
the i.mx6dl iomux is changed and thus we have to deal with the
difference between i.mx6q and i.mx6dl for the pad setting part.

Signed-off-by: Jason Liu <r64343@freescale.com>
2012-02-07 20:11:43 +08:00
e1b4f625f1 ENGR00173966-3: ARM2: i.mx6dl: add the DDR script
integrate DDR script http://compass.freescale.net/livelink/
livelink/225147268/rigel_temp.inc.txt?func=doc.Fetch
&nodeid=225147268

Signed-off-by: Lily Zhang <r58066@freescale.com>
Signed-off-by: Jason Liu <r64343@freescale.com>
2012-02-07 20:11:43 +08:00
b0c01ae200 ENGR00173966-2: fec: add i.mx6dl support
This patch add i.mx6dl support for fec driver
i.mx6dl and i.mx6dq shares the same ENET IP.

Signed-off-by: Jason Liu <r64343@freescale.com>
2012-02-07 20:11:42 +08:00
309835257e ENGR00173966-1: i.mx6dl: add the iomux head file
Checkpatch will throw some warnings in iomux-mx6dl.h file as:
WARNING: line over 80 characters

But for the readable, I intend not to fix these warnings, and
linux/uboot upstream also has so many such kind of cases

Acked-by: Lily Zhang <r58066@freescale.com>
Signed-off-by: Jason Liu <r64343@freescale.com>
2012-02-07 20:11:42 +08:00
d774b97d4b ENGR00173659 MX6Q_UART Change Phyisical to Virtural Port Mapping
For ARM2 and Sabreauto, change TTY0 to TTY3 (which is physical UART4)
For SabreSD, Change TTY3 to TTY0 (which is physical UART1)

Signed-off-by: Eric Sun <jian.sun@freescale.com>
2012-02-03 09:56:49 +08:00
e07dc76eb1 ENGR00173579 Revert FEC: Fix FEC cannot load kernel accroding tftp.
Revert "ENGR00162937 - FEC: Fix FEC cannot load kernel accroding tftp."
That commit only worked on specific networks. It broke BOOTP on other
networks.

This reverts commit 51aa554b06.

Signed-off-by: Alan Tull <r80115@freescale.com>
2012-02-02 05:26:12 -06:00
23971b0a8f ENGR00172343 Add suport for i.MX 6Q Sabre Smart Device
Add suport for i.MX 6Quad SABRE Smart Device.

Signed-off-by: Nancy Chen <Nancy.Chen@freescale.com>
Signed-off-by: Tony Lin <tony.lin@freescale.com>
Signed-off-by: Frank Li <Frank.Li@freescale.com>
2012-01-24 10:08:28 -06:00
62ade1e4ba ENGR00172541 Delete bootcmd_base from the MX6 Sabre-lite config
Update the config to delete bootcmd_base from the default env settings for
Sabre-lite

Signed-off-by: Mahesh Mahadevan <r9aadq@freescale.com>
2012-01-23 18:55:41 -06:00
1a5fa49e7f ENGR00172490: FIX: PMIC registers may not be accessible in u-boot via SPI
The system PMIC registers may not be accessible in u-boot via SPI if
function pmic_reg() is called in the latter part of boot up process in u-boot.

It is because the imx_spi_slave structure is allocated from malloc() in
the spi_setup_slave() function. However, this structure is not completely
initialized, which may result in using a dirty control register value
at CSPI during transfer.

memset() the imx_spi_slave structure after malloc() can resolve this problem

Please refer to CT39243849.

Signed-off-by: Robby Cai <R63905@freescale.com>
2012-01-20 17:35:57 +08:00
630bee9f3f ENGR00171968 mx6q sabrelite: fixup the sabrelite default bootargs typo
change default console to ttymxc1

Signed-off-by: Xinyu Chen <xinyu.chen@freescale.com>
2012-01-13 14:22:38 +08:00
35056bb16d ENGR00171771 [MX6]Need to power down PCIe by default
PCIe is power on by defaultt, we need to power down
it in u-boot, it can save more than 1mW during suspend.

Signed-off-by: Anson Huang <b20788@freescale.com>
2012-01-12 11:09:12 +08:00
8b6086d7e9 ENGR00171872 Android: update sabrelite default config fix a typo.
Fix a typo in default config.

Signed-off-by: Zhang Jiejing <jiejing.zhang@freescale.com>
2012-01-12 10:43:45 +08:00
44d91a044a ENGR00171633 MX6Q: config: android: update default config.
1. C macro don't eval, so the rd_loadaddr will be (CONFIG_LOADADDR + 0x300000)
rather then number, will cause uboot can't boot, change this to a number which
make default boot env correct.

2. update android mx6q saberlite config to align lastest code status.

Signed-off-by: Zhang Jiejing <jiejing.zhang@freescale.com>
2012-01-12 09:51:24 +08:00
b6f6189531 ENGR00171622 - FEC : workaround for Gb enet in sabrelite board.
Micrel phy KSZ9021 Gb speed cannot work well in i.MX6 sabrelite
board. Advertise phy is not 1000Base-T capable, and  enet can
work well at 100Mbps mode in 1000M environment(1G cable & 1G hub).

Signed-off-by: Fugang Duan  <B38611@freescale.com>
2012-01-11 04:01:23 -06:00
30340cb4f2 ENGR00171115 add fec support in mx6q sabreauto board
Add fec support for sabreauto board
Need hardware rework:
1. Add R450 10.0k
2. Remove R1105 1k
3. short Pin 1,2 of u516, will impact CAN1

Signed-off-by: Hake Huang <b20222@freescale.com>
2011-12-31 18:06:18 +08:00
6f3c7d808a ENGR00171091 [MX6]Remove workaround for reset issue
The root cause is the L1 I-cache need invalidation,
now we don't need this workaround, so remove it.

Signed-off-by: Anson Huang <b20788@freescale.com>
2011-12-30 11:33:22 +08:00
b883fc83fa ENGR00171008 MX6Q/MFGTOOL : disable the workaround for MFGTOOL
Disable the uboot workaround. It will crash the MFGTOOL.

Signed-off-by: Huang Shijie <b32955@freescale.com>
2011-12-28 15:49:05 +08:00
e3db9d7f78 ENGR00170876 Android: align boot commands with user guide.
Align latest boot command with user guide.

Signed-off-by: Zhang Jiejing <jiejing.zhang@freescale.com>
2011-12-23 10:49:54 +08:00
fae9e8dcb1 ENGR00170837 [MX6]Add temperatuer check into uboot
We need to check CPU temperature in uboot, if cpu
is too hot, we will let it waiting there until cpu
temperature drop to save region, then go on boot
up.

Signed-off-by: Anson Huang <b20788@freescale.com>
2011-12-22 18:30:47 +08:00
34e34f3ccb ENGR00170768 Android: Fix fastboot can't used on MX6Q SL MMC1 device.
Fix fastboot can't used on mmc1 device on android.

caused by the mmc part number use strtoul but it need the partition number < 0 .
So this caused such error.

Fixed by change strtoul to strtol.

Signed-off-by: Zhang Jiejing <jiejing.zhang@freescale.com>
2011-12-21 19:13:37 +08:00
9a57b6eacb ENGR00162642: Fix bug in setting VDDSOC voltage
Fix incorrect VDDSOC voltage setting in uboot.

Signed-off-by: Ranjani Vaidyanathan <ra5478@freescale.com>
2011-12-20 20:19:00 +08:00
3568732ec7 ENGR00160621 [MX6]Workaround for reset issue
Add workaround for POR/wdog reset issue, we need to
do a CORE LDO reset everytime POR/wdog reset, otherwise
kernel will crash or hang when we booting more than 2
cores. Root cause is still under investigation, it is
analog/power related issue, may take long time to
identify the root cause, we need to add workaround to make
function ready first. The flow of workaround is as below:

1. Check CORE LDO reset flag, currently stored in SNVS_LPGPR[0];
2. If it is there, clear it, go on boot up system; If not,
Set the flag, configure wdog to timeout in 0.5 seconds, then
disable CORE LDO and wait for wdog timeout;

This workaround will bring 0.5~1 seconds delay of booting.

Signed-off-by: Anson Huang <b20788@freescale.com>
2011-12-20 20:14:54 +08:00
14dab831e8 ENGR00163697 - FEC : Adjust MX53 Network stream throughput.
- When the system is very busy(such as play 1080p streaming in local)
   the WIFI & FEC performance were very low.
 - Enable the patch in uboot for WIFI and FEC performance:
   If WIFI connect to PORT2, enable the config:
  	 CONFIG_ADJUST_WIFI_FEC_PERFORMANCE
  	 CONFIG_WIFI_SDHC_PORT2
   If WIFI connect to port3, enable the config:
   	CONFIG_ADJUST_WIFI_FEC_PERFORMANCE
	CONFIG_WIFI_SDHC_PORT3
 - The solution of the patch:
   I. Changing M4IF dynamic jump value to zero, which can guarantee FEC the
      high rate of accessing bus.
   II. Increase Master 4 priority for FEC.
       Increase Master 2 and AHBMAX priority for WIFI.
   - Test result:
     i.MX53 FEC bandwidth (1080p streaming playback in local): 47.1 Mbits/sec.

Signed-off-by: Fugang Duan  <B38611@freescale.com>
2011-12-20 18:19:25 +08:00
2b358843f8 ENGR00169544 - FEC : fix "imx5x bootp command cannot work well".
- "bootp" command sometime cannot work well in i.MX53 platform.
- Cause:
  Phy detect cable link need some time, so need wait the complete
  of cable detect.

Signed-off-by: Fugang Duan  <B38611@freescale.com>
2011-12-20 18:11:00 +08:00
eb9d8c0430 ENGR00170644: Enlarge mmc read size to 4M in default env
For uImage's size of mx6q is larger than 3M, we enlarge mmc read size to
4M in default env.

Signed-off-by: Terry Lv <r65388@freescale.com>
2011-12-20 14:03:25 +08:00
8b48a2486b ENGR00170516 Enable the master mode for ENET PHY on MX6 Sabrelite
Fix the ENET PHY settings on MX6 Sabre-lite to enable Master mode

Signed-off-by: Mahesh Mahadevan <r9aadq@freescale.com>
2011-12-16 09:14:58 -06:00
b2a2cd5932 ENGR00170405 Android: MX6Q_SL: Fix recovery key detection
Fix recovery key detection, the VOL_DN key is low assert.
Or it will always enter recovery mode.

Signed-off-by: Zhang Jiejing <jiejing.zhang@freescale.com>
2011-12-15 18:23:06 +08:00
42ff5e80c9 ENGR00170372 mx6q sabrelite: make TF card as default boot media
As we want TF to be default boot media.
Then SD slot can be used by WIFI dongle.

Signed-off-by: Xinyu Chen <xinyu.chen@freescale.com>
2011-12-15 15:02:56 +08:00
2c4cf52ca2 ENGR00170299-3 Android: add android board configure file.
add android mx6q sabrelite configure file.

Signed-off-by: Zhang Jiejing <jiejing.zhang@freescale.com>
2011-12-15 11:27:49 +08:00
930409823d ENGR00170299-2 Android:MX6Q_SL: add board support for recovery and fastboot.
add mx6q sabrelite board support for fastboot and recovery.
add recovery key check, same key as in MX53_SMD.

Signed-off-by: Zhang Jiejing <jiejing.zhang@freescale.com>
2011-12-15 11:26:58 +08:00
6dd956ebde ENGR00170299-1 Android: add support fastboot function
add support for otg in MX6Q uboot to enable fastboot function.

Signed-off-by: Zhang Jiejing <jiejing.zhang@freescale.com>
2011-12-15 11:23:48 +08:00
a32bc11e6e ENGR00169919 MX6Q ARM2 U-Boot : Support Pop CPU Board
Add support for MX6Q ARM2 LPDDR2 POP CPU Board. Change thing include
- TEXT_BASE
- RAM address and size
- Initialization DCD
- MMU related code

Use mx6q_arm2_lpddr2pop_config as the build config. After u-boot.bin is
generated, set the board to serial download mode, use sb loader to run the
bootloader.

There is one line in the original DDR initialization script
setmem /32 0x00B00000 = 0x1
however this address can not be accessed by DCD. A try to add it later in
"dram_init" block the boot up. Waiting for IC team to give an explanation
on it. Hold temperorily

The MMU Change can be concluded as the following
 - Cacheable and Uncacheable SDRAM allocation changes to
	Phys		Virtual		Size		Property
	----------	----------	--------	----------
	0x10000000	0x10000000	256M		cacheable
	0x80000000	0x20000000	16M		uncacheable
	0x81000000	0x21000000	240M		cacheable

 - TEXT_BASE change to 0x10800000, which reserves 8MB of memory at the start
   of SDRAM. This address makes sure that the text section of U-boot have the
   same Physical and Virtural address, thus the PC don't need to change when
   MMU is enabled. Also the text section is all allocated in cacheable memory,
   which may increase excecution performance.

 - Since this SDRAM allocation avoid overlap in physical memory between
   cacheable and uncacheable memory, the implementation of __ioremap can be
   ignored

Signed-off-by: Eric Sun <jian.sun@freescale.com>
2011-12-13 19:41:54 +08:00
c9de95a0d7 ENGR00169741 UBOOT : DDR3 initialization based on the MX6Q ARD
Fix for DDR3 initialization based on the MX6Q ARD. This will
reflect 2GB of RAM onboard.

Signed-off-by: Prabhu Sundararaj <prabhu.sundararaj@freescale.com>
2011-12-12 14:20:18 -05:00
05a7baee9f ENGR00169655 pcba : merge i2c recovery patch to pcba
add i2c recovery function in board_lateinit,merge the patch of ENGR00163704

Signed-off-by: Robin Gong <B38343@freescale.com>
2011-12-09 17:35:58 +08:00
9af08a287a ENGR00169654 mx53_pcba: enable DDR auto-calibration
Enabled the functioon of DDR auto-calibration in flash_header.S
of HW PCBA.

Signed-off-by: Robin Gong <B38343@freescale.com>
2011-12-07 10:09:30 +08:00
c9384fca46 ENGR00169500 mc34708 mx53_loco: 4s power off in QS board
Implement the power off function when push the PWR key for 4s

Signed-off-by: Robin Gong <B38343@freescale.com>
2011-12-06 09:34:30 +08:00
de0443f4d4 ENGR00163704: MX5X: add i2c recovery function in board_lateinit.
This patch add a i2c bus recovery function, the i2c bus busy
because some device pull down the I2C SDA line. This happens
when Host is reading some byte from slave, and then host is
reset/reboot.

Since in this case, device is controlling i2c SDA line, the
only thing host can do this give the clock on SCL and sending
NAK, and STOP to finish this transaction.

To fix this issue:
when we found SDA is low, we generate 8 clock to let device
send data, then send a NAK, and STOP to finish this I2C
transaction , after this the clock will be clean.

Signed-off-by: Zhang Jiejing <jiejing.zhang@freescale.com>
2011-12-05 15:03:29 +08:00
e696f7dac5 ENGR00163513 MX6Q-UBOOT : Add download_mode cmd
Add "download_mode" command to U-Boot. It will force a system reset and let
 boot running in "boot from serial rom" mode, which can be used by manufacturing
 tool.

 The command will triggle a write to SRC_GPR9 and SRC_GPR10, then triggle a
 watchdog reset. GPR9 and GPR10 can maintain their value during the reset, the
 value in it make ROM to start in "boot from serial rom" mode. After that GPR9
 and GPR10 are written by their original value for normal boot.

Signed-off-by: Eric Sun <jian.sun@freescale.com>
2011-11-30 13:54:57 +08:00
127f1cf74b ENGR00163370 Android: uboot: mx53_smd fix warnning message
Fix minor error when adding recovery related code.

Signed-off-by: Zhang Jiejing <jiejing.zhang@freescale.com>
2011-11-29 16:11:58 +08:00
995fbbca01 ENGR00163239-2 mc34708: enable extra charging circuit
current schema is to enable this extra charging circuit, and
then enable or disable it by checking VBatt is less or more
than 3.4v. If VBatt is less than 3.4v, enable it; otherwise
disable it.

Signed-off-by: Robby Cai <R63905@freescale.com>
2011-11-28 11:23:11 +08:00
db44a4caf2 ENGR00163239-1 mc34708: fix not charging issue in uboot
there's some incorrect setting in spi mode, fixed in this patch.

Signed-off-by: Robby Cai <R63905@freescale.com>
2011-11-28 11:23:11 +08:00
f1229ce633 ENGR00163040 - FEC : Fix ethernet cannot work after system sleep.
- Descript:
  Ethernet can't work in uboot and kernel DHCP throught press
 'reset' key when send sleep command 'echo mem > /sys/power/state'
- Cause:
  FEC driver will power down phy when system sleep. If just reset the
  board, FEC driver cannot run resume function. So, need power on phy
  in uboot and linux driver.

Signed-off-by: Fugang Duan <B38611@freescale.com>
2011-11-25 19:45:10 +08:00
6f3add0332 ENGR00162717 mx53_smd/mx53_loco DA9053: reset da9053 i2c and add dummy write
mx53_smd, mx53_loco DA9053: reset da9053 i2c by sending
9 dummy clock and start/stop when bootup and add dummy write
when accessing da9053 registers.

Signed-off-by: Wayne Zou <b36644@freescale.com>
2011-11-25 14:52:32 +08:00
51aa554b06 ENGR00162937 - FEC: Fix FEC cannot load kernel accroding tftp.
- Issue description:
  Fec can not get ip address to download kernel if insert the
  cable after powering up the board more than 20 seconds.
- Patch:
  Restart init FEC interface when net cannot get packets. The
  cause maybe cabel are unplugin or FEC are not ready.

Signed-off-by: Fugang Duan  <B38611@freescale.com>
2011-11-24 13:06:48 +08:00
08b5c56351 ENGR00162938 MX5: Add download_mode command in uboot to enter MFG download mode.
Add download_mode command in uboot to enter MFG dowload mode ,
you can try download mode command in uboot and enter download mode.
it first set srtc register, then before enter linux,
it will clear these register to prevent the up comming watchdog
reset will enter mfgtool mode.

only add mx53 now.

Signed-off-by: Zhang Jiejing <jiejing.zhang@freescale.com>
2011-11-23 14:28:45 +08:00
ddbe9eb5ee ENGR00162874: Add enet clk change support for mx6
Add enet clk change support for mx6.

Signed-off-by: Terry Lv <r65388@freescale.com>
2011-11-23 12:01:21 +08:00
4327d84f15 ENGR00162709 Add Support for MX6Q Sabre Auto
1. Change RAM size from 2GB to 1GB
2. Default boot from MMC Dev 2

Signed-off-by: Eric Sun <jian.sun@freescale.com>
2011-11-21 16:45:42 +08:00
9c9807eec8 ENGR00162491 Android: MX53_SMD: enter recovery mode by key.
Implement a key press check on recovery mode check.
User can press Vol- key to enter recovery mode when boot.
Idealy, should be a combo key press together, but on SMD
it only can Vol+ or Vol- but it can't press together.

More usuful for user and less bug.

Signed-off-by: Zhang Jiejing <jiejing.zhang@freescale.com>
2011-11-18 15:57:39 +08:00
09412797bb ENGR00162570: MX6-Increase VDDSOC_CAP voltage to 1.2V
Set the VDDSOC LDO to increase the VDDSOC cap to 1.2V.
This is required for correct functioning of GPU and when the
ARM LDO is set to 1.225V (when ARM core is at 1GHz).

Signed-off-by: Ranjani Vaidyanathan <ra5478@freescale.com>
2011-11-17 17:45:10 -06:00
f47472bed8 ENGR00162437 uboot mc34708 pcba : add spi support on mc34708
Rev C of pcba will connect mc34708 by spi default, so uboot should support it:
1. add spi support in mx53_pcba
2. move pmic voltage config from board_init to board_late_init
3. support both I2C and SPI on mc34708 in one image
Signed-off-by: Robin Gong <B38343@freescale.com>
2011-11-17 11:11:39 +08:00
02922d7dae ENGR00155891 : Fix reboot stress test failed issue
If we replace DCD mode with plug-in mode in u-boot , we found DDR not stable.
We should enable "Force Measurement" after the delay line
parameters is configured in the plug-in code, for example:
0x63fd9088 = 0x34333936
0x63fd9090 = 0x49434942
0x63fd90F8 = 0x00000800 "Force Measurement"
update all of mx53 DDR script, include mx53_smd,mx53_loco,mx53_evk,mx53_ard,
mx53_pcba, at the same time, mx53_pcba will change from DCD mode to plug-in
mode in flash_header.S

Signed-off-by: Robin Gong <B38343@freescale.com>
2011-11-16 14:29:10 +08:00
97efee177f ENGR00161852: remove u-boot build warnings for mx6q
Remove u-boot build warnings for mx6q.

Signed-off-by: Terry Lv <r65388@freescale.com>
2011-11-10 16:11:41 +08:00
a30b8dbe9c ENGR00161860 Fix build issue when enable NAND in Uboot
Add the MACRO define CONFIG_APBH_DMA which missed in last commit

Signed-off-by: Allen Xu <allen.xu@freescale.com>
2011-11-10 15:06:26 +08:00
819894160c ENGR00161846 uboot mx6q_arm2: adjust IPU axi-id0/1 Qos value
set IPU AXI-id0 Qos=0xf(bypass) and  AXI-id1 Qos=0x7,
mx6q use AXI-id0 for IPU display channel, it should has
highest priority(bypass), and AXI-id1 for other IPU channel,
it has high priority.

Signed-off-by: Jason Chen <b02280@freescale.com>
2011-11-10 10:52:40 +08:00
eb5dce7eba ENGR00161691 Manufacturing update for Sabre-lite
Add support for the manufacturing tool on MX6 Sabre-lite

Signed-off-by: Mahesh Mahadevan <r9aadq@freescale.com>
2011-11-08 04:01:51 -06:00
d34f48bb69 ENGR00161354 MX6Q ARM2 U_BOOT: "mmc dev 0" or "mmc dev 1" cmds will hang
Ungate the clocks to SD1 and SD2 ports (on baseboard of ARM2 system)
so that the above cmds do not hang waiting for cmd to complete or
timeout.

Signed-off-by: Anish Trivedi <anish@freescale.com>
2011-11-04 09:49:42 -05:00
eadeefdbe4 ENGR00161415: mc34708: set 1p5
set charging current limit to 1p5

Signed-off-by: Robby Cai <R63905@freescale.com>
2011-11-04 17:42:06 +08:00
78b0d1eeeb ENGR00157106 uboot mx6q: adjust IPU axi-id0/1 Qos value
set IPU AXI-id0 Qos=0xf(bypass) and  AXI-id1 Qos=0x7,
mx6q use AXI-id0 for IPU display channel, it should has
highest priority(bypass), and AXI-id1 for other IPU channel,
it has high priority.

Signed-off-by: Jason Chen <b02280@freescale.com>
2011-11-04 13:00:00 +08:00
476a853fac ENGR00161317 - MX6Q: Integrate plugin and dcd DRAM init script in uboot.
- Add plugin DRAM init script in flash_header.S file.
- Define CONFIG_FLASH_PLUG_IN in mx6q_sabreauto.h to switch plugin mode.
- DDR support 528MHz and 480MHz in plugin mode.
  Switch DDR clock to 480M according to define CONFIG_IPG_40M_FR_PLL3.

Signed-off-by: Fugang Duan  <B38611@freescale.com>
2011-11-04 10:54:30 +08:00
ad856cbcbd ENGR00161373 Move the MAC address read from fuse code to MX6 SoC file
Move the code to read the mac address from the fuse to SoC file
and out of the board file

Signed-off-by: Mahesh Mahadevan <r9aadq@freescale.com>
2011-11-03 08:22:55 -05:00
c41f1c6b8c ENGR00161296 Update the MX6 Sabre-lite environment option in the config file
Allow boot to either SD card through 6q_bootscript.
Define clearenv command to restore factory defaults
Add upgradeu command to upgrade u-boot if required

Signed-off-by: Mahesh Mahadevan <r9aadq@freescale.com>
2011-11-03 06:34:27 -05:00
13b7fad6b3 ENGR00161254 MX6Q: Add NAND support in Uboot
Add iomux and clock setting in Uboot code to support NAND, due to
the conflict between NAND and SD, NAND function is not enabled in
default configuration.

Signed-off-by: Allen Xu <allen.xu@freescale.com>
2011-11-03 11:29:26 +08:00
01a080fe6c ENGR00161294 Update MX6 code to read MAC address from fuses
Fix the code to read the MAC address correctly from the fuses

Signed-off-by: Mahesh Mahadevan <r9aadq@freescale.com>
2011-11-02 10:16:23 -05:00
9aa74e691a ENGR00161277 Add fuse access capability for MX6 Sabre-lite
Add support to read and program fuses in the MX6 Sabre-lite

Signed-off-by: Mahesh Mahadevan <r9aadq@freescale.com>
2011-11-02 08:00:52 -05:00
822c9266e6 ENGR00139215 iMX61 Uboot support blow fuse
1. add force option to blow operation
2. add blown value check
3. add simple validation for zeros returned by 'simple_strtoul' call

Signed-off-by: Ryan QIAN <b32804@freescale.com>
2011-11-02 10:22:16 +08:00
3dc5c067ea ENGR00161126 Enable Hush parser in MX6Q Sabrelite config
Enable the Hush parser in the Sabrelite config to parse boot
scripts.

Signed-off-by: Mahesh Mahadevan <r9aadq@freescale.com>
2011-11-01 04:50:22 -05:00
c1c2931c8e ENGR00161133: Add spi-nor support for mx6q
Add spi-nor support for mx6q.

Signed-off-by: Terry Lv <r65388@freescale.com>
2011-11-01 15:08:46 +08:00
10bff02ace ENGR00161125 Update MX6Q Sabrelite config to boot from MMC by default
Boot from MMC by default and disable DHCP by default on MX6Q Sabrelite

Signed-off-by: Mahesh Mahadevan <r9aadq@freescale.com>
2011-10-31 11:51:47 -05:00
54e64d791b ENGR00161004 MX6Q Uboot Rename sabreauto to arm2 board
Sabreauto is an inaccurate name for the Armadillo2 board that
this code is actually meant for. So, replaced "sabreauto" in folder names,
file names, configs, and code with "arm2". Created a new machine id for
ARM2 board.

Signed-off-by: Anish Trivedi <anish@freescale.com>
2011-10-28 15:30:47 -05:00
ec10ca3177 ENGR00139221 USDHC Add SDXC UHS-I support
Modified MMC library for UHS-I command sequence
Added support to USDHC driver for UHS-I

Signed-off-by: Anish Trivedi <anish@freescale.com>
2011-10-27 15:56:23 -05:00
1b69b48bba ENGR00160514: clean up compiler warning for mx6q
Clean up compiler warning.

Signed-off-by: Terry Lv <r65388@freescale.com>
2011-10-26 11:37:30 +08:00
35c0640af2 ENGR00160399 Added support for the MX6Q Sabre-lite board
Includes support for uSDHC read, write, FEC, SPI-NOR etc.

Signed-off-by: Mahesh Mahadevan <r9aadq@freescale.com>
2011-10-25 05:46:22 -05:00
12603b0bd0 ENGR00160725 fastboot: fix the serial number display error
Incorrect usb string package size assign.

Signed-off-by: Xinyu Chen <xinyu.chen@freescale.com>
2011-10-25 16:22:07 +08:00
95dfb041f9 ENGR00160507 Update the IOMUX implementation for MX6
The MX6 code incorrectly uses the Hysteresis bit to decide NO_PAD_CTRL
operation

Signed-off-by: Mahesh Mahadevan <r9aadq@freescale.com>
2011-10-20 09:43:54 -05:00
7e9b5ed40d ENGR00156934: Update mx35 AIPS max dbg m3if esdctl settings
This patch is to fix mx35 TVIN flicker issue.
It will change AIPS, M3IF, MAX, DBG and esdctl settings.

Signed-off-by: Terry Lv <r65388@freescale.com>
2011-10-18 10:13:57 +08:00
e7cdad7018 ENGR00156930: Update MX35 DDR2 scripts
Update MX35 DDR2 scripts for that when enabling 256MB, the CSD1 is not
stable.
1. Add CSD1 configs to support 256M RAM.
2. Add mx35 TO2 256M RAM configs.
3. Update DDR init code in lowlevel_init.S for external boot.

Signed-off-by: Terry Lv <r65388@freescale.com>
2011-10-18 10:13:57 +08:00
856b3602d1 ENGR00139279-3 MX6Q: invalidate the D-CACHE
The USB boot mode does not invalidate the D-CACHE,
so the uboot will DEAD when it tries to invalidate the random data in
the cache line.

The MMC boot will do the MMU init which will do the D-CACHE invalidation.
So the MMC boot will ok in the boot procedure.

Signed-off-by: Huang Shijie <b32955@freescale.com>
2011-10-14 15:46:47 +08:00
b0d0b2e767 ENGR00139279-2 MX6Q: add mfgtool support
add the MFGTOOL support for mx6q.

Signed-off-by: Huang Shijie <b32955@freescale.com>
2011-10-14 15:46:45 +08:00
44b53333ef ENGR00139279-1 MX6Q: add env_embedded module for CONFIG_ENV_IS_NOWHERE
The env_embedded module is a built-in module.
So add the module when the CONFIG_ENV_IS_NOWHERE is enabled.

Signed-off-by: Huang Shijie <b32955@freescale.com>
2011-10-14 15:36:45 +08:00
f2cd986d01 ENGR00159845 [MX6]lpddr2 board, put MMDC into power saving mode
For lpddr2 board.
1. Put mmdc into power saving mode;
2. Do the necessary setting for AXI cache and IPU Qos.

Signed-off-by: Anson Huang <b20788@freescale.com>
2011-10-13 10:32:52 +08:00
6830732260 ENGR00159740 Android: Fastboot: enlarge max image size to 148MB
enlarge max image size to 148MB from 128MB. since android become bigger.
 so 128M not enough.

Signed-off-by: Zhang Jiejing <jiejing.zhang@freescale.com>
2011-10-12 11:15:45 +08:00
4fc00a0ad3 ENGR00159696 [MX6]Enable lpddr2 board
And new config to enable lpddr2 board with
H9TKNNN4KDMPQR-NDM chip.

Signed-off-by: Anson Huang <b20788@freescale.com>
2011-10-11 20:13:38 +08:00
19b798d05f ENGR00158184 mx53 smd: use highest value for unknown board revision value
mx53 smd:  use highest value for unknown board revision value

Signed-off-by: Wayne Zou <b36644@freescale.com>
2011-09-26 17:42:19 +08:00
aae7b1d721 ENGR00157538 remove VDIG_PLL setting in plug-in code
According to the datasheet, VDIG_PLL needs to be increased
to 1.3v for TO2.0. This operation has been done in the
low_level_init.S. Remove the duplicated code here.

Signed-off-by: Lily Zhang <r58066@freescale.com>
2011-09-23 21:04:43 +08:00
0ff764f10e ENGR00157468: Fix default environment's "mmc dev" type error
Some semicolons are missed after "mmc dev 0".
They need to be added to make default environment work.

Signed-off-by: Terry Lv <r65388@freescale.com>
2011-09-23 10:59:54 +08:00
3124e7e5d6 ENGR00157419: Correct default environment's mmc device in mx6q
Default environment in mx6q uses mmc device 0.
We should use mmc device 3.

Signed-off-by: Terry Lv <r65388@freescale.com>
2011-09-22 18:40:21 +08:00
c690577b6a ENGR00155569 mc34708: change global reset time as 4s of LOCO and PCBA
reduce the time of global reset to 4s in the boards of loco and pcba

Signed-off-by: Robin Gong <B38343@freescale.com>
2011-09-19 12:45:10 +08:00
e2c4083c4b ENGR00156670-2 MMC: Fixed some bugs in common code
Need to send RCA when sending CMD13.

Cannot use print_size function when displaying card capacity
because it expects a 32 bit integer as input, while mmc->capacity
is a 64 bit integer. There is loss of information leading to incorrect
capacities being displayed for "mmcinfo" cmd. Changed it to simply
print the entire 64 bit integer, which is the number of bytes.

Signed-off-by: Tony Lin <tony.lin@freescale.com>
Signed-off-by: Anish Trivedi <anish@freescale.com>
2011-09-13 18:32:07 -05:00
a77c6fec85 ENGR00156670-1 ESDHC/USDHC: Remove delay before each cmd and some bug fixes
Removed delay of 10 ms before each command. There should not be
a need to have this delay after the ENGR00156405 patch that polls
until card is not busy anymore before proceeding to next cmd.

Added poll on reset bits of controller after the bits are set to
wait until they clear before proceeding further.

Signed-off-by: Tony Lin <tony.lin@freescale.com>
Signed-off-by: Anish Trivedi <anish@freescale.com>
2011-09-13 18:32:07 -05:00
e436525a70 ENGR00156405 ESDHC: Add workaround for auto-clock gate errata ENGcm03648
The errata, not applicable to USDHC, causes ESDHC to shut off clock to
the card when auto-clock gating is enabled for commands with busy
signalling and no data phase. The card might require the clock to exit
the busy state, so the workaround is to disable the auto-clock gate
bits in SYSCTL register for such commands. The workaround also entails
polling on DAT0 bit in the PRSSTAT register to learn when busy state is
complete. Auto-clock gating is re-enabled at the end of busy state.

Signed-off-by: Anish Trivedi <anish@freescale.com>
2011-09-13 10:12:25 -05:00
ecee97c3ab ENGR00156389: turn off child clocks before reconfigure perclk_root
In addition to ensuring that PERCLK remains at least 2.5 times slower
than the AHB clock, certain steps need to be followed to ensure robust
operation of PERCLK when reconfiguring the PERCLK clock source.

To properly configure the PERCLK clock source, the following steps are
required:
1.In the CCGR registers, gate the clocks to all PERCLK-dependent
  modules.
2.Select the desired input clock for the PERCLK root clock (to be either
  source from the peripherals main source clock or the
  lp_apm clock source). Refer to the CMCBR register,
  perclk_lp_apm_sel bit.
3.Configure the perclk_pred1, perclk_pred2, and perclk_podf dividers
  to the desired setting.  Refer to the CBCDR register for details.
  4.In the CCGR registers, enable the desired clocks for the
  PERCLK-dependent module clocks.

Certain steps are required to reconfigure perclk_root.
If don't follow these steps, GPT timer may stop and the kernel stops
at " "Calibrating delay loop".

Signed-off-by: Terry Lv <r65388@freescale.com>
2011-09-13 13:31:42 +08:00
9a8d22a4a4 ENGR00156304 eMMC: Need to update partition config after changing boot partition
After enabling boot partition on an eMMC using "mmc bootpart" command, the
partition configuration variable that is supposed to track this value on the
eMMC is not updated. This leads to stale and possibly inaccurate boot partition
number being printed when "mmcinfo" command is used, thereby confusing the user.

The fix is to update the part_config variable of mmc struct with the new value
that was just written to the eMMC.

Also removed condition that restricted boot_bus_width programming (for fastboot)
to eMMC with DDR support only. Now, even non-DDR capable eMMCs can be programmed
for fastboot (in SDR mode).

Signed-off-by: Anish Trivedi <anish@freescale.com>
2011-09-08 17:46:41 -05:00
3022105ecd ENGR00156098 mx53_smd/mx53_loco: DA9053 I2C SDA stuck low issue on bootup
For DA9053 I2C SDA stuck low issue: the I2C block in DA9053 may not correctly
receive a Power On Reset and device is in unknown state during start-up.
The only way to get the chip into known state before any communication
with the Chip via I2C is to dummy clock the I2C and bring it in a state
where I2C can communicate. Dialog suggested to provide 9 clock on SCL.
Dialog don't know the exact reason for the fault and assume it is because
some random noise or spurious behaviour.
This has to been done in host platform specific I2C driver during
start-up when the I2C is being configured at platform level to supply with
dummy 9 clock on SCL. Dialog I2C driver has no control to provide dummy 9
clock on SCL.

Signed-off-by: Wayne Zou <b36644@freescale.com>
2011-09-06 14:20:30 +08:00
aac855885f ENGR00156034: Fix mx53 evk build error
Fix mx53 evk build error.

Signed-off-by: Terry Lv <r65388@freescale.com>
2011-09-05 16:10:33 +08:00
799007675f ENGR00139254: Enable MX6Q Uboot Splash Screen
Only support LVDS0 splash screen.
	Enable splash process:
		1.define CONFIG_SPLASH_SCREEN in mx6q_sabreauto.h
		2.Config U-boot with followed command:()
			setenv splashimage '0x30000000'
			#Set splash position as Center
			setenv splashpos 'm,m'
			#Set LVDS via LVDS bridge 0
			setenv lvds_num 0

Signed-off-by: Sandor Yu <r01008@freescale.com>
2011-09-02 17:28:42 +08:00
7db399587f ENGR00155283: Set dpgdck0_2_en to 0 when freq is lower than 300MHz
1. Set dpgdck0_2_en to 0 when required freq is lower than 300Mhz.
2. When dpgdck0_2_en is 0, the formula to calculate output freq
will be changed to 2 * freq * [].

Signed-off-by: Terry Lv <r65388@freescale.com>
2011-09-01 13:57:21 +08:00
ea7a419958 ENGR00155279: Change ESDCTL_0x82228080 to ESDCTL_0x82226080 for mx35
In mx35, when testing TVIN, the screen will flick.
We find that flickers will get better when using ESDCTL_0x82226080
against ESDCTL_0x82228080 for register SCDCTL0.
The origin value ESDCTL_0x82228080 in lowlevel_init.S will be called in
external boot which will reduce the bandwidth.

Signed-off-by: Terry Lv <r65388@freescale.com>
2011-09-01 13:57:21 +08:00
5eced774fc ENGR00155739: mx53 evk mmu wrong mapped two csd slots
mx53 evk mmu wrong mapped two csd slots.
Actually evk only has one slot.

Signed-off-by: Terry Lv <r65388@freescale.com>
2011-09-01 13:47:05 +08:00
32429d7b46 ENGR00154666-4: Align u-boot mmc command with community
Change fastboot code for that fastboot uses mmc command to access card.
Thus the code need to be modified to new mmc command.

Signed-off-by: Terry Lv <r65388@freescale.com>
2011-09-01 11:45:02 +08:00
72ac6998a7 ENGR00154666-3: Align u-boot mmc command with community
This patch will enhance mmc command.
1. Add erase command.
2. Abandon dev_no in mmc command. User need to switch slot with "mmc
dev" command.
3. Add mmc part switch command. Enhance partition switch support.
4. Add mmc bootpart. Boot partition support is more flexible.

Signed-off-by: Terry Lv <r65388@freescale.com>
2011-09-01 11:45:02 +08:00
d187eb3675 ENGR00154666-2: Align u-boot mmc command with community
Trivial change to remove build warnings.

Signed-off-by: Terry Lv <r65388@freescale.com>
2011-09-01 11:45:02 +08:00
3d7fa1dc1c ENGR00154666-1: Align u-boot mmc command with community
Modifications on config files.
1. Remove CONFIG_BOOT_PARTITION_ACCESS.
2. Change all mmc read command in default env configs.

Signed-off-by: Terry Lv <r65388@freescale.com>
2011-09-01 11:45:02 +08:00
a9cced4ea2 ENGR00155284 mx53_smd: move I2C access to board_init_late for system hang issue
MX53 SMD hangs if reset many times with lower possibility.
If doing I2C access in early time, I2C may cause system hangs.
So moving I2C access to late phase to make system hang issue disappear.

QA Test result: QA raised 6 full rounds of CTS one-round test
Totally ran for 6 rounds about 27 hours, reboot for 56*6=336 times,
no reboot failure occurred.

Signed-off-by: Wayne Zou <b36644@freescale.com>
2011-08-31 17:13:04 +08:00
190451ad69 ENGR00155472 mx53_loco: support both of RevA and RevB in uboot
to fix we should amend systemrev in uboot, add new board RevB for it

Signed-off-by: Robin Gong <B38343@freescale.com>
2011-08-29 16:58:21 +08:00
e80a93cb9a ENGR00154672: Change to use rom plugins for mx53 boards
1. As customer required, we change to use rom plugins for mx53 boards.
Tested pass with latest mfg tools.
2. Update DDR3 script based on MX53_TO2_DDR3_LCB_SMD_ARDb_v2.inc.
Got from
http://compass.freescale.net/livelink/livelink?func=ll
&objId=221058910&objAction=browse&viewType=1.
3. Fix a tiny build error in mx53_smd.c.
This error will happen when building mx53_smd_mfg.

Signed-off-by: Terry Lv <r65388@freescale.com>
2011-08-29 16:38:43 +08:00
54d029c8dc ENGR00155240 mx53_smd: Fix a bug that hangs on printf() in board_init
remove printf() because serial interface is not ready in board_init()

Signed-off-by: Wayne Zou <b36644@freescale.com>
2011-08-23 17:54:34 +08:00
b5930b9696 ENGR00155133: Add sata support for imx6
Init clocks, phy and pll for sata.

Signed-off-by: Terry Lv <r65388@freescale.com>
2011-08-22 17:38:27 +08:00
b5b188c7f2 ENGR00151255 mx53 QS: Enable VUSB_2V5
Kernel stops at USB driver initialization if suspending,
resuming and resetting the board.
It's because VUSB_2V5 voltage is disabled after suspend.
Need to re-enable it mannually into U-boot

Signed-off-by: Lily Zhang <r58066@freescale.com>
2011-08-22 16:09:07 +08:00
4379503e39 ENGR00155156 [MX6]Clean up debug info in uboot
1. ENET don't need to enable ENET pll clock;
2. Enable cpu debug clock in case of using JTAG;
3. Clean up some debug info during bring up.

Signed-off-by: Anson Huang <b20788@freescale.com>
2011-08-22 15:33:56 +08:00
10ddb77641 ENGR00155138 mx53_smd/mx53_loco: Add i2c retry to fix DA9053 i2c NAK issue
when board boots up, during the iMX53 SOC does DA9053 Read/Write
operation, it writes slave address and wait for ACK . Instead of ACK
PMIC sends NAK. A workaround fix is provided as a part of retries to
fix I2C NAK for very first access.

Signed-off-by: Wayne Zou <b36644@freescale.com>
2011-08-22 10:45:25 +08:00
41a2678fec ENGR00155018 mx53_pcba: update Ripley AUX input to 950mA and charge current
set Ripley AUX input current limit to 950mA and
set charge termination current to 400mA

Signed-off-by: Wayne Zou <b36644@freescale.com>
2011-08-19 13:21:58 +08:00
01b45eb624 ENGR00154998 mx53 pcba: correct the default bootargs
Default boot up with the 7' LCD on.

Signed-off-by: Xinyu Chen <xinyu.chen@freescale.com>
2011-08-18 15:53:03 +08:00
7c6061fc2b ENGR00154924 [MX6]Disable some clocks in uboot
We should disabel some clocks in uboot to save
power, or when we download from enet to boot up
kernel, the power consumption could be up 800mA@5V,
may damage the chip.

After apply it, we can save more then 200mA@5V.

Signed-off-by: Anson Huang <b20788@freescale.com>
2011-08-17 13:09:34 +08:00
c7cf313a63 ENGR00154396: U_BOOT: Env config adjustment.
Change env size to 8K and change gpmi nand env offset to 2M.
This will reduce boot time and fix gpmi nand env problem.

Signed-off-by: Terry Lv <r65388@freescale.com>
2011-08-12 17:23:37 +08:00
2e0022e32a ENGR00154762 mx53_pcba: update Ripley/mc34708 USB/AUX charger settings
update Ripley USB and AUX/DC charger settings for pcba revB board

Signed-off-by: Wayne Zou <b36644@freescale.com>
2011-08-12 09:23:48 +08:00
2921bf50ea ENGR00154468 mx53 pcba: Add DC-IN power supply support for revB board
Add DC-IN power supply support for revB board when booting from EMMC.
set  both AUX&USB current limit to 1.5A for Ripley 2.1 only
Change CC current to 950mA

Signed-off-by: Wayne Zou <b36644@freescale.com>
2011-08-08 17:16:56 +08:00
6b654d7a58 ENGR00154400 mx53 pcba: bringup update for RevB board
Update DDR DCD configuration
Open all the clocks during boot
Change CV voltage to 4.2V

Signed-off-by: Weihua Zou <wayne.zou@freescale.com>
Signed-off-by: Xinyu Chen <xinyu.chen@freescale.com>
2011-08-05 16:17:31 +08:00
117b01ede4 ENGR00153761 imx6q ipuv3: improve display quality
to avoid ipu starvation issue.
1. enable IPU AXI cache in uboot
2. set Qos to 7 for IPU to highest priority in uboot.
3. set AXI id to 0 for high priority IDMA channel in linux.

Signed-off-by: Jason Chen <b02280@freescale.com>
2011-07-27 14:21:12 +08:00
7d0f757e13 ENGR00153759 mx51: fix fastboot build failed without boot partition macro
In mx51 configuration, CONFIG_BOOT_PARTITION_ACCESS is not defined.
This cause build error to fastboot.c

Signed-off-by: Xinyu Chen <xinyu.chen@freescale.com>
2011-07-27 14:05:02 +08:00
b6dadf2aab ENGR00153526 mx53 pcba: add pcba board revB support in uboot
Add new machine type for pcba.
Add UART, I2C, SD/MMC, PMIC, DDR initial support.
Add MFG tool support.
Add support for MC34708 on revB pcba board.
Update VDDGP setting on MC34708 PMIC for revB board.
Close unused clock, for fastboot it will enable usb_phy
usb_oh3 clock by itself, still need to verify this work
or not when revB bootup.

Signed-off-by: Wayne Zou <b36644@freescale.com>
Signed-off-by: Lily Zhang <r58066@freescale.com>
Signed-off-by: Jason Liu <r64343@freescale.com>
2011-07-27 10:21:01 +08:00
25f925214a ENGR00153605 fastboot: uboot cannot be burned to boot partition
uboot image cannot be burned to boot partition for eMMC 4.3. This
patch will fix it.

Signed-off-by: Sammy He <r62914@freescale.com>
2011-07-26 18:52:00 +08:00
e436084d53 ENGR00153597 [MX6]Enbale MMDC low power
Enable auto self-refresh of MMDC to save power
when memory idle.

Signed-off-by: Anson Huang <b20788@freescale.com>
2011-07-25 16:18:09 +08:00
9047937245 ENGR00143438 [MX50 RD3]DCDC_3V15 GPIO change
Change DCDC_3V15's GPIO setting for REV-D.

Signed-off-by: Anson Huang <b20788@freescale.com>
(cherry picked from commit 28a8e166c6a8fa001325f88ef06e5a81f6ed82a9)
2011-07-22 13:15:57 +08:00
6667da86ca ENGR00151310 mx53 smd: force warm reset as cold reset
This patch is used to support watchdog timeout in SMD RevA, RevB
board.
1. Revert "ENGR00143469 mx53 smd: pull down GPIO_9 to reset the
board".
2. Force warm reset as cold reset.

Signed-off-by: Lily Zhang <r58066@freescale.com>
2011-07-22 09:15:05 +08:00
8e05935d06 ENGR00151695 mx53 ddr3: update ESDREF and MR0
Updated mx53 ddr3 script according to MX53_TO2_DDR3_LCB_SMD_ARDb_v1.inc
from Michael J Kjar on July 8, 2011:
-change ESDREF[REF_SEL]=01 (for 32KHz), from incorrect setting of 00 (64KHz)
-change DDR3 MR0 write to "setmem /32 0x63fd901c = 0x052080b0" from
"0x092080b0". This chagned write recovery from 8 clocks to 6 clocks
(in line with ESDCFG1[tWR])

Signed-off-by: Lily Zhang <r58066@freescale.com>
2011-07-21 16:59:03 +08:00
5a323cf99c ENGR00152843 mx51/3: align the android default env with document
Use simple enviroment to implement the default boot command.
The original one is too complex, and not readable.
For MX51BBG, only SD card boot env is supportd by default.
For MX53SMD, only eMMC boot env is supportd by default.

Signed-off-by: Xinyu Chen <xinyu.chen@freescale.com>
2011-07-21 11:18:58 +08:00
cea9ea9324 ENGR00153394 mx50 rd3: make SDHC1 as default boot device for android
Drop NAND/SPI boot support.
Enable fastboot.

Signed-off-by: Xinyu Chen <xinyu.chen@freescale.com>
2011-07-20 17:34:03 +08:00
a958f00844 ENGR00152907 MX5X: update GPU default cmdline.
update default cmdline to align with Document.

Signed-off-by: Zhang Jiejing <jiejing.zhang@freescale.com>
2011-07-14 20:53:12 +08:00
7f9c464c6e ENGR00152755 MX6 Switch DRAM init script from plugin to DCD for emmc fastboot
ROM requires DCD table instead of plugin to initialize DRAM if emmc fastboot
mode is to be used. Therefore, switched the DRAM script from plugin to
DCD table. The DCD table created is based on the following RVD script:
Arik_init_DDR3_528MHz_002.inc found at
http://compass.freescale.net/livelink/livelink?func=ll&objId=222928845

When fastboot mode is used by ROM, the MMC_BOOT register of USDHC does not
get reset when RSTA bit is set by uboot driver. Therefore, need to write 0
to it manually during driver init. This brings USDHC out of fastboot mode,
allowing normal communication with emmc to proceed in uboot.

Changed comments for DLL delay to be more accurate.

Signed-off-by: Anish Trivedi <anish@freescale.com>
2011-07-06 17:14:46 -05:00
82102d3fde ENGR00139206 MX6 USDHC eMMC 4.4 support
New bit definitions in USDHC.
Added is_usdhc variable to fsl_esdhc_cfg to distinguish between ESDHC
and USDHC.
Enabled DDR mode support in USDHC.
Created a config to customize target delay for DDR mode.
Modified USDHC pad settings to make DDR mode work for all emmcs at 50 MHz.

Signed-off-by: Anish Trivedi <anish@freescale.com>
2011-07-05 14:28:09 -05:00
c2ee955784 ENGR00152439: MX51: PLL workaround should be implemented only for PLL1
Make sure the PLL workaround is done only for PLL1.

Signed-off-by: Ranjani Vaidyanathan <ra5478@freescale.com>
2011-07-01 10:13:27 -05:00
b214b6774f ENGR00152241 MX6: enable 1G speed mode for PHY and ENET
In precode, PHY forced to work at 100M even connect to
 1G switch.

In this commit, let PHY auto negotiate it working speed. Enet tx
work at store-and-forward mode.

BTW, AR8031 take quite a long time, about 1.6s from negotiation to link up.
we have to wait and then set ENET correctly.

Signed-off-by: Zeng Zhaoming <b32542@freescale.com>
2011-06-29 16:04:54 +08:00
3c5c5630bb ENGR00139198: iMX61 uBoot add ENET support
Add ENET and AR8031 PHY support to uboot.
To make it works on sabreauto, need do following changes:
1. rework phy to output 125M clock from CLK_25M signal,
   and the 125M clock input to SoC as reference clock to generate
   RGMII_TXC clock.
2. Enable TXC delay in PHY debug register.
3. set ENET working in RMII mode.
4. set ENET working at 1000M or 100M/10M.
5. set ENET TX fifo to maximum to avoid underrun error.
6. force AR8031 PHY working at 100M

Signed-off-by: Anson Huang <b20788@freescale.com>
Signed-off-by: Zeng Zhaoming <b32542@freescale.com>
2011-06-27 02:07:35 +08:00
15f996b62f ENGR00144424 MX6: enable uboot for ARM2(SABREAUTO) CPU board
Use 528M DDR script
Disable L2 cache because rom enable L2 cache when use plug-in
Fix usdhc pad settings
Remove mac address hardcode

Signed-off-by: Anson Huang <b20788@freescale.com>
Signed-off-by: Richard Zhu <r65037@freescale.com>
Signed-off-by: Terry Lv <r65388@freescale.com>
Signed-off-by: Anish Trivedi <anish@freescale.com>
Signed-off-by: Jason Liu <r64343@freescale.com>
2011-06-24 09:19:01 +08:00
88d03a4087 ENGR00151966: MX51 - Apply SW workaround for the PLL1 unlock HW issue.
Apply the following SW workaround to fix the PLL unlock issue.

1.Move all the clock sources which are currently running
  on PLL1 from PLL1 to PLL2
2.Clear AREN bit in PLL1 (to avoid restart during MFN change)
3.Program the PLL1 to the next settings:
a.      MFI = 8
b.      MFD = 179
c.      MFN = 180
d.      PLM = 1
4.Manually restart the PLL1
5.Wait to PLL1 to lock
6.Reprogram the PLL1 to the next settings:
a.      MFI = 60, others keep same
7.Load the MFN
8.Wait for LDREQ and delay ~4.6us
9.Switch the clocks which were previously moved from PLL1 to PLL2 back to PLL1

Signed-off-by: Ranjani Vaidyanathan <ra5478@freescale.com>
2011-06-22 18:16:20 -05:00
65317a185c ENGR00151892 MX50: Workaround to prevent PLL1 from losing lock
PLL1 workaround to prevent it from losing lock:
(1) Disable AREN bit to avoid PLL1 restart during MFN change
(2) set PLL1 to ~864Mhz with MFI = 8, MFN = 180, MFD = 179, PDF = 0
(3) Manual restart PLL1
(4) Wait PLL1 lock
(5) Set PLL1 to 800Mhz with only change MFN to 60, others keep
(6) Set LDREQ bit to load new MFN
(7) Poll on LDREQ bit for MFN update to be completed
(8) Delay at least 4 us to avoid PLL1 instability window
(9) Switch ARM back to PLL1

Signed-off-by: Anish Trivedi <anish@freescale.com>
2011-06-21 13:38:47 -05:00
de7bbfa11e ENGR00151187 MX53 SMD: Kernal stopped Usb driver after reseting in stop mode
After reseting in stop mode, the VUSB_2V5 voltage is disable by pmic.
It needs to be enable manually in u-boot.

Signed-off-by: Wayne Zou <b36644@freescale.com>
2011-06-10 10:18:06 +08:00
4a4da8081f ENGR00144224: MX53: Add MMU mapping for all peripherals
Not all peripherals are mapped in MMU.
Thus we add those missed mapped area.

Signed-off-by: Terry Lv <r65388@freescale.com>
2011-06-09 15:36:38 +08:00
13d0cc1e75 ENGR00144389 mx53 QS Ripley: change VCC from 1.35V to 1.3V QS Ripley board
Change VCC from 1.35V to 1.3V QS Ripley board

Signed-off-by: Wayne Zou <b36644@freescale.com>
2011-06-01 18:42:01 +08:00
d3c4b52933 ENGR00144060 MX53_SMD: recovery android, update recovery command for emmc.
Change the recovery boot for MX53_SMD to emmc 's device 1.

Signed-off-by: Zhang Jiejing <jiejing.zhang@freescale.com>
2011-05-26 17:18:58 +08:00
0d418b4c3f ENGR00143837 mx50 rd3: support android boot from RD3 NAND device
Enable NAND gpio, recovery mode detect after boot from spi nor.
Change default env for loading kernel and uramdisk from NAND,
disabling elcdif lcd driver to support EPDC eink panel as default.
Enable recovery mode support and NAND/UBI/UBIFS command.

Signed-off-by: Xinyu Chen <xinyu.chen@freescale.com>
2011-05-23 14:36:46 +08:00
314c603303 ENGR00143704: U_BOOT: Nand oobsize is wrong in some nand chips
Nand oobsize is wrong in some nand chips.

Signed-off-by: Terry Lv <r65388@freescale.com>
2011-05-20 13:31:11 +08:00
b495365cdb ENGR00143298: Reinit uart after using clk command
For clk command always make console output mess characters,
here we reinitilize it after clock is changed.

Signed-off-by: Terry Lv <r65388@freescale.com>
2011-05-20 13:29:51 +08:00
ecea7efd8a ENGR00143302 Add mc34708 pmic support on loco/Ripley board
Add mc34708 pmic support on loco/Ripley board

Signed-off-by: Zou Weihua -wayne zou <b36644@freescale.com>
2011-05-20 12:53:34 +08:00
8cb28bb7c7 ENGR00143570 mx53: change the default environment setting
Change the default environment setting as sd boot for mx53
loco, mx53 smd and mx53 ard boards.

Signed-off-by: Lily Zhang <r58066@freescale.com>
2011-05-19 22:53:43 +08:00
9b65f0a17d ENGR00143613 uboot: update the android ramdisk load address
update the ramdisk load address due to android kernel size enlarge.
the ramdisk memory load address is 5MB offset to kernel.

Signed-off-by: Xinyu Chen <xinyu.chen@freescale.com>
2011-05-18 17:11:48 +08:00
a966404abb ENGR00143469 mx53 smd: pull down GPIO_9 to reset the board
In mx53 smd, to type "reset" command in u-boot console can
not reset the system. It hangs in ROM with unknown reason.
This patch adds one workaround to configure GPIO_9 (WDT_OUTPUT_B)
as GPIO and pull down it to reset DA9053 PMIC.

Signed-off-by: Lily Zhang <r58066@freescale.com>
2011-05-16 20:26:37 +08:00
a13df91f7d ENGR00143461 mx51 evk: increase VDDGP as 1.1v for 800MHZ
The default VDDGP output voltage is 1.05V in mx51 evk board
According to mx51 datasheet (Rev 0.4), the VDDGP for 800MHZ
should be 1.1v for 800MHZ

Signed-off-by: Lily Zhang <r58066@freescale.com>
2011-05-16 19:25:12 +08:00
265932797c ENGR00143457: Don't let ROM copy .bss section
Don't need let ROM copy the .bss section since it
will all be zeroed by u-boot at start up, thus it
can speed up the boot up time.

Need add CONFIG_FLASH_HEADER_OFFSET to the size since
ROM will copy from the beginning of the MMC card.

Signed-off-by: Jason Liu <r64343@freescale.com>
2011-05-16 17:44:08 +08:00
ed95d51186 ENGR00143442 uboot: support android spi boot and mfg on mx50 rd3 board
Add mx50_rd3_android default config file
Add basic support for UBI partition mount and UBIFS file read for recovery
Add gpmi nand enable in MFG kernel commandline by uboot configure,
which enable MFG tool to flash system images on NAND.

The total NAND boot and NAND recovery has been disabled.
They will be enabled later.

Signed-off-by: Xinyu Chen <xinyu.chen@freescale.com>
2011-05-16 13:53:17 +08:00
6e1ca60b50 ENGR00143428 mx53 ard RevB: use internal clock for sata
Switch to use SATA internal clock in mx53 ARD RevB board.

Signed-off-by: Lily Zhang <r58066@freescale.com>
2011-05-14 16:06:15 +08:00
c53f846a0b ENGR00142995 MX50: Enable uSDHC instead of eSDHC for SDR mode
On SD3 on MX50, there is an option to choose eSDHC or uSDHC controller.
By default eSDHC is selected. However, eSDHC shows some borderline timing
in SDR mode at 50 MHz, whereas uSDHC shows borderline timing in DDR mode
at 50 MHz. Therefore, add a compile time option to uboot for MX50 to
select uSDHC in SDR mode or eSDHC in DDR mode on SD3 port.

By default the compile time option, CONFIG_MX50_ENABLE_USDHC_SDR,
is commented out in the include/configs/mx50_<board>.h file to
select eSDHC with DDR mode enabled. Uncomment the define to select
uSDHC with only SDR mode enabled.

Also increased max frequency supported by ESDHC to 52 MHz instead
of 50 MHz.

Signed-off-by: Anish Trivedi <anish@freescale.com>
2011-05-10 11:38:23 -05:00
6fc284a6a4 ENGR00143178 mx53 ARD DDR3 board: add MFG tool support
Add MFG tool support for MX53 ARD DDR3 board.

Signed-off-by: Lily Zhang <r58066@freescale.com>
2011-05-10 13:29:58 +08:00
3d57bf4811 ENGR00142740 mx50 rdp: mfg support GPMI nand by command line
As android make UBIFS as default file system on MX508 RDP,
we must enable MFG tool to support UBIFS image update.
So enable GPMI nand in default commandline to detect nand devices.

Signed-off-by: Xinyu Chen <xinyu.chen@freescale.com>
2011-04-29 14:41:47 +08:00
c72f6c9bb9 ENGR00142497 Android: MX53_SMD: check eMMC and SD recovery file.
Check eMMC and SD cards recovery file, if it exist, enter recovery mode.

original code only check SD card, since we already change main storage
to eMMC, so we check it both, since most of customer still test it under
SD card, check them to avoid support effert.

Signed-off-by: Zhang Jiejing <jiejing.zhang@freescale.com>
2011-04-22 17:49:24 +08:00
2b7f1cffc6 ENGR00142322: mx53-smd: spi nor: can't erase 0x200000 size
Spi nor can't erase 0x200000 size.
There are two issues in this CR.
1. Spi nor can't erase 0x200000 size.
2. Whole chip erase don't work.

The solution will be:
1. Delay more time for WIP check.
2. Use normal erase for whole chip erase.

Signed-off-by: Terry Lv <r65388@freescale.com>
2011-04-20 18:09:05 +08:00
ba8a0db66a ENGR00141885: mx50 and mx53 reboot fail when booting from spi nor
mx50 reboot fail when booting from spi nor.
Reconfigure eCSPI SS signal as GPIO before reset.

Signed-off-by: Terry Lv <r65388@freescale.com>
2011-04-20 14:44:37 +08:00
dd4e712ba7 ENGR00142259 set UART2_RXD (GP6_11) to high
Isolate EIM signals and boot configuration signals.
Without this setting, the chip's temperature will be high.

Signed-off-by: Robby Cai <R63905@freescale.com>
2011-04-18 15:31:14 +08:00
1396e7e5fc ENGR00142247 MX50: Add PD+3 routine for all DDR types
PD+3 routine help test pass for ddr with higher freq.

Tested on
ARM2 board (mDDR, DDR2)
RDP board (LPDDR2 from both vendors)
RD3 board (LPDDR2)

Signed-off-by: Robby Cai <R63905@freescale.com>
2011-04-16 14:19:34 +08:00
6d20b6a742 ENGR00142246 MX50 Update DDR2 script to use more optimized settings
New DDR2 initialization script from designer includes
controller changes as well as very important PHY changes that increase
internal sampling window to detect DQS edge. This increase
compensates for possible jitter.

The script, Codex_DDR2_266MHz.inc v3, is found at
http://compass.freescale.net/livelink/
livelink?func=ll&objId=218722501&objAction=browse&viewType=1

Also corrected the DDR clock. (DDR mode changed from Sync to Async)

Signed-off-by: Robby Cai <R63905@freescale.com>
2011-04-16 14:09:05 +08:00
9576d798ae ENGR00141335-3: Add CONFIG_EMMC_DDR_PORT_DETECT to mx53 and mx50config files
Add CONFIG_EMMC_DDR_PORT_DETECT to mx53 and mx50 config files.

For fastboot, please note that the bit width of card should match the
dip settings.
For example, if mmcinfo shows eMMC 4.4 card is 8Bit DDR, then dip
settings should be 8bit DDR. Then fastboot can work. Otherwise, fastboot
will fail.

Signed-off-by: Terry Lv <r65388@freescale.com>
2011-04-11 12:52:12 +08:00
e8bbf29eac ENGR00141335-2: get more accurate ipg_per clock frequency
Add perclk_lp_apm_sel check to function __get_ipg_per_clk.
This will get more accute clock frequency.

Signed-off-by: Terry Lv <r65388@freescale.com>
2011-04-11 12:48:40 +08:00
80426bc69f ENGR00141335-1: Use bypass way to set ddr dll in mx53
Usually dll setup for eMMC4.4 DDR is required to polling SLV_LOCK status
bit. However the system hangs when polling for SLV_LOCK bit.
The temporary workaround is to force slave override mode to bypass it.

Signed-off-by: Terry Lv <r65388@freescale.com>
2011-04-11 12:46:49 +08:00
1d230f43d3 ENGR00141556: Fix copyright issue
We're following the following rules:
1. FSL copyright should be added for freescale added and modified files.
2. FSL copyright should go after existing copyrights.
3. For Duplicate FSL copyright, Our copyright will go after that also.
4. FSL copyright should not include personal names as part.
5. For only FSL copyright, "All rights reserved" is not mattered.

Signed-off-by: Terry Lv <r65388@freescale.com>
2011-04-08 16:24:51 +08:00
76180b6276 ENGR00141410 MX50 RD3: Set GPIO4_16 to Enable DCDC_3V15
This is needed for FEC to work properly, since FEC3V15 is supplied by DCDC_3V15.

In addition, corrected the pin name for FEC_EN.

Signed-off-by: Robby Cai <R63905@freescale.com>
2011-03-31 17:31:17 +08:00
0f165488b2 ENGR00141363: change mx53 uart clk parent to pll2
Change all mx53 platform uart clk default parent to pll2.
MX53 SMD board need support LVDS and HDMI at the same time, they
may use the same clock parent-pll4, so kernel need change ipu di
clock parent to pll3, after that, uart clock parent need change
to pll2 to avoid console mess.

Signed-off-by: Jason Chen <b02280@freescale.com>
2011-03-31 15:30:23 +08:00
068bed0069 ENGR00141157: Add m25p32 spi nor config to mx53_smd_android
Add m25p32 spi nor config to mx53_smd_android.

Signed-off-by: Terry Lv <r65388@freescale.com>
2011-03-25 11:47:52 +08:00
b2660136cb ENGR00141129: Add m25p32 spi_nor support for mx53_smd
Add m25p32 spi_nor support for mx53_smd.

Signed-off-by: Terry Lv <r65388@freescale.com>
2011-03-24 19:52:21 +08:00
cd0cf0ce16 ENGR00141058 MX50_RDP: Android Fix typo in recoevry command line
A typo is in last commit, will cause android recovery not
work.

Add a space between two string.

Signed-off-by: Zhang Jiejing <jiejing.zhang@freescale.com>
2011-03-23 20:34:06 +08:00
76562a907c ENGR00141000 MX50_RDP: add android recovery support.
Add android recovery related config and code.

Signed-off-by: Zhang Jiejing <jiejing.zhang@freescale.com>
2011-03-23 16:34:59 +08:00
398b6f66ea ENGR00140537 mx53: update vddgp according to new data sheet
mx53: update vddgp according to new data sheet

Signed-off-by: Zhou Jingyu <Jingyu.Zhou@freescale.com>
2011-03-23 09:59:37 +08:00
33e33116c2 ENGR00140982 MX53 Increase VDDGP to 1.25V for 1 GHz
MX53 TO 2.0 requires 1.25V for VDDGP instead of 1.2V
in order for the core to operate at 1 GHz.

Signed-off-by: Anish Trivedi <anish@freescale.com>
Signed-off-by: Zhou Jingyu <Jingyu.Zhou@freescale.com>
2011-03-22 16:40:28 -05:00
aa8e453c66 ENGR00140872 Add MX50 RD3 Support
Assembled With new PMIC chip - MC34708 (Ripley),
and new SPI NOR - M25P32 as well.
Add new config file for RD3.

Signed-off-by: Robby Cai <R63905@freescale.com>
2011-03-22 10:56:32 +08:00
682e2a17a1 ENGR00140873: MMC may wrongly regconize 2GB eMMC as high capacity
MMC driver may wrongly regconize some 2GB eMMC as high capacity card.

This patch is picked from community.

A non-zero value of SEC_COUNT does not indicate that the card is sector
addressed. According to the MMC specification, cards
with a densitygreater than 2GiB are sector addressed.

Signed-off-by: Terry Lv <r65388@freescale.com>
2011-03-21 13:59:13 +08:00
ac48999b93 ENGR00140824 Android: Enable fastboot support for mx50 rdp
Enable fastboot support for mx50 rdp.

Signed-off-by: Sammy He <r62914@freescale.com>
2011-03-21 21:19:47 +08:00
32ab6b2785 ENGR00140825: Add mx53 to2.1 chip id recognition
Add mx53 to2.1 chip id recognition.

Signed-off-by: Terry Lv <r65388@freescale.com>
2011-03-20 14:11:07 +08:00
f48c8a0e50 ENGR00140486 Add SPI NOR Flash M25P32 driver
So far, it's supposed to be on MX50 RD3 and MX53 SMD

Signed-off-by: Robby Cai <R63905@freescale.com>
(cherry picked from commit 0e3d67cd1a2dc30af80e5119b626d997be254991)
2011-03-18 13:39:52 +08:00
5f1d08aefc ENGR00140767: Improve mx5x DDR clock function
As now mx51 DDR frequency is derived from PLL1.
We need to get DDR frequency from PLL1.

Mx53 don't use PLL1 for ddr clock source,
so just the precision is adjusted.

Mx50 don't support clk command yet.
DDR config function is modified according to
mx50 spec, but not tested yet.

Signed-off-by: Terry <r65388@freescale.com>
2011-03-17 17:58:02 +08:00
a7b2f005d5 ENGR00140750 mx53smd: set the default DDR size to 512MB for android configure
Decrease the default DDR size to 512MB in the default android
uboot configuration file. This can align with most customers'
hardware design, and help us to find more issues before release.

Signed-off-by: Xinyu Chen <xinyu.chen@freescale.com>
2011-03-17 11:46:23 +08:00
e015742a17 ENGR00140692 Update for DDR3-based MX53 SABRE Auto boards
Added a new config file, the DDR setup is similar to the MX53 Quick
Start & MX53 SABRE-Tablet ref design boards.

Signed-off-by: Mahesh Mahadevan <r9aadq@freescale.com>
2011-03-16 18:54:23 +08:00
dfa06f5cc1 ENGR00140089 MX53_SMD: update command line.
1. update new style ldb per kernel update.
2. update the default boot command is from eMMC

Signed-off-by: Zhang Jiejing <jiejing.zhang@freescale.com>
2011-03-14 19:18:50 +08:00
efe14fe5ca ENGR00138533: Fix sata write operation random failure issue
Parameter of calling to memalign is wrong.
Thus need to modify it.

Signed-off-by: Terry Lv <r65388@freescale.com>
2011-03-02 14:56:26 +08:00
0e5060fb16 ENGR00139747: Read fuse to distinguish between mx53 revA and revB
Read fuse to distinguish between mx53 revA and revB.

Now SoC efuse is used for board id.
Thus we now check fuse value for board rev and id.

Signed-off-by: Terry Lv <r65388@freescale.com>
2011-03-02 14:56:26 +08:00
d9e9aa9d87 ENGR00139924 mx53 smd &loco: set bootup vdd GP to 1.2v
set bootup vdd GP to 1.2v for mx53 smd &loco

Signed-off-by: Zhou Jingyu <Jingyu.Zhou@freescale.com>
2011-03-01 10:53:27 +08:00
5cdb2bc56b ENGR00139120: Correct CONFIG_CMD_MMC to CONFIG_CMD_IIM for iim
Correct CONFIG_CMD_MMC to CONFIG_CMD_IIM for iim.

Signed-off-by: Terry Lv <r65388@freescale.com>
2011-02-14 14:45:00 +08:00
d56b22a7f3 ENGR00138689 MX50 Update LPDDR2 script to use more optimized settings
New LPDDR2 initialization script from designer includes
controller changes as well as very important PHY changes that increase
internal sampling window to detect DQS edge. This increase
compensates for possible jitter.

The script, Codex_LPDDR2_266MHz.inc v7, is found at
http://compass.freescale.net/livelink/
livelink?func=ll&objId=218722501&objAction=browse&viewType=1

Also removed ARM2 LPDDR2 init section since the settings for that
board are the same as the RDP (EVK).

Signed-off-by: Anish Trivedi <anish@freescale.com>
2011-01-31 11:02:32 -06:00
c8087980af ENGR00138635 MX50 Update mDDR script to use more optimized settings
New mDDR (LPDDR1) initialization script from designer includes
controller changes as well as very important PHY changes that increase
internal sampling window to detect DQS edge. This increase
compensates for possible jitter.

The script, Codex_LPDDR1_200MHz.inc v4, is found at
http://compass.freescale.net/livelink/
livelink?func=ll&objId=218722501&objAction=browse&viewType=1

Signed-off-by: Anish Trivedi <anish@freescale.com>
2011-01-28 14:48:06 -06:00
a069e6b2ca ENGR00138549 Android fastboot: Support eMMC4.4 on imx53_smd
Support eMMC4.4 storage on imx53_smd android fastboot, using
environment to control it, the command is:
 > setenv fastboot_dev mmc1

Signed-off-by: Sammy He <r62914@freescale.com>
2011-01-28 01:16:58 +08:00
e5a0219ac0 ENGR00118558 MX51/MX53: change the boot command of android boards.
The android uImage is greater than 3M, so we need to change the
boot command.

Signed-off-by: Zhang Jiejing <jiejing.zhang@freescale.com>
2011-01-27 16:55:06 +08:00
9a215c39b6 ENGR00138534 Disable splashimage support defaultly for PDK
Disable splashimage support defaultly for MX51 BBG/MX53 SMD/
MX53 ARD platforms.

Signed-off-by: Liu Ying <Ying.Liu@freescale.com>
2011-01-26 18:06:31 +08:00
209829f344 ENGR00138422-3 Android fastboot: Pass block offset to cmd_fastboot
Pass mmc/sata block offset from fastboot driver to cmd_fastboot, not byte.

Signed-off-by: Sammy He <r62914@freescale.com>
2011-01-27 00:03:37 +08:00
c7c9adb7ec ENGR00138422-2 Add SATA storage support for android fastboot
Add SATA storage support for android fastboot.

Signed-off-by: Sammy He <r62914@freescale.com>
2011-01-26 03:29:33 +08:00
7541f71bc0 ENGR00138422-1 Fix usb connection failure if do sata init
Increase memory alignment to fix usb connection failure issue
if do sata init, and support MMU disable case in imx_udc driver.

Signed-off-by: Sammy He <r62914@freescale.com>
2011-01-26 03:29:25 +08:00
512a222c1f ENGR00138468-2 Enable splashimage support for several platforms
This patch enables splashimage support for MX53 SMD/ARD and
MX51 BBG pdk platforms.

Signed-off-by: Liu Ying <Ying.Liu@freescale.com>
2011-01-25 13:29:33 +08:00
e5f8360a5f ENGR00138468-1 MX5 video:Disable DP/DC/DI/IDMAC before go to kernel
This patch fixes the kernel bootup random hang issue by disabling
DP/DC/DI/IDMAC before we go to kernel. This is a workaround.

Signed-off-by: Liu Ying <Ying.Liu@freescale.com>
2011-01-25 11:54:03 +08:00
1990bcda98 ENGR00138390 android recovery, enlarge uImage size
Kernel image is bigger than 3M, the 0x1800 will not enough.

Signed-off-by: Zhang Jiejing <jiejing.zhang@freescale.com>
2011-01-24 13:55:24 +08:00
dbb5163f61 ENGR00138359 Change uramdisk from 6M byte offset of android fastboot
Change uramdisk from 6M byte offset of android fastboot due to
kernel image size more than 3M now.

Signed-off-by: Sammy He <r62914@freescale.com>
2011-01-22 01:33:13 +08:00
7d0d702b83 ENGR00138240 Disable splashimage support for PDK
Disable splashimage support for mx53 smd, mx53 ard
and mx51 bbg.

Signed-off-by: Liu Ying <Ying.Liu@freescale.com>
2011-01-20 12:31:42 +08:00
0f6e94be57 ENGR00138191 disable the SPLASH SCREEN for android
Disable for BBG and SMD

Signed-off-by: Xinyu Chen <xinyu.chen@freescale.com>
2011-01-19 17:03:45 +08:00
c633cc1cf6 ENGR00138148 MX53 TO2.0 EVK: change the default core as 1GHZ
Change the default core frequency as 1GHZ for MX53 TO2.0 EVK
board

Signed-off-by: Lily Zhang <r58066@freescale.com>
2011-01-18 23:18:53 +08:00
8191537566 ENGR00138040-3 Protect splashimage related stuffs by config
This patch protects splashimge related stuffs by config
option for mx51 bbg, mx53 ard and mx53 smd.

Signed-off-by: Liu Ying <Ying.Liu@freescale.com>
2011-01-17 13:58:44 +08:00
4f9c691a59 ENGR00138040-2 MX51 BBG Android:Support splashimage
This patch supports splashimage for MX51 BBG Android.

Signed-off-by: Liu Ying <Ying.Liu@freescale.com>
2011-01-17 13:56:49 +08:00
ff168f49d3 ENGR00138040-1 MX53 SMD Android:Support splashimage
This patch supports splashimage for MX53 SMD Android.

Signed-off-by: Liu Ying <Ying.Liu@freescale.com>
2011-01-17 13:48:40 +08:00
e6ed124f27 ENGR00137552 MX53: increase VDDGP as 1.2V for 1GHZ
The norminal voltage of VDDGP for 1GHZ is 1.2V in MX53
TO2.0 datasheet (RevD). So set the CPU frequency
as 800MHZ firstly since VDDGP is 1.1V after power on.
After increasing VDDGP as 1.2V, increase CPU as 1GHZ.

Signed-off-by: Lily Zhang <r58066@freescale.com>
2011-01-15 00:01:19 +08:00
0217e541ef ENGR00137894-6 MX53 SMD:Support splashimage
This patch supports to use pwm wave to control
backlight. The pwm rate is 20KHz and the pwm
duty is 50%. Only lvds panel is supported.
Use 'lvds_num' env variable to choose to use
lvds0 or lvds1. However, only lvds1 is tested
as the lvds cable cannot be plugged into lvds0
connector. Note that you need to add 'splashimage'
env variable to set the memory address of the
bmp image.

Signed-off-by: Liu Ying <Ying.Liu@freescale.com>
2011-01-14 15:40:20 +08:00
50a4b58d6a ENGR00137894-5 MX53 ARD:Support splashimage
This patch supports to use pwm wave to control
backlight. The pwm rate is 200Hz and the pwm
duty is 50%. Use 'lvds_num' env variable to
choose to use lvds0 or lvds1. Note that you
need to add 'splashimage' env variable to
set the memory address of the bmp image.

Signed-off-by: Liu Ying <Ying.Liu@freescale.com>
2011-01-14 15:40:19 +08:00
e9f41e7386 ENGR00137894-4 IPUv3 FB: IPUv3 FB driver enhancement
1) Change MX51 related function names to IPUv3 related names.
2) Change MX51 related comments to IPUv3 related comments.
3) Do not set panel_info.cmap to be NULL pointer.

Signed-off-by: Liu Ying <Ying.Liu@freescale.com>
2011-01-14 15:40:19 +08:00
d6bdab7e52 ENGR00137894-3 IPU driver enhancement
1) Remove MX51 related comments in ipu drivers.
2) Add di clocks.
3) Support pixel clock being deprived from external clock.

Signed-off-by: Liu Ying <Ying.Liu@freescale.com>
2011-01-14 15:39:42 +08:00
b695e1012b ENGR00137894-2 MX53: Add ipu base addr and ipu clock
This patch adds ipu base address and ipu clock.

Signed-off-by: Liu Ying <Ying.Liu@freescale.com>
2011-01-13 11:03:10 +08:00
600bfa886f ENGR00137894-1 Add imx pwm driver support
This patch adds imx pwm driver support as
a misc device.

Signed-off-by: Liu Ying <Ying.Liu@freescale.com>
2011-01-13 10:58:46 +08:00
427e23348e ENGR00137791 MX53: Update for MFG tool
- Add MFG tool support for MX53 SMD and MX53 LOCO
  boards
- Update mx53 ARD MFG defconfig to pass compile

Signed-off-by: Lily Zhang <r58066@freescale.com>
2011-01-11 20:54:52 +08:00
9b11775855 ENGR00137358: Add saving environment to sata device support
Add saving environment to sata device support.

Signed-off-by: Terry Lv <r65388@freescale.com>
2011-01-11 20:28:25 +08:00
84d9443bc4 ENGR00136869: SATA device can't init and a typo in sata help
SATA device can't init and a typo in sata help.
Add delay in sata detect proceduce.

Currently, I have met 3 problems for this issue.
1. Seagate HD. It needs 1000 for timeout.
2. Hitachi HD. It needs 10000 for timeout.
3. In sata env case, it needs 100000 for timeout.

10000000 for timeout is just to avoid a dead loop,
And suppose this timeout should be enough for all normal
case.
It doesn't mean all HD need to wait this long time,
If tfd is ok, the loop will be breaked immediately.

Signed-off-by: Terry Lv <r65388@freescale.com>
2011-01-11 20:24:10 +08:00
6392691301 ENGR00137841 splashimage:Correct horizontal display position
When we use splashpos command to set the display position
of a bmp image, the x value means the number of pixels
from the left boundary of the screen, so we should consider
the bits of every pixel when we calculate fb address offset.

Signed-off-by: Liu Ying <b17645@freescale.com>
2011-01-11 13:58:58 +08:00
3450d11f4b ENGR00137767 IPUv3 video:Support splashimage with MMU disabled
This patch corrects the fbi->screen_base value and fbi->fix.smem_start
value when MMU is disabled.

Reported-by: Terry Lv <r65388@freescale.com>
Signed-off-by: Liu Ying <b17645@freescale.com>
2011-01-10 13:48:28 +08:00
724822b8c5 ENGR00137766 BBG splashimage:Allocate cmap for panel_info
This patch allocates cmap for panel_info, otherwise,
cmap_base in common/lcd.c will be NULL pointer.

Signed-off-by: Liu Ying <b17645@freescale.com>
2011-01-10 10:40:43 +08:00
34b78f4a60 ENGR00137713 MX53 Uboot SMSC Fix order in which mac addr bytes are read from IIM
Given that an example mac addr is 00-11-22-33-44-55,
it should be fused into the IIM at the following locations:

0xC24 - 00
0xC28 - 11
0xC2C - 22
0xC30 - 33
0xC34 - 44
0xC38 - 55

Then, when reading the bytes into a mac array, it should be read as follows:

mac[0] - 00
mac[1] - 11
mac[2] - 22
mac[3] - 33
mac[4] - 44
mac[5] - 55

Previously, it was read into the array in reverse order.

Signed-off-by: Anish Trivedi <anish@freescale.com>
2011-01-07 10:19:40 -06:00
0f1af95d25 ENGR00137603 Add mx53_smd_android config for android
Add mx53_smd_android config for android build.

Signed-off-by: Sammy He <r62914@freescale.com>
2011-01-08 00:28:37 +08:00
1fa596e19e ENGR00137604: Change PLL4 to 455MHz for mx53
Required by display to set ldb.
We need to set PLL4 to 455MHz.

Signed-off-by: Terry Lv <r65388@freescale.com>
2011-01-07 15:32:24 +08:00
5d92b32e22 ENGR00137642 MX53 Uboot Align DDR3 script for Loco and SMD boards
Changed the value of one register, offset 0x88, of the ESDCTL controller
to match the official script for the boards, entitled "MX53_TO2_DDR3_LCB.inc",
found at

http://compass.freescale.net/livelink/livelink/221435668/
MX53_TO2_DDR3_LCB.inc.txt?func=doc.Fetch&nodeid=221435668

The register value sets read delay lines. The change is minor.

Signed-off-by: Anish Trivedi <anish@freescale.com>
2011-01-05 12:11:47 -06:00
57c938c25c ENGR00137596 MX53 Uboot SMC911X driver needs to get mac addr from IIM
If the MAC addr read from the controller's ADDRH and ADDRL registers is
invalid, then try to read MAC address programmed in MX53's IIM.

Signed-off-by: Anish Trivedi <anish@freescale.com>
2011-01-05 10:06:52 -06:00
7c1313ce24 ENGR00137497-2 MX53: Add LOCO board support
Add MX53 LOCO board support
The following functions are tested in the board:
- Micro SD boot
- MMC/SD read/write.
- clk command
- fuse command

Signed-off-by: Lily Zhang <r58066@freescale.com>
2010-12-30 21:01:50 +08:00
f432474ef6 ENGR00137497-1 Import new mach-type header file
Import new mach-type header file for MX53 LOCO
board

Signed-off-by: Lily Zhang <r58066@freescale.com>
Acked-by: Lily Zhang <r58066@freescale.com>
2010-12-30 21:00:31 +08:00
5709f69b6f ENGR00136075 MX53: Add SMD board support
Add MX53 SMD support:
- Use DDR3 script for SMD board from Mike Kjar:
"Rita_init_LCB_CMOS.inc"
- Set the default CPU core frequency as 1GHZ.

The following functions are tested on SMD board:
- SD/MMC boot, read, write via SDHC1
- eMMC4.4 boot, read, write via SDHC3.
- SATA boot, read, write. To support SATA boot via internal
clock, please ensure the fuse "SATA_ALT_CLK_REF" was blown.
- FEC
- UART
- clk command
- iim command

Signed-off-by: Liu Ying <b17645@freescale.com>
Signed-off-by: Jason Chen <b02280@freescale.com>
Signed-off-by: Terry Lv <r65388@freescale.com>
Signed-off-by: Anish Trivedi <anish@freescale.com>
Signed-off-by: Lily Zhang <r58066@freescale.com>
2010-12-30 10:15:03 +08:00
f61132fec4 ENGR00137410 MX53 split board files into different folders
Split different MX53 board files into different folder.

Signed-off-by: Lily Zhang <r58066@freescale.com>
2010-12-29 11:36:15 +08:00
b189ab8e68 ENGR00136863-2: Fix mx53 CMD12 issue.
As in mx53 and lster socs, when using CMD12, cmdtype need to be set
to ABORT, otherwise, next read command will hang.

This is a software Software Restrictions in spec 29.7.8.

  For pre-defined multi-block read operation,
  i.e.,
  The number of blocks to read has been defined by previous
CMD23 for MMC, or pre-defined number of blocks in CMD53
for SDIO/SDCombo, or whatever multi-block read without abort
command at card side, an abort command, either automatic
or manual CMD12/CMD52, is still required by ESDHCV2 after the
pre-defined number of blocks are done, to drive the internal
state machine to idle mode.

  In this case, the card may not respond to this extra
abort command and ESDHCV2 gets Response Timeout.

  It is recommended to manually send an abort command with
RSPTYP[1:0] both bits cleared.

Signed-off-by: Terry Lv <r65388@freescale.com>
2010-12-29 10:42:50 +08:00
fb98f374aa ENGR00136863-1: Change mmc framework architecture.
Change mmc framework architecture.
Mainly for code clean and restructure.

Mainly merge our code with community code.
Based on commit 17b4c8e9eb.

Signed-off-by: Terry Lv <r65388@freescale.com>
2010-12-29 10:38:38 +08:00
17b4c8e9eb ENGR00137408: Add FAT32 support
Add FAT32 support.
The code is got from community.
Based on hash number 71aab09b2c.

Signed-off-by: Terry Lv <r65388@freescale.com>
2010-12-29 10:36:26 +08:00
07ce4f0a2f ENGR00137372 MX53: Switch back to use DCD and update DDR scripts
1. This patch is used to switch back to use DCD for flash header
instead of plug-in. This change request is due to the following
reasons:
1) U-boot community doesn't accept current plug-in solution when
upstreaming.
2) Plug-in isn't supported by MX53 ROM serial download mode.
No effective workaround is found now. To use the same code
base to support normal U-Boot and MFG tool better, adopt
DCD solution firstly.
3) Current MX53 DDR scripts don't exceed the length limitation
of DCD.

For MX53 TO2.0 EVK/ARM2 board, raise DDR frequency to 400MHZ after
VCC and VDDA voltages are raised as 1.3V.
Since ARM2 CPU2 board share the same script with EVK, delete ARM2
CPU2 config files. ARM2 CPU2 board can share the same bootloader
with EVK.

2. Update MX53 DDR2 scripts for TO1.0/TO2.0 EVK/ARD/ARM2 boards
The script "MX53_TO2_DDR2_EVK_ARD.inc" is located under
http://compass.freescale.net/livelink/livelink?
func=ll&objId=221058910&objAction=browse&viewType=1
This script is published by ATX and FIL team on Dec 16th, 2010

3. Update MX53 ARM2 CPU3 DDR3 script "MX53_TO2_DDR3_CPU3.inc"
under the same compass folder

Signed-off-by: Lily Zhang <r58066@freescale.com>
2010-12-28 10:22:33 +08:00
2205133fb6 ENGR00137390 UBOOT:NAND: BBT not found on MX53 board
BBT table can't be found on MX53 board, which is due to
that the BBT table flag has been written to the ECC area
which cause the BBT flag lost.

This patch also fix the BBT version not correct issue.

Signed-off-by: Jason Liu <r64343@freescale.com>
2010-12-27 20:29:32 +08:00
d0309988aa ENGR00137211 U-Boot MX5x: Incorrect GPL license header on files
Correct the GPL license

Signed-off-by: Xinyu Chen <xinyu.chen@freescale.com>
2010-12-22 15:51:47 +08:00
35d1e9fa81 ENGR00137273 uboot: update the android default env for 2.6.35 kernel
Change the ramdisk load address to loadaddr + 0x400000.
Add gpu_memory= kernel parameter.

Signed-off-by: Xinyu Chen <xinyu.chen@freescale.com>
2010-12-22 15:36:18 +08:00
09671e5897 ENGR00137214 MX50: Turn on ZQ calib config by default and fix hang problem
1) Turn on ZQ calib config by default in uboot.
2) Remove one problematic statement which can cause hang issue
3) Change comment style from ; to //

Signed-off-by: Robby Cai <R63905@freescale.com>
2010-12-21 17:27:47 +08:00
00bcc7e6fb ENGR00134068 MX51 BBG:Support CLAA WVGA splashimage
1) IOMUX/backlight support for CLAA WVGA LCD panel.
2) Add video mode for CLAA WVGA LCD panel.
3) Support IPU di1 interface for framebuffer.
4) Enhance IPU driver.
5) Add freescale 600x400 8BPP BMP logo.

Signed-off-by: Terry Lv <R65388@freescale.com>
Signed-off-by: Liu Ying <b17645@freescale.com>
2010-12-16 09:58:44 +08:00
dca35697e3 ENGR00133727: uart outputs messy code when kernel starts on mx51
uart outputs messy code when kernel starts on mx51.
Change uart clock to use pll2 as source clock.

Signed-off-by: Terry Lv <r65388@freescale.com>
2010-12-14 17:20:40 +08:00
bb24c00fe0 ENGR00136038: Remove config CONFIG_EMMC_DDR_MODE
1. As we can check DDR dynamically,
remove CONFIG_EMMC_DDR_MODE in mmc.c.
2. Add config CONFIG_EMMC_DDR_PORT_DETECT
config for some boards that only some board support DDR.

Signed-off-by: Terry Lv <r65388@freescale.com>
2010-12-10 17:52:42 +08:00
2f12abe429 MX51: Add video support
Add framebuffer driver for the MX51 processor
working on the IPUv3 internal graphic processor.
The port is based on the driver found in the kernel
delivered by Freescale as part of i.MX BSP:

[kernel 2.6.31 commit cc4fe714041805997b601fe8e5dd585d8a99297f]

[agust@denx.de: some style fixes and dead code removal]
Signed-off-by: Stefano Babic <sbabic@denx.de>
Signed-off-by: Anatolij Gustschin <agust@denx.de>
(cherry picked from commit 5dda7945d1)
2010-12-10 10:23:33 +08:00
8a141e2f9c MX51: Add IPU driver for video support
The patch is a porting of the IPU Linux driver
developed by Freescale to have framebuffer
functionalities in u-boot. The port is based on
kernel 2.6.31 commit cc4fe714041805997b601fe8e5dd585d8a99297f,
as delivered by Freescale [i.MX BSP].
Most features are dropped from the original driver and
only LCD support is the goal of this porting.

Signed-off-by: Stefano Babic <sbabic@denx.de>
(cherry picked from commit 575001e40c)
2010-12-10 10:23:32 +08:00
f6fe7fe0cf Add linux framebuffer header include/linux/fb.h
[port of linux 2.6.34 commit 6a9ee8af344e3bd7dbd61e67037096cdf7f83289]

Signed-off-by: Stefano Babic <sbabic@denx.de>
(cherry picked from commit bf90ecd3c3)
2010-12-10 10:23:32 +08:00
7fca1defb1 ENGR00136170 MX50 Add ZQ calibration revision for TO1.1
All type of DDRs will be affected.
ddr script is available here:
http://compass.freescale.net/livelink/livelink/open/218722501

Two key points:
1. LPDDR2 ZQ calibration is different from mDDR/DDR2,
   fixed in this version(they're same before).
2. TO1.1 ZQ calibration is _NOT_ compatible with TO1.0.
   U-Boot default config is for TO1.1.
   Please switch off CONFIG_ZQ_CALIB option if compile for TO1.0.

Other fixes:
1. Change drive strength to 0x00200000 for all ddr types.
2. Add missed config for IOMUXC_SW_PAD_CTL_PAD_DRAM_OPEN and
   IOMUXC_SW_PAD_CTL_PAD_DRAM_OPENFB.

Signed-off-by: Robby Cai <R63905@freescale.com>
2010-12-09 20:39:55 +08:00
35d3bb2e01 ENGR00136081 DDR script update for MX53 TO2 ARD
Updated DDR2 script for ARD board from Mike Kjar:
"mx53_init_TO2_DDR2_ARD_test.inc".

Tested on TO1 and TO2 ARD.

Signed-off-by: Dinh Nguyen <Dinh.Nguyen@freescale.com>
2010-12-08 10:10:50 -06:00
54b9db32ed ENGR00136042 Add ZQ calib config and update script for DDR2
script v2:
http://compass.freescale.net/livelink/livelink/219931536/
Codex_DDR2_266MHz.inc.txt?func=doc.Fetch&nodeid=219931536

Signed-off-by: Robby Cai <R63905@freescale.com>
2010-12-08 11:04:35 +08:00
14cf5e51d4 ENGR00136031 mfgtool: sync config file for mx50 rdp
Some configs for mx50 rdp is missed at mfg-tool firmware config file

Signed-off-by: Peter Chen <peter.chen@freescale.com>
2010-12-08 10:57:09 +08:00
70509be0d1 ENGR00134220-3 Fix the nand bad command issue
Now, uboot cmd_nand of mainline does not support 64-bit
address space, which means that currently nand command
can't access more than 4GB NAND address even when working on
more than 4GB NAND. For example,

MX51 U-Boot > nand read ${loadaddr} 100100000 1000
NAND read: device 0 offset 0x100000, size 0x1000
4096 bytes read: OK

The reason for not support 64-bit address space of nand cmd
is that it use ulong type for addr in file common/cmd_nand.c,
but which is 32-bit width on arm gcc tool chain.

So, it will stuck in infinite loop when working with 4GB NAND
using nand bad command when off overflow.

ulong off; //off - 32bit, typeof(nand->size) is ull;
for (off = 0; off < nand->size; off += nand->erasesize) {
	...
}

Simply break the for loop when off overflow is temp fix.

Signed-off-by: Jason Liu <r64343@freescale.com>
2010-12-07 15:34:06 +08:00
bbce7d8adb ENGR00134220-2 Need use CONFIG_SYS_NAND_MAX_CHIPS
Need use CONFIG_SYS_NAND_MAX_CHIPS instead of
NAND_MAX_CHIPS

Signed-off-by: Jason Liu <r64343@freescale.com>
2010-12-07 15:34:02 +08:00
d509a05697 ENGR00134220-1 NAND: fix up the chip select handling
When the NAND has multi-cs, the chip select other than
cs0 is not handled correctly which will lead to NAND not
function as expected

Signed-off-by: Jason Liu <r64343@freescale.com>
2010-12-07 15:33:56 +08:00
298e4cf683 NAND: Update to support 64 bit device size
This patch adds support for NANDs greater than 2 GB.
Patch is based on the MTD NAND driver in the kernel.

Signed-off-by: Sandeep Paulraj <s-paulraj@ti.com>
Signed-off-by: Scott Wood <scottwood@freescale.com>
2010-12-03 11:01:15 +08:00
d47b8248f3 ENGR00133744: Merge mx50_arm2 to mx50_rdp
Merge mx50_arm2 to mx50_rdp.

Signed-off-by: Terry Lv <r65388@freescale.com>
2010-12-01 18:29:40 +08:00
a3654e9f36 ENGR00025557: MX50 Add ZQ calibration support for TO1.1.1.
MX50 Add ZQ calibration support for TO1.1.1.
This need to be enabled by CONFIG_ZQ_CALIB.

Signed-off-by: Terry Lv <r65388@freescale.com>
2010-12-01 18:02:08 +08:00
2fc4fafc0d ENGR12345678 Change ddr write delay in the PHY
Total 5 registers:
0x1400023c/244/24c/254/25c: from 0x000a1401 to 0x000a0b01

Without this patch, kernel on RDP board with Elpida DDR
is not able to boot, or not stable.

Signed-off-by: Robby Cai <R63905@freescale.com>
2010-12-01 18:02:08 +08:00
48457509cd ENGR00133437 MX50 Uboot support for TO 1.1.1 precode
Precoding: Update DDR configuration plugin to check SI Rev
 and change ROM addresses as needed.

Signed-off-by: Anish Trivedi <anish@freescale.com>
2010-12-01 18:02:07 +08:00
7a9a5e1d91 ENGR00133579 Uboot ESDHCv3 Remove workaround for DLL
On MX50 TO 1.0, DLL did not work in slave mode, so
slave override mode was used instead. Removed this
workaround, except for TO 1.0. Starting with TO 1.1,
the DLL in slave mode is working as expected.

Signed-off-by: Anish Trivedi <anish@freescale.com>
Signed-off-by: Terry Lv <r65388@freescale.com>
2010-12-01 18:02:07 +08:00
7a047737bd ENGR00134098-2 MX53: Add fastboot support for android.
Add fastboot support for mx53 EVK android.

Signed-off-by: Sammy He <r62914@freescale.com>
2010-11-26 22:42:57 +08:00
f9c90ac371 ENGR00134098-1 MX51: Update fastboot usb init seq
Update fastboot usb init seq, and use defined macro for coding.

Signed-off-by: Sammy He <r62914@freescale.com>
2010-11-26 22:38:31 +08:00
3a13770bd0 ENGR00133124: Add nand support for mx50 rdp
Add nand support for mx50 rdp.

Signed-off-by: Terry Lv <r65388@freescale.com>
2010-11-18 18:30:59 +08:00
e8c198f66e ENGR00133551-2 Add fastboot driver support for android.
Add fastboot driver support for android. In this commit,
basic fastboot command is supported.
1) Reboot board
   >fastboot reboot
2) Get information of board, e.g, product name
   >fastboot getvar product
3) Download images in PC and flash to SD card
   >fastboot flash bootloader u-boot-no-padding.bin
   >fastboot flash kernel uImage
   >fastboot flash uramdisk uramdisk.img
   >fastboot flash system system.img
   >fastboot flash recovery recovery.img
Certainly, SD card must have been formatted as Android user
guider doc already.

Signed-off-by: Sammy He <r62914@freescale.com>
2010-11-19 00:20:21 +08:00
7496154e2f ENGR00133551-1 Add freescale usb udc support for i.mx51 platform.
Add imx_udc for usb gadget on i.mx51 platform.

Signed-off-by: Hu Hui <b29976@freescale.com>
Signed-off-by: Sammy He <r62914@freescale.com>
2010-11-18 00:57:49 +08:00
5c13c88973 ENGR00133689 MX51: set MC13892 charge output voltage as 4.2V
This patch is to set MC13892 charge regulator output voltage
as 4.2V. It fixes a typo error for chip check and makes TO3
VCC and VDDA voltages keep sync with the spec.

Signed-off-by: Lily Zhang <r58066@freescale.com>
2010-11-17 10:54:17 +08:00
a649f30326 ENGR00133756:UBOOT:NAND:Remove the 2G limitation from NAND driver
Remove the 2G limitation from NAND driver since currently kernel
can support more than 2GB NAND flash now. This commit will make
NAND driver rescan the whole NAND to create one BBT and store to
the last 4 blocks of the larger than 2GB NAND flash. This commit
will have no effect on the NAND which size is not larger than 2GB.

Signed-off-by: Jason Liu <r64343@freescale.com>
2010-11-16 17:00:16 +08:00
1054bbc78f ENGR00133743 Change code style of fastboot code to pass review-commits.
cmd_fastboot.c and fastboot.h cannot pass review-commits, this patch
only change code style to fix the errors, but not fixed all warnings.

Signed-off-by: Sammy He <r62914@freescale.com>
2010-11-17 00:06:31 +08:00
21f34664b9 Get common/cmd_fastboot.c and include/fastboot.h from omap uboot git.
The code realized common Android USB fastboot protocol.

The snapshot can be found of the link:
http://dev.omapzoom.org/?p=bootloader/u-boot.git;a=commit;
h=9c7c5d8ea2326bf8d2d0bfbe670455fb497eb053

Signed-off-by: Tom Rix <Tom.Rix@windriver.com>
Signed-off-by: Moiz Sonasath <m-sonasath@ti.com>
2010-11-16 23:13:12 +08:00
5992019f3f ENGR00132909 MX53 Uboot: Support for TO2
Support new DDR script entitled
"Rita_TO2_init_DDR2_CPU2_CMOS_TEST_CAL_v1.inc" for DDR2
boards including MX53 EVK, ARD, and ARM2 CPU2. These new settings
did not apply to TO1. Therefore, changed the DCD
for these boards to a plugin so that TO1 and TO2 can both
be supported using conditional execution of new DDR settings.

During bootup on TO2, DDR frequency is required to be below
400 MHz. Therefore, BOOT_CFG2[4] must be set to enable DDR at
333 MHz in ROM on all boards. Uboot determines silicon version
and for TO2 boosts the VCC and VDDA voltages to 1.3V, after
which the DDR frequency is also increased to 400 MHz.

This requirement meant that uboot does not calibrate PLL2
anymore until the voltage is increased. Removed the calibration
from lowlevel_init.S and from all mx53 include/configs files.
Also required that during config_periph_clk(), only CBCMR register
is touched to set source PLL. Other changes to CBCDR were removed.
Switching to PLL2 bypass clk during reprogram was also removed.
All these changes are required to increase DDR frequency to 400 MHz.

DDR2 CPU2 board with TO1 requires the following hw cfgs:
JP3 populated, and J8 set to 2-3.
For DDR2 CPU2 board with TO2, both these jumpers should be
depopulated.

ARM2 CPU3 (with DDR3) DDR configurations were not changed.
TO1 and TO2 can run well using existing DDR3 script. However,
DCD was converted to plugin to align with other boards.

Signed-off-by: Anish Trivedi <anish@freescale.com>
2010-11-15 10:09:07 -06:00
2cbb0e33bd ENGR00133530 plug-in support mfgtools and sb_loader
mfgtools and sb_loader can download plug-in and run plug-in
to initilize DRAM.

Signed-off-by: Frank Li <frank.li@freescale.com>
2010-11-09 19:13:11 +08:00
8916b65502 ENGR00133049 Support nand flash for MX28
Support nand basic read/write in MX28 u-boot.

Signed-off-by: Frank Li <frank.li@freescale.com>
Signed-off-by: Terry Lv <r65388@freescale.com>
2010-11-04 18:57:46 +08:00
7906a1ae50 ENGR00132965 add MT29F16G08ABACA NAND description
Add MT29F16G08ABACA NAND description

Signed-off-by: Lily Zhang <r58066@freescale.com>
2010-10-26 14:34:32 +08:00
6a8d78074c ENGR00132957 mfg-tool: should add stop usb operation for mx50 rdp
It should add stop usb operation for mx50 rdp,
otherwise, the usb enumeration at kernel will be very slow

Signed-off-by: Peter Chen <peter.chen@freescale.com>
2010-10-26 09:18:30 +08:00
7f1800ec9f ENGR00132886 mx50-rdp: add mx50 rdp board mfg-tool firmware defconfig
Add mx50 rdp board mfg-tool firmware configration

Signed-off-by: Peter Chen <peter.chen@freescale.com>
2010-10-22 15:31:49 +08:00
ba5bcec0bb ENGR00132759 MX53: use 32K CLK as GPT source
MT29F16G08MAA NAND flash was failed on MX53 ARD/RevB
board, but it's fine in RevA board. After check, it's
found that udelay is not accurate on MX53 ARD/RevB
board because GPT uses IPG peripheral clock and assume it
is 50MHZ. However IPG peripheral clock is not 50MHZ in
MX53 ARD/RevB board. So it causes udelay is not accurate.
This patch changes GPT clk source as 32K to make udelay
accurate.

Signed-off-by: Lily Zhang <r58066@freescale.com>
2010-10-19 16:35:25 +08:00
73662d021d ENGR00132758 correct NFC_CLK definition
This patch is used to fix the issue caused by ENGR00132709.
NFC_CLK definition should be used in cmd_clk interface.
MXC_NFC_CLK should be used as internal clock name.

Signed-off-by: Lily Zhang <r58066@freescale.com>
2010-10-19 09:47:22 +08:00
6a49f94ff6 ENGR00132727 NAND: remove REG_NFC_ONE_CYCLE calling
Remove REG_NFC_ONE_CYCLE calling  from mxc_nand
driver.

Signed-off-by: Lily Zhang <r58066@freescale.com>
2010-10-18 20:43:54 +08:00
2f0524938f ENGR00132709 MX53: add "clk nfc" command support
Add "clk nfc" command support.
Limit NFC MAX clock as 34MHZ to be compatible with
some old NAND flashes.

Signed-off-by: Lily Zhang <r58066@freescale.com>
2010-10-18 16:30:33 +08:00
9bbe28258c ENGR00132617 MX53: add NAND support
Add NAND support for MX53 EVK and ARD.

Need to use kobs-ng to flash U-Boot on MX53 TO1. Because
MX51 TO1 ROM doesn't support bi swap solution and kernel
enable bi swap, Must enable "ignore bad block" option when
flashing U-Boot. The step is as following:
echo 1 > /sys/devices/platform/mxc_nandv2_flash.0/ignorebad
kobs-ng init --chip_0_device_path=/dev/mtd2 u-boot.bin
echo 0 > /sys/devices/platform/mxc_nandv2_flash.0/ignorebad

Since default configuration stores environment into SD
card and U-Boot uses get_mmc_env_devno (Read SBMR register)
to get MMC/SD slot information, you must insert SD card to
bottom SD slot to get/store environment if you are using NAND
boot on MX53 EVK.

You must config boot dip setting well when doing NAND boot.
For example, if you are using NAND 29F32G080AA NAND chip on
MX53 EVK, you can set boot dips as the following for NAND
boot: SW3: dip 7, 8 on; SW2: dip 3,5 on; SW1: dip 4,7,8 on.
Other dips are off.

Signed-off-by: Lily Zhang <r58066@freescale.com>
2010-10-17 18:04:52 +08:00
d63c74683a ENGR00132656 MX53 ARD: Add MFG tool support
Add default uboot defconfig for MX53 ARD MFG
tool

Signed-off-by: Lily Zhang <r58066@freescale.com>
2010-10-15 17:21:15 +08:00
43c5ab3e0b ENGR00132618 MX53 MFG:use serial_mxc as uart driver
Use serial_mxc as uart driver for MX53 MFG.
This change is required by ENGR00131779.

Signed-off-by: Lily Zhang <r58066@freescale.com>
2010-10-15 10:57:25 +08:00
6369db51d0 ENGR00132526 MX50 RDP Update to latest LPDDR2 script
Update uboot LPDDR2 init code with the following changes
 from latest script (v04) from Marek Xu:

http://compass.freescale.net/doc/220496654/Codex_LPDDR2_266MHz.inc.txt

1. Driver strength changed to 0x00180000 from 0x00200000
2. Memory type value changed to 0x04000000 from 0x02000000
3. New ZQ calibration entries with delay between load PU/PD and clear
4. Register at memory location 0x14000024 changed to 0x0048D005
from 0x0048EB05

Signed-off-by: Anish Trivedi <anish@freescale.com>
2010-10-13 10:55:55 -05:00
6691350254 ENGR00132014: nand read and write page may fail in some pages
nand read and write page may fail in some pages.

Signed-off-by: Terry Lv <r65388@freescale.com>
2010-09-28 11:22:57 +08:00
eb2a5695ba ENGR00131936 MX5X corrent mx53_evk mx51_BBG android default env setting
This change make a bootable default setting of MX53 EVK and MX51 BBG board,
the old default setting is too old to boot android system up.

Also add the recovery command in the env strings, if you want
to boot to recovery mode with mx53_evk, you can just :
> run bootcmd_android_recovery
This command will boot android into recovery mode.

Also fix MX51 can't see UI in recovery mode.

Signed-off-by: Zhang Jiejing <jiejing.zhang@freescale.com>
2010-09-26 18:45:44 +08:00
55019fc8ee ENGR00131924: using ext4 as default recovery filesystem
using ext4 as default recovery filesystem.

Signed-off-by: Terry Lv <r65388@freescale.com>
2010-09-25 15:46:09 +08:00
a604722168 ENGR00131840 MX53 ARD:use serial_mxc as uart driver
Use serial_mxc as uart driver for MX53 ARD.
This change is required by ENGR00131779.

Signed-off-by: Lily Zhang <r58066@freescale.com>
2010-09-22 11:13:33 +08:00
a8e2d7b371 ENGR00131691 MX50 RDP Uboot
Add support for building uboot for MX50 reference design platform:
1) LPDDR2 init script (v0.3 from Mike Kjar, dated 9/14)
2) iomux
3) new board file and machine id for RDP
4) Updates for iram boot on RDP

Signed-off-by: Anish Trivedi <anish@freescale.com>
2010-09-21 10:13:42 -05:00
359ec824c6 ENGR00131779: Use serial_mxc as uart driver for all platforms
Use serial_mxc as uart driver for all platforms.

Signed-off-by: Terry Lv <r65388@freescale.com>
2010-09-21 15:24:44 +08:00
f7af4ae4bb ENGR00131792: Fix mx50 lpddr2 build errors
Fix mx50 lpddr2 build errors.

Signed-off-by: Terry Lv <r65388@freescale.com>
2010-09-21 14:00:30 +08:00
e3a0a936b0 ENGR00131705-4 MX53: fix typo error for recovery
Fix typo error for MX53 recovery mode.

Signed-off-by: Lily Zhang <r58066@freescale.com>
2010-09-21 11:03:23 +08:00
e5cfeee784 ENGR00131705-3 Import new mach-type header file
Import new mach-type header file

Signed-off-by: Lily Zhang <r58066@freescale.com>
Acked-by: Rob Herring
2010-09-20 22:21:23 +08:00
8c2a96af77 ENGR00131705-2 Add MX53 ARD support
Add MX53 Automotive Reference Board (ARD) support
1. Add DDR2 initialization script
2. Add external ethernet support
3. Update PIN settings for UART, I2C, SDHC etc

Signed-off-by: Anish Trivedi <anish@freescale.com>
Signed-off-by: Terry Lv <r65388@freescale.com>
Signed-off-by: Lily Zhang <r58066@freescale.com>
2010-09-20 22:21:17 +08:00
ce931c240e ENGR00131705-1 rename mx53_evk folder as mx53_rd
Rename the folder "mx53_evk" as "mx53_rd" to put
all MX53 board files.

Signed-off-by: Terry Lv <r65388@freescale.com>
Signed-off-by: Lily Zhang <r58066@freescale.com>
2010-09-20 22:19:30 +08:00
e71b1b9ced ENGR00131662: Fix that iram boot don't work
iram boot don't work.
The reason is that ivt plugins copy too much data
than that iram can hold.

Signed-off-by: Terry Lv <r65388@freescale.com>
2010-09-20 13:25:43 +08:00
71ba5d3399 ENGR00131578: Add android recovery mode support for mx53
Add android recovery mode support for mx53.

Signed-off-by: Terry Lv <r65388@freescale.com>
2010-09-20 13:25:43 +08:00
6537dffd19 ENGR00127167: Add gpmi nfc and apbh dma support for mx50.
Add gpmi nfc and apbh dma support for mx50.

Signed-off-by: Terry Lv <r65388@freescale.com>
2010-09-19 23:25:21 +08:00
1e981afa60 ENGR00131712 UBOOT:add DDR2 support for IMX50
add DDR2 support for U-BOOT.

  The infomation about the init script:
  Date :	Aug-30,2010
  Author :	Tommy
  Version:	0.1

  please check :
  http://compass.freescale.net/doc/219931536/Codex_DDR2_266MHz.inc.txt

Signed-off-by: Huang Shijie <b32955@freescale.com>
2010-09-19 17:02:50 +08:00
e690b07341 ENGR00131619 UBOOT: Gcc 4.4.x complains weak inline
new toolchain with gcc 4.4.x get some compile error about:

board.c:
error: inline function 'red_LED_on' cannot be declared weak
error: inline function 'red_LED_off' cannot be declared weak

gcc 4.4.x not allow weak symbol be inline, remove inline.

Signed-off-by: Zeng Zhaoming <b32542@freescale.com>
2010-09-16 12:08:47 +08:00
daae245a54 ENGR00127368 UBOOT: Make the android recovery code common for platforms
Move the android recovery codes into common/recovery.c.
Cut the keypad detecting time. Now we only need detect
there's POWER and HOME key pressing at the time scanning
keyboard matrix. So user must hold these two keys when bootup to
enter recovery mode. This can reduce the uboot boot time with
recovery mode configured.

Later /cache file checking for recovery command should be merged
into the common/recovery.c

Signed-off-by: Xinyu Chen <xinyu.chen@freescale.com>
2010-09-10 17:23:18 +08:00
7bbe5d7a52 ENGR00126764 MX50: Set the memroy size to 512M on LPDDR2 board
Set the memroy size to 512M on LPDDR2 board

Signed-off-by: Jason Liu <r64343@freescale.com>
2010-08-27 16:31:08 +08:00
506fc144a3 ENGR00126566 MX50:Aligned LPDDR2 initialization to the latest script
Aligned LPDDR2 initialization to the latest script

Signed-off-by: Ranjani Vaidyanathan <ra5478@freescale.com>
Signed-off-by: Jason Liu <r64343@freescale.com>
2010-08-23 11:05:46 +08:00
61c38438cc ENGR00126474 UBOOT: update DDR script on MX50 ARM2
Update DDR script to latest according to the wiki page
http://wiki.freescale.net/pages/viewpage.action?pageId=25405083

Latest LPDDR1 (mDDR) init script can work with 200Mhz
(updated on 7/13): lpddr1_init_200MHz_size_shrink_MK.inc

Latest LPDDR2 init script can work with 266Mhz
(shrinked version and updated by Mike on July.7th):
lpddr2_init_266MHz_shrinked_tommy_MK.inc

Signed-off-by: Jason Liu <r64343@freescale.com>
2010-08-19 21:42:25 +08:00
220079eab5 ENGR00126079: Add clk command support for mx51
Add clk command  support for mx51.

Signed-off-by: Terry Lv <r65388@freescale.com>
2010-08-11 14:27:11 +08:00
5d7638868e ENGR00125237: Fix incorrect copyright info.
Fix incorrect copyright info.

Signed-off-by: Terry Lv <r65388@freescale.com>
2010-08-04 14:20:12 +08:00
70d1be1c21 ENGR00125324: Add splash screen code and support for epdc
Add splash screen code and support for epdc.

Signed-off-by: Terry Lv <r65388@freescale.com>
2010-08-03 16:35:23 +08:00
9da7bd8c3a ENGR00125757 mx28: change the boot mode offset to TO1.2 version
The boot mode offset has been changed in TO1.2.

Signed-off-by: Aisheng.Dong <b29396@freescale.com>
2010-07-30 16:13:43 +08:00
9fb5acfda2 ENGR00125735 iMX28 read mac address from fuse
Read mac address from fuse

Signed-off-by: Frank Li <frank.li@freescale.com>
2010-07-30 12:59:27 +08:00
1c93b15534 ENGR00125613 mfg-tool: Add mx50 mfg firmware support
Add mx50 mfg firmware support

Signed-off-by: Peter Chen <peter.chen@freescale.com>
2010-07-27 16:19:54 +08:00
7bcdea937a ENGR00125220 MX28: SD(slot0)boot dhcp failed
This is caused by fec_pwr_en pin is mis-used which lead
to FEC not power on. This commit fix this issue.

Signed-off-by:Jason Liu <r64343@freescale.com>
2010-07-22 21:22:24 +08:00
1bc5e5f2ce ENGR00125036 Uboot Add eMMC 4.4 support
Enable DDR mode on ESDHC controller and mmc library
Enable 8-bit support in mmc library

Signed-off-by: Anish Trivedi <anish@freescale.com>
2010-07-20 09:50:23 -05:00
592ec82029 ENGR00125174: MX50: change memory configurations
Currently we set mx508 memory as 128M which is not
enough for android running.
Based on hardware team's input, mDDR boards support
512MB totally, while we only mount half of them.
LPDDR2 boards support 512MB.
So we will modify mddr configuration as 256M and
LPDDR2 as 512M.

Signed-off-by: Terry Lv <r65388@freescale.com>
2010-07-16 16:04:29 +08:00
c5f6bfc5b7 ENGR00123924: Reconstructure fuse files and add fuse to mx53.
1. Reconstructure fuse. Move fuse files to common directory.
2. Read mac from fuse in fec.
3. Remove scc and srk command from fuse command.
4. Change fuse to iim.
5. Add fuse for mx53.

Signed-off-by: Terry Lv <r65388@freescale.com>
2010-07-16 11:18:57 +08:00
acce438960 ENGR00125045 MX53 Uboot: Adjust VDDGP voltage
1. Adjust VDDGP voltage for 800MHZ as 1.05v.
2. Correct VDDA comments

Signed-off-by: Lily Zhang <r58066@freescale.com>
2010-07-14 19:49:12 +08:00
e6432a827d ENGR00125042 mx35: Fix error in a comment for header file
Fix error in a comment for header file
Fix ppp review about error board description

Signed-off-by: Peter Chen <peter.chen@freescale.com>
2010-07-12 10:29:47 +08:00
7b6e0c9628 ENGR00124984 MX53:Add spi_get_cfg function support
Add spi_get_cfg function due to the function has been made
platform specific and moved out of spi driver.
This also fix the build break for mx53 uboot

Signed-off-by:Jason Liu <r64343@freescale.com>
2010-07-09 04:16:43 +08:00
d6141b1640 ENGR00124627: Dynamic SD slot support for env data.
MMC init failed when boot with upper SD slot
while succesful with lower slot.
This patch will fix it.

Signed-off-by: Terry Lv <r65388@freescale.com>
2010-07-08 14:35:36 +08:00
e362247d0a ENGR00124912 MX53: Fix board ID check issue
Accoring to board identification table, the ADC data
register value range between "0xB9E79F - 0xC00000"
indicates 21.

Signed-off-by: Lily Zhang <r58066@freescale.com>
2010-07-08 09:34:14 +08:00
1ac6a858ea ENGR00124951 Uboot cannot initialize MMC cards
Removed low voltage (1.8V) from supported voltage ranges.
Changed SD2_CMD pad setting to enable SD2 r/w in uboot.
Loaded env from booted device instead of SD1 always.

Signed-off-by: Anish Trivedi <anish@freescale.com>
2010-07-07 18:49:28 -05:00
06397921bf ENGR00124954 MX50: init sys by ROM plug-in feature
Use ROM plug-in feature to init DDR and re-config PLL1 to
800Mhz due to ROM set it to 799Mhz. Plug-in has the following benifit
from ROM team comments,
1. DCD size limitation issue, plugin can be the size of OCRAM
   free space region which is 72KB.
2. Safe environment to re-configure PLL1 (without impacting SDRAM)
   as the plugin runs from OCRAM. This could get around the issue
   of some boards running with ARM @ 192MHz due to the incorrect
   GPIO configuration for Low Power Boot.
3. Ability to have one bootloader binary for both LPDDR1 & LPDDR2 platforms.

Signed-off-by: Jason Liu <r64343@freescale.com>
2010-07-08 05:01:19 +08:00
51cca4a315 ENGR00124953 Uboot:Fix the build break for MX51 BBG board
Fix the build break for MX51 BBG board

Signed-off-by: Jason Liu <r64343@freescale.com>
2010-07-08 02:45:35 +08:00
315847875c ENGR00124359 Add uboot support for MX50
Add initial support for MX50

-Support mddr200Mhz, lpddr2266Mhz ARM2 board,
-Support boot from SD/MMC,
-Support boot from SPI-NOR,
-Support FEC, UART,
-Support SD/MMC/SPI command within UBOOT

Signed-off-by: Anish Trivedi <anish@freescale.com>
Signed-off-by: Terry Lv <r65388@freescale.com>
Signed-off-by: Jason Liu <r64343@freescale.com>
2010-07-07 05:35:42 +08:00
65d7ce607b ENGR00124908 CSPI: make spi_get_cfg platform specific
CSPI: make spi_get_cfg platform specific
move the spi_get_cfg out of the cspi/ecspi driver

Signed-off-by:Jason Liu <r64343@freescale.com>
2010-07-07 05:35:42 +08:00
c6433f273a ENGR00124819 Uboot reading/writing sd card fails
Updated MMC_PARTITION_SWITCH function to not return
failure for partition 0

Signed-off-by: Anish trivedi <anish@freescale.com>
2010-07-01 12:58:36 -05:00
f35e725854 ENGR00124710 MX53 Uboot: Add MFG tool support
Add MFG tool support for MX53 EVK

Signed-off-by: Lily Zhang <r58066@freescale.com>
2010-06-28 13:58:25 +08:00
429e9bb343 ENGR00124652 UBOOT: MX53 env fails to load when booting from 2nd slot
Added dynamic check for which sd slot used for boot

Signed-off-by: Anish Trivedi <anish@freescale.com>
2010-06-24 09:47:41 -05:00
3bd50a46e4 ENGR00123782 Fix boot partition problem for emmc
Enable boot partition in BOOT_CONFIG byte of EXT_CSD

Signed-off-by: Anish Trivedi <anish@freescale.com>
2010-06-24 09:47:41 -05:00
90bfe6af18 ENGR00122651: Add dwc_ahsata support
Add dwc_ahsata support.

Signed-off-by: Terry Lv <r65388@freescale.com>
2010-06-24 16:54:31 +08:00
6fa1a0ea0c ENGR00124391 mx35: update mfg config file
The old config has big env size, and the u-boot.bin will larger than 1MB,
the new one will less than 500KB

Signed-off-by: Peter Chen <b29397@freescale.com>
2010-06-17 12:34:51 +08:00
3ee9d15fd8 ENGR00123484 mx28:support saving environment into sd1
Original uboot did not support sd1 and can only save environment
into sd0 even actually you're booting from sd1.
This patch adds the capability of saving environment into sd1
when you're booting from sd1.

Signed-off-by: Aisheng.Dong <b29396@freescale.com>
2010-06-08 13:36:33 +08:00
ddb3f2723e ENGR00124195 Uboot:Pass EVK RevB board ID to kernel
Pass EVK RevB board ID to kernel by system_rev[11:8]
2 -->RevB,
1--->ARM2,
0--->RevA,

Signed-off-by:Jason Liu <r64343@freescale.com>
2010-06-07 14:23:54 +08:00
7db87846f8 ENGR00124100: Add support for saving env data to active mmc device
Add  support for saving env data to active mmc device.

Signed-off-by: Terry Lv <r65388@freescale.com>
2010-06-02 14:49:54 +08:00
5ceff9165b ENGR00123551: Add mx25 splash screen support
Add mx25 splash screen support.

Signed-off-by: Terry Lv <r65388@freescale.com>
Signed-off-by: Renato Frias <renato.frias@freescale.com>
Signed-off-by: Terry Lv <r65388@freescale.com>
2010-05-31 10:21:05 +08:00
161ebc6c08 ENGR00123870 MX53: Set AXI_B clock to 200Mhz
The clock for axi_b is set to 100Mhz which will cause IPU module has
insufficient clock rate. This patch will increase axi_b clock to 200M
and keep it not change when do clk config in uboot

Signed-off-by:Jason Liu <r64343@freescale.com>
2010-05-26 20:31:54 +08:00
cfc0fd331a ENGR00123641 MX53: Add DDR3 CPU board support
Add DDR3 CPU board support, DDR3 clock 400Mhz
Create one config file for it since the DDR3 init
script is much different wtih DDR2.

Signed-off-by:Jason Liu <r64343@freescale.com>
2010-05-20 14:09:02 +08:00
af46d9f54b ENGR00123630 Set ddr clk clock according to the board ID
Set DDR clock to 400Mhz on MX53-EVK with DDR2 1GByte RevB
Set DDR clock to 300Mhz on MX53-EVK with DDR2 2GByte RevA1

Remove the clock dump during boot, user can use clk command to
get the clock information. Using help clk to get the command help

Signed-off-by:Jason Liu <r64343@freescale.com>
2010-05-19 22:23:42 +08:00
a0e1ec967f ENGR00123488 MX53 Board Identification
The CPU_ID0 analog voltage level is obtained by reading ADC
channel 12 of the LTC2495 and the CPU_ID1 analog voltage
level is obtained by reading ADC channel 13.

The ADC data register value read from the LTC2495 is a 24 bit value.
For example, an ADC value that reads between 0xB3CF3E and 0xB9E79E
indicates a 130k ohm resistor is populated on the daughtercard,
which corresponds to ID level 20

By using CPU_ID0, CPU_ID1 to identify the board for example:
CPU_ID0 = 21, CPU_ID1 = 15, MX53-EVK with DDR2 1GByte RevB

Signed-off-by:Jason Liu <r64343@freescale.com>
2010-05-14 17:09:22 +08:00
9ef0863e8b ENGR00123418: Add peripheral clock setup support
Add peripheral clock setup support.

Signed-off-by: Terry Lv <r65388@freescale.com>
2010-05-14 15:35:52 +08:00
9667c8061f ENGR00123278: Support clock operation functions
Support clock operation functions.

Signed-off-by: Terry Lv <r65388@freescale.com>
2010-05-11 14:28:22 +08:00
bd4a694934 ENGR00123265 UBOOT:Preserve NAND bad block indication
Preserve NAND bad block indication

Signed-off-by:Jason Liu <r64343@freescale.com>
2010-05-07 18:00:07 +08:00
cfb0209bfd ENGR00122980: Change default env dev to mmc for bbg
As customer usually mmc to save env data.
Change default env device to mmc for bbg.

Signed-off-by: Terry Lv <r65388@freescale.com>
2010-04-29 15:42:17 +08:00
4656abc886 ENGR00122643: Integrate linear PMIC
Integrate linear PMIC.

Signed-off-by: Terry Lv <r65388@freescale.com>
2010-04-20 10:27:44 +08:00
260584a4e6 ENGR00122342: missing mx23 evk machine ID setting
Change stmp378x to mx23evk in u-boot.

Signed-off-by: Terry Lv <r65388@freescale.com>
2010-04-16 11:13:30 +08:00
31ca7ee953 ENGR00122395: fix license declaration issue in fsl_esdhc.h
fix license declaration issue in fsl_esdhc.h.

Signed-off-by: Terry Lv <r65388@freescale.com>
2010-04-12 10:26:53 +08:00
025e700031 ENGR00122030 Mfg Firmware support fot imx25
Add mfg firmware support for imx25

Signed-off-by:Yan Wang<r65094@freescale.com>
2010-04-07 15:35:58 +08:00
b40dc845fc ENGR00122217 Missed iomem_valid_addr in updater configration
1. Add definition for iomem_valid_addr
2. Add definition for CONFIG_ENV_IS_IN_FLASH

Signed-off-by: Wallace Wang <r59996@freescale.com>
2010-04-02 15:16:53 +08:00
c3dfebadaf ENGR00122203 UBOOT: Add MX53 ARM2 board support
Both EVK and ARM2 board using the same machine id.
Currently, use system_rev to diff ARM2 board. DDR freq
for ARM2 has been set to 400M, but 300M on EVK.

Signed-off-by:Jason Liu <r64343@freescale.com>
2010-04-01 14:30:54 +08:00
bb6b461878 ENGR00122085 MX35 Add Uboot Firmware support
Build Mfg firmware for mx35 3stack

Signed-off-by: Wallace Wang <r59996@freescale.com>
2010-03-31 10:47:00 +08:00
6dd2709514 ENGR00119033: System can not find MMC/SD card in SD slot 1
System can not find MMC/SD card in SD
slot 1 when booting from Uboot.

Signed-off-by: Terry Lv <r65388@freescale.com>
2010-03-30 15:38:37 +08:00
76ca5d255b ENGR00122050: mmc can't read data whose size exceeds 32M
mmc can't read data whose size exceeds 32M.

Signed-off-by: Terry Lv <r65388@freescale.com>
2010-03-26 17:48:54 +08:00
c861311641 ENGR00122046 Update DDR init script for MX53 EVK
Update DDR init script according to compass:
http://compass.freescale.net/go/216805297
FCP 7 KB 25-Mar-2010

setmem /32 0x53fa8570 = 0x00180000 ->
setmem /32 0x53fa8570 = 0x00200000
setmem /32 0x53fa8578 = 0x00180000 ->
setmem /32 0x53fa8578 = 0x00200000

Signed-off-by:Jason Liu <r64343@freescale.com>
2010-03-26 16:45:37 +08:00
46b29af149 ENGR00121976 UBOOT: some fix for SD/MMC card
-Update eSDHC clock setting,
-Fix the GPT timer setting,
-Fix the boot option pars,
-Remove mdelay() function call to improve the performance

Signed-off-by:Jason Liu <r64343@freescale.com>
2010-03-25 19:46:28 +08:00
1842946ef7 ENGR00121832: Some code reconstructure for u-boot
1. Remove board specific code in mxc_i2c.c.
2. Remove board specific code in mxc_fec.c.
3. Move imx_spi_nor.h to include/asm-arm.

Signed-off-by: Terry Lv <r65388@freescale.com>
2010-03-22 17:53:45 +08:00
e84eaf4df6 ENGR00121779 Support a single kernel image on MX5x parts
This change is required by kernel change ENGR00121762
(enables a single kernel image on MX5x parts using run-time phys_offset).
Load address and Entry points are set for MX53 parts(0x7xxxxxxx).
So the bootloader must add the offset 0x20000000 for MX51 parts.

Signed-off-by: Lily Zhang <r58066@freescale.com>
2010-03-19 13:17:20 -05:00
c37f6d2604 ENGR00121774 DDR 300Mhz support for MX53 uboot
-update DDR script for 300MHZ support, this script got from Yaniv
-increase VDDA to 1.25V

Signed-off-by:Jason Liu <r64343@freescale.com>
2010-03-19 16:12:07 +08:00
8df54067b6 ENGR00121731: Add mmu, l1cache, l2cache support for mx53
Add mmu, l1cache, l2cache support for mx53.

Signed-off-by: Terry Lv <r65388@freescale.com>
2010-03-19 11:16:53 +08:00
762d994929 ENGR00121202 Add uboot support for MX53
Add uboot support for MX53

Signed-off-by:Jason Liu <r64343@freescale.com>
2010-03-17 18:13:37 +08:00
029aff1389 ENGR000121601: FEC not work in mx28 u-boot
FEC not work in mx28 u-boot.

Signed-off-by: Terry Lv <r65388@freescale.com>
2010-03-16 16:11:58 +08:00
aca6f560d0 ENGR00121379: MX28 U-BOOT enhancements
MX28 U-BOOT enhancements.

Signed-off-by: Terry Lv <r65388@freescale.com>
2010-03-12 11:07:40 +08:00
f4c2bfd8fb ENGR00121504 Revert ENGR00120191 to restore M4IF values
CR 00120191 is used to adjust IPU/VPU priority for memory
access in order to improve video performance. However this
change caused video playback and record unstable (See
CR 00120697, CR 00121478). It's decided to remove CR 00121504
change for the stability.

Signed-off-by: Lily Zhang <r58066@freescale.com>
2010-03-11 14:32:40 +08:00
19423c03de ENGR00121314: Fix mx23 and mx28 u-boot build error
mx23 and mx28 u-boot build fails.
The reason is that cache-cp15.c is changed to cache-cp15.h.

Signed-off-by: Terry Lv <r65388@freescale.com>
2010-03-05 15:18:31 +08:00
cdfb31a14c ENGR00121079: Unable to get IP address in uboot
It was found that the failure is caused by
sending DCHP Discover request with empty
"Parameter Request List" option.

Signed-off-by: Terry Lv <r65388@freescale.com>
2010-03-04 15:00:45 +08:00
bd6578e46d ENGR00120520: Enable MMU for mx51 and mx35
MMU enable code is missed in mx51 and mx35 u-boot.
So add these codes.

Signed-off-by: Terry Lv <r65388@freescale.com>
2010-03-04 14:55:00 +08:00
871825c114 ENGR00121029 Add MX51-BBG Uboot Firmware support
Build Mfg firmware for mx51-bbg

Signed-off-by: Frank Li <frank.li@freescale.com>
2010-02-22 17:57:47 +08:00
8bab684efe ENGR00120830: Add eMMC and eSD fast boot support
Add eMMC and eSD fast boot support.

Signed-off-by: Terry Lv <r65388@freescale.com>
Signed-off-by: Brian Liu <b14843@freescale.com>
2010-02-08 13:49:02 +08:00
3de15e03d8 ENGR00120476: Add fuse support for mx51
Add fuse support for mx51.

Signed-off-by: Terry Lv <r65388@freescale.com>
2010-01-27 13:29:28 +08:00
c77b09d0ed ENGR00120206 iMX28 Enable Ethernet and MMC boot support
Enable Ethernet and MMC boot support for imx28-evk

Signed-off-by: Frank Li <frank.li@freescale.com>
2010-01-25 16:53:54 +08:00
8a42ad8f7f ENGR00120202 MX51: enable L2 cache
Enable L2 cache in MX51 for uboot and kernel

Signed-off-by: Lily Zhang <r58066@freescale.com>
2010-01-18 18:57:05 +08:00
ef152c3b76 ENGR00120208: Change recovery mode boot_cmd strategy
The new strategy will be:
bootargs_android_recovery and bootcmd_android_recovery
will be checked.
If they exists, their values will be used by bootargs_android
and bootcmd_android, or the default vaules will be used.

Signed-off-by: Terry Lv <r65388@freescale.com>
2010-01-18 16:42:39 +08:00
500602a8e6 ENGR00120207: Change recovery mode combo keys
Change recovery mode combo keys.

Signed-off-by: Terry Lv <r65388@freescale.com>
2010-01-18 16:40:07 +08:00
be8a4f952c ENGR00120203: Add fec_addr check for mx51
As mx51 also uses FEC, we need to write FEC mac addr to register for kernel.
Thus fec_addr also need to be checked.

Signed-off-by: Terry Lv <r65388@freescale.com>
2010-01-18 16:40:07 +08:00
ade8a952ce ENGR00120191 MX51: Update the M4IF setting
New M4IF settings benefit to video performance improvement.

Signed-off-by: Lily Zhang <r58066@freescale.com>
2010-01-17 12:30:39 +08:00
b238637c05 ENGR00119894: Read right value in mxc_i2c
The value read from mxc_i2c is not complete.
The last byte is lost.

Signed-off-by: Terry Lv <r65388@freescale.com>
2010-01-11 19:34:31 +08:00
a5510c49ad ENGR00119890: Set right mac addr to FEC register in init
The mac addr set to FEC is smc911x's.
So add a environment "fec_addr" to set fec address.

Signed-off-by: Terry Lv <r65388@freescale.com>
2010-01-11 19:32:42 +08:00
c3b0a8706e ENGR00119834: Change PDR0 clock settings for mx35 TO2
The IPU_HND_BYP bit is different in mx35 to1 and to2.
Change the value of this bit for mx35 to2.

Signed-off-by: Terry Lv <r65388@freescale.com>
2010-01-06 15:57:26 +08:00
cb4d53ad84 ENGR00119706: Add esdhcv1 support.
Add a new config CONFIG_IMX_ESDHC_V1 for v1 support.

Signed-off-by: Terry Lv <r65388@freescale.com>
2009-12-31 16:12:08 +08:00
a7b772a9e3 ENGR00119738: eMMC card access failed.
The iomux settings of mx51 bbg and mx35 3stack can't support eMMC card.
Thus, change the iomux settings.

Signed-off-by: Terry Lv <r65388@freescale.com>
2009-12-31 16:02:03 +08:00
1c0e2611a1 ENGR00119716: MX28 basic support.
Add mx28 to u-boot and pass the compiling.

Signed-off-by: Terry Lv <r65388@freescale.com>
2009-12-31 16:01:21 +08:00
2d6150b0d9 ENGR00119715: Add multi network support for mx35
mx35 need to enable both smc911x and FEC.
So add CONFIG_ETHPRIME for it.
Also, change CONFIG_ETH_PRIME to CONFIG_ETHPRIME.

Signed-off-by: Terry Lv <r65388@freescale.com>
2009-12-31 14:38:10 +08:00
faab46cc86 ENGR00119701 MX51: merge some fixes in 200908 version
1. Update MX51 3-stack initialization codes to merge some
fixes from 200901 version
2. Update MX51 BBG code to add chip version check

Signed-off-by: Lily Zhang <r58066@freescale.com>
2009-12-28 20:30:11 +08:00
a7fc31a95a ENGR00118739 Correct the board version of MX51 EVK
The SD card in MMC Slot2 can not be detected. This is because
the board version of MX51 EVK doesn't keep synchronization
with kernel. So the card detect PIN is not configured well.
Here Bit 11-Bit 8 in system_rev indicates the board version.
The fix is to set Bit 11 -Bit8 as 1 for MX51 EVK board.

Signed-off-by: Lily Zhang <r58066@freescale.com>
2009-12-27 17:34:10 +08:00
5c5128b605 ENGR00119591 Fix SPI-NOR reset issue
Add the workaround for ENGcm09397: reconfigure eCSPI SS signal
as GPIO before reset.

Signed-off-by: Lily Zhang <r58066@freescale.com>
2009-12-25 16:24:49 +08:00
67b3137678 ENGR00119660 MX35 UBOOT: Can't boot up on 2k page size nand
1. Write boot image into nand flash.
2. Switch to external boot mode from nand flash
3. Can not show any message.

Signed-off-by:Fred Fan <r01011@freescale.com>
2009-12-25 15:30:36 +08:00
c1aa9915bd ENGR00119625 i.MX35: UBoot doesn't accept commands if program uboot to NOR
Bug detailed description:
1. Program uboot to NOR.
2. UBoot can boot up, but it doesn't accept commands. log:
MX35 U-Boot >
MX35 U-Boot > help
Unknown command 'help' - try 'help'
MX35 U-Boot > printenv
Unknown command 'printenv' - try 'help'
MX35 U-Boot > help
Unknown command 'help' - try 'help'
MX35 U-Boot >

Signed-off-by: Fred.fan <r01011@freescale.com
2009-12-24 19:14:58 +08:00
750f168825 ENGR00119526 MX25: Fix mmc read/write failure on mmc uboot
Fix MMC read/write failure due to eSDHC register definition wrong

Signed-off-by: Sammy He <r62914@freescale.com>
2009-12-21 17:13:34 +08:00
e9ff0d26c6 ENGR00119505 MX51 BBG: Change DDR2 settings
1. Change the drive strength of DRAM PAD as high
2. Change ESDCFG setting

Signed-off-by: Lily Zhang <r58066@freescale.com>
2009-12-19 16:48:58 +08:00
97a1b233ef ENGR00119486 MX25: Improve Lan9217 ethernet transfer speed
Speed is too slow on MX25, remove udelay in cspi driver

Signed-off-by: Sammy He <r62914@freescale.com>
2009-12-18 17:06:38 +08:00
f6afbf1536 ENGR00119254: Add mmu header for mx51 build error
Add mmu header for mx51 build error.

Signed-off-by: Terry Lv <r65388@freescale.com>
2009-12-11 19:19:04 +08:00
3f09859a43 ENGR00119246 Add CONFIG_MXC_NAND config flag in MX25 platform
Add CONFIG_MXC_NAND config flag in MX25 platform

Signed-off-by: Jason Liu <r64343@freescale.com>
2009-12-11 18:58:03 +08:00
83a8195ca7 ENGR00118998: Can not get ip address when kernel boot up
Kernel need uboot to set fec mac address.

Signed-off-by: Terry Lv <r65388@freescale.com>
2009-12-11 16:57:00 +08:00
53f07baf91 ENGR00119224: mmu support for mx51 3stack and mx51 bbg
mmu support for mx51 3stack and mx51 bbg.

Signed-off-by: Terry Lv <r65388@freescale.com>
2009-12-11 15:19:57 +08:00
1ee27e13d6 ENGR00119171: ubifs support for android recovery mode.
ubifs support for android recovery mode.

Signed-off-by: Terry Lv <r65388@freescale.com>
2009-12-11 12:44:24 +08:00
270ba8ac5b ENGR00119133: MX35 can't boot due to wrong frequency setting
MX35 can't boot due to wrong frequency setting.

Signed-off-by: Terry Lv <r65388@freescale.com>
2009-12-09 16:01:57 +08:00
a012066c09 ENGR00118789 Uboot:Update NAND scan scheme to support new nand type
Update NAND scan scheme to support new nand type. With this
patch uboot can support new NAND flash on mx25/mx35 board
while compatible with old NAND on old boards.

Signed-off-by: Jason Liu <r64343@freescale.com>
2009-12-08 18:11:50 +08:00
d8667412a8 ENGR00118978: Timer adjustment for all platforms
In current u-boot design,
get_timer_masked is not correct and udelay is not accurate
when the time is less than 1000us.
Thus we need to use ipg clock source for accurate timer.

Signed-off-by: Terry Lv <r65388@freescale.com>
2009-12-04 17:14:08 +08:00
3f86cf9693 ENGR00118579 Enable MMU
To enable MMU, it is porting from redboot.
Enable MMU and enable I/D cache.

Signed-off-by:Fred Fan <r01011@freescale.com>
2009-11-30 14:07:16 +08:00
9a17d28d0b ENGR00118801: Unknown information when booting from SPI-NOR.
No 'boot up from' information when booting from NOR-SPI.

Signed-off-by: Terry Lv <r65388@freescale.com>
2009-11-27 15:49:14 +08:00
04e98be5c3 ENGR00118751: Some mmc card can't read and write from right offset.
Some mmc card can't read and write from right offset.
Driver see these card as high capacity and use sector mode for them.
This will lead to read and write corrupt.

Signed-off-by: Terry Lv <r65388@freescale.com>
2009-11-27 15:49:14 +08:00
078cdf97a1 ENGR00118816 Fix reboot/reset failure with image on nand
Reset CPLD registers to fix reboot/reset failure issue.

Signed-off-by: Sammy He <r62914@freescale.com>
2009-11-26 19:17:00 +08:00
758e161681 ENGR00118682 Update the MX25 MAX Priority
Update the priority list for MX25 MAX xbar.

Signed-off-by: Sammy He <r62914@freescale.com>
2009-11-23 11:42:34 +08:00
74d5620b3d ENGR00118647 Fix smc911x receive packet length not set correctly
Fix smc911x receive packet length not set correctly issue. This
caused MX25 tftp timeout sometimes.

Signed-off-by: Sammy He <r62914@freescale.com>
2009-11-20 17:47:39 +08:00
1701c3caa7 ENGR00118576 MX25: Support Smc911x ethernet
1. Add imx cspi support for cpld access.
2. Add smc911x ethernet support from cpld.

Signed-off-by: Sammy He <r62914@freescale.com>
2009-11-20 17:14:44 +08:00
cbee64d544 ENGR00118428 MX233 Uboot: reslove the build error for branch imx_v2009.08
bd->bi_enetaddr was removed in one of the previous patchs, some changes must
be done to avoid building error.

Signed-off-by: Lionel Xu <r63889@freescale.com>
2009-11-13 20:02:49 +08:00
a5c3bc03d1 ENGR00118362: Correct recovery NAND cmd
This patch will fix three issues:
1. Add boot device detection.
2. Use right nand command in anroid for recovery mode.
3. Recovery mode code clean.

Signed-off-by: Terry Lv <r65388@freescale.com>
2009-11-12 14:25:13 +08:00
20710100e4 ENGR00118294: Misc changes for v2009.08 upgrade.
Misc changes for v2009.08 upgrade.

Signed-off-by: Terry Lv <r65388@freescale.com>
2009-11-11 11:55:18 +08:00
34bc495103 ENGR00116772 Workaround for ARM errata ID #468414
Workaround for ARM errata ID #468414, This erratum is
referenced in ARM Core Cortex-A8 Errata Notice [1], ID 468414.

Signed-off-by:Jason Liu <r64343@freescale.com>
(cherry picked from commit 549c17b69a5052c61a979ba679bd1dbd33a4153d)
2009-11-04 11:55:19 +08:00
feca871a16 ENGR00117616: PATA support in u-boot.
PATA support in u-boot.

Signed-off-by: Terry Lv <r65388@freescale.com>
2009-11-04 11:54:55 +08:00
6532550c9f ENGR00116924 Uboot: Boot up hang at detecting NAND when cold boot
Boot from MMC card failed at detecting NAND. The fix will
1. Set RBB_MODE to 1 and using atomic status command
2. Set FW correctly by adding CONFIG_NAND_FW_8 config
3. Correct the BLS register value

Signed-off-by:Jason Liu <r64343@freescale.com>
(cherry picked from commit 7142651386)
2009-11-04 11:37:53 +08:00
1fa19862ac ENGR00116504-2: Add mx51 bbg to3 support.
Add mx51 bbg to3 support.

Signed-off-by: Terry Lv <r65388@freescale.com>
2009-11-04 11:37:07 +08:00
caeb913349 ENGR00116504-1: Sync clock and l2cc code with redboot.
Syc clock and l2cc code with redboot.

Signed-off-by: Terry Lv <r65388@freescale.com>
(cherry picked from commit f712613010)
2009-11-04 10:48:40 +08:00
ba816f983f u-boot v2009.08 sd/mmc support.
Signed-off-by: Terry Lv <r65388@freescale.com>
2009-11-03 18:22:03 +08:00
3227c27804 ENGR00116472-1 U-BOOT upgrade to V2009.08
U-BOOT upgrade from V2009.01 to V2009.08
Initial version for i.MX51 BBG board.
Support:
 FEC, SPI, spi Nor Flash
 Boot from spi nor flash and mmc/sd

Signed-off-by:Fred Fan <r01011@freescale.com>
2009-09-14 16:40:37 +08:00
d293115ed7 ENGR00116243: I2C support for mx51 3ds board.
I2C support for mx51 3ds board.

Signed-off-by: Terry Lv <r65388@freescale.com>
2009-09-10 17:08:11 +08:00
e3f5232e3d ENGR00116203: Change nand Makefile to use CONFIG_MXC_NAND.
Change nand Makefile to use CONFIG_MXC_NAND.

Signed-off-by: Terry Lv <r65388@freescale.com>
2009-09-10 17:08:11 +08:00
c1383a7a5b ENGR00116083: Recovery mode support for Android on mx51.
Recovery mode support for Android on mx51.

Signed-off-by: Terry Lv <r65388@freescale.com>
2009-09-10 17:08:11 +08:00
e721efc160 ENGR00116140 MX51 3stack low level does not set M4IF correctly
Copy babbage settings to 3stack

Signed-off-by: Xinyu Chen <xinyu.chen@freescale.com>
2009-09-10 17:08:11 +08:00
bf4f60f7c6 ENGR00115592: Replace whitespaces with tabs in Makefile
Replace whitespaces with tabs in Makefile.

Signed-off-by: Terry Lv <r65388@freescale.com>
2009-09-10 17:08:11 +08:00
935e15094d ENGR00115046: Add new MMC config option for mx35.
Add new MMC config option for mx35.

Signed-off-by: Terry Lv <r65388@freescale.com>
2009-09-10 17:08:10 +08:00
a12d700c34 ENGR00115333: Enable cp command for MMC
Enable cp command for MMC.

Signed-off-by: Terry Lv <r65388@freescale.com>
2009-09-10 17:08:10 +08:00
9f649aed95 ENGR00113941 MX233: Make UBOOT v2009.01 work on EVK board
Porting MX233 UBOOT from 1.3.3 to V2009.01. Clear old cfg macro, such as
CFG_HZ. Change MAC address getting source from initial configuration to
On-Chip OTP.

Signed-off-by: Lionel Xu <r63889@freescale.com>
2009-09-10 17:08:10 +08:00
ecbbc581c9 ENGR00114746: Disable flash header for mx35 nand boot
Disable flash header for mx35 nand boot.

Signed-off-by: Terry Lv <r65388@freescale.com>
2009-09-10 17:06:37 +08:00
7603c2bd0f ENGR00114367: Add BABBAGE machine id, BBG2.5 rev id for rootfs init.
Update mach-types for BBG board.

Signed-off-by: Terry Lv <r65388@freescale.com>
2009-09-10 17:06:37 +08:00
43ec730ccf ENGR00114393: Support Atmel AT45DB321D SPI NOR flash.
Support Atmel AT45DB321D SPI NOR flash.

Signed-off-by: Terry Lv <r65388@freescale.com>
2009-09-10 17:04:16 +08:00
abf0610e52 ENGR00114178 Support MMC/SD boot and enable dhcp in uboot on MX25
1. Support MMC/SD boot in uboot, however, it is disabled default and
 user needs to enable manually by changing mx25_3stack.h;
2. Enable dhcp for network.

Signed-off-by: Sammy He <r62914@freescale.com>
2009-09-10 17:03:33 +08:00
98ab00fc54 ENGR00114201: Add MMC configs to mx35 3stack config file.
Add MMC configs to mx35 3stack config file.

Signed-off-by: Terry Lv <r65388@freescale.com>
2009-09-10 17:03:32 +08:00
afbf753cb4 ENGR00114236 Disable NAND driver interleave mode support
Disable NAND driver interleave mode support

Signed-off-by:Jason Liu <r64343@freescale.com>
2009-09-10 17:02:19 +08:00
8e3b08b52e ENGR00114233 Add support for programming ubifs image on nand flash
Add support for programming ubifs image on nand flash

Signed-off-by:Jason Liu <r64343@freescale.com>
2009-09-10 17:02:19 +08:00
2fc408150b ENGR00111465: Remove Watchdog disable codes in MX51 uboot.
Remove Watchdog disable codes in MX51 uboot.

Signed-off-by: Terry Lv <r65388@freescale.com>
2009-09-10 17:02:19 +08:00
23b6527003 ENGR00113611: Add FEC support for BBG2.
Add FEC support for BBG2.

Signed-off-by: Terry Lv <r65388@freescale.com>
2009-09-10 17:02:19 +08:00
c6e205a9fd ENGR00113475: Add auto-complete and platform prompt for each platform.
Add auto-complete and platform prompt for each platform.

Signed-off-by: Terry Lv <r65388@freescale.com>
2009-09-10 17:02:19 +08:00
0557114f39 ENGR00113439: BBG2, enable SPI NOR and MMC in one image.
BBG2, enable SPI NOR and MMC in one image.

Signed-off-by: Terry Lv <r65388@freescale.com>
2009-09-10 17:02:19 +08:00
05a4055d2f ENGR00113148 Add build option to uboot for different media type
1. Add build option to uboot for different media type
2. fix the spi-nor link error

Signed-off-by:Jason Liu <r64343@freescale.com>
2009-09-10 17:02:18 +08:00
5001b99606 ENGR00112845 spi nor boot and pmic support for BBG2.
spi nor boot support for BBG2.

Signed-off-by: Terry Lv <r65388@freescale.com>
2009-09-10 17:00:37 +08:00
30e188a231 ENGR00112273 BBG2: MMC boot support.
BBG2: MMC boot support.

Signed-off-by: Terry Lv <r65388@freescale.com>
2009-09-10 16:56:36 +08:00
31594f542d ENGR00112298 BBG2: Basic boot.
Basic boot on BBG2 board.

Signed-off-by: r65388 <r65388@freescale.com>
2009-09-10 15:11:02 +08:00
07f2775a77 ENGR00110586 MX31: Resolve Copyright issue for mx31 files
Add freescale copyright.

Signed-off-by: r65388 <r65388@freescale.com>
2009-09-10 15:11:02 +08:00
512c7938d9 ENGR00109851 Add nand driver for MX51 uboot
Add nand driver for MX51 uboot

Signed-off-by:Jason Liu <r64343@freescale.com>
2009-09-10 15:08:50 +08:00
e4f2035ea5 ENGR00107840 Add U-Boot for MX25 PDK board
These patches add functional support to iMX25PDK.
Currently only the internal FEC is supported.

Signed-off-by: Alan Carvalho de Assis <alan.assis@freescale.com>
2009-09-10 14:53:00 +08:00
703ba8b936 ENGR00108673 Add i.MX25 core to U-Boot
This patch add support on U-Boot to i.MX25 processor.

Signed-off-by: Alan Carvalho de Assis <alan.assis@freescale.com>
2009-09-10 14:50:22 +08:00
a7a74cdb67 ENGR00108473 Porting i.MX51 3stack TO2 support to V2009.01
Support i.MX51 TO2.0 3stack board. And enable LAN9217 support.
NAND is not supported in this patch.

Signed-off-by: Fred Fan <r01011@freescale.com>
2009-09-10 14:29:26 +08:00
765b588dba ENGR00107886 Porting MX31, MX35 3stack to u-boot V2009.01
Modify and Verfiy MX31 & MX35 3stack according to the changes in V2009.01

Signed-off-by: Fred Fan <r01011@freescale.com>
2009-09-10 14:11:18 +08:00
5f7373e548 ENGR00104583 MX35 can not boot up kernel
uboot can not boot kernel.
There are no more messages excepts uncompression message.
The root cause is wrong romfile version offset.

Signed-off-by: Fred Fan <r01011@freescale.com>
2009-09-10 13:57:39 +08:00
5f4c0867c0 ENGR00103914 Support i.MX35 TO2 and 3stack board version 2
1. Check Soc version
2. Check Board version based on TO2 pmic chip version.
3. Based on soc version,  skips To1 workaround code
4. based on board version, enables FEC power and select pin mux.

Signed-off-by: Fred Fan <r01011@freescale.com>
2009-09-09 17:27:24 +08:00
103edf8bf3 ENGR00102788 Remove CONFIG_NAND_BOOT on i.MX31 3stack
1. Change NAND driver Makefile  to bulild individual nand driver on i.MX31
 and i.MX35.
2. Remove CONFIG_NAND_BOOT to common boot code which supports boot from nand
 and nor.

Signed-off-by: Fred Fan <r01011@freescale.com>
2009-09-09 17:27:24 +08:00
4a9ee8a223 ENGR00102776 Support boot from NAND on i.mx35 3stack TO1
1. Support boot from NAND
Changes link script to separate initial code to multiple sections.
2. One binary support boot from NOR and NAND
Changes common file start.S to support multiple sections.

Signed-off-by: Fred Fan <r01011@freescale.com>
2009-09-09 17:27:24 +08:00
4bdaaba26f ENGR00099697 Add nand driver for mx35
Add nand driver for mx35

Signed-off-by:Jason Liu <r64343@freescale.com>
2009-09-09 17:15:27 +08:00
d409f3fd05 ENGR00094619 Support i.MX31 3stack board
Support boot from NAND Flash
Add driver for i.MX31 NFC
Upgate U-Boot to support NAND boot

Signed-off-by: Xinyu Chen <xinyu.chen@freescale.com>
2009-09-09 17:15:27 +08:00
6259800e38 ENGR00094618 Update .gitignore configure file
Update .gitignore configure file to ignore vim swap and ctags file

Signed-off-by: Xinyu Chen <xinyu.chen@freescale.com>
2009-09-09 15:34:06 +08:00
7f9232a943 ENGR00081147 Support i.MX35 3stack board
Support boot from NOR flash
Support Multiple ethernet:LAN9217 and FEC
Support upgrade u-boot

Signed-off-by: Fred Fan <r01011@freescale.com>
2009-09-09 15:34:06 +08:00
427 changed files with 165977 additions and 1401 deletions

1
.gitignore vendored
View File

@ -13,6 +13,7 @@
*~
*.swp
*.patch
*.swp
#
# Top-level generic files

114
Makefile
View File

@ -1,4 +1,4 @@
#
# (C) Copyright 2000-2009
# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
#
@ -223,6 +223,7 @@ LIBS += drivers/pci/libpci.a
LIBS += drivers/pcmcia/libpcmcia.a
LIBS += drivers/power/libpower.a
LIBS += drivers/spi/libspi.a
LIBS += drivers/fastboot/libfastboot.a
ifeq ($(CPU),mpc83xx)
LIBS += drivers/qe/qe.a
endif
@ -3204,6 +3205,16 @@ apollon_config : unconfig
@$(MKCONFIG) $(@:_config=) arm arm1136 apollon NULL omap24xx
@echo "CONFIG_ONENAND_U_BOOT = y" >> $(obj)include/config.mk
mx23_evk_config : unconfig
@$(MKCONFIG) $(@:_config=) arm arm926ejs mx23_evk freescale mx23
mx25_3stack_mfg_config \
mx25_3stack_config : unconfig
@$(MKCONFIG) $(@:_config=) arm arm926ejs mx25_3stack freescale mx25
mx28_evk_config : unconfig
@$(MKCONFIG) $(@:_config=) arm arm926ejs mx28_evk freescale mx28
imx31_litekit_config : unconfig
@$(MKCONFIG) $(@:_config=) arm arm1136 imx31_litekit NULL mx31
@ -3229,6 +3240,107 @@ mx31pdk_nand_config : unconfig
fi
@$(MKCONFIG) -a mx31pdk arm arm1136 mx31pdk freescale mx31
mx31_3stack_config : unconfig
@$(MKCONFIG) $(@:_config=) arm arm1136 mx31_3stack freescale mx31
mx35_3stack_config \
mx35_3stack_mfg_config \
mx35_3stack_mmc_config: unconfig
@$(MKCONFIG) $(@:_config=) arm arm1136 mx35_3stack freescale mx35
mx50_arm2_lpddr2_config \
mx50_arm2_ddr2_config \
mx50_arm2_iram_config \
mx50_arm2_config \
mx50_arm2_mfg_config \
mx50_rdp_iram_config \
mx50_rd3_config \
mx50_rd3_mfg_config \
mx50_rdp_mfg_config \
mx50_rdp_android_config \
mx50_rd3_android_config \
mx50_rdp_config : unconfig
@[ -z "$(findstring iram_,$@)" ] || \
{ echo "TEXT_BASE = 0xF8008400" >$(obj)board/freescale/mx50_rdp/config.tmp ; \
echo "... with iram configuration" ; \
}
@$(MKCONFIG) $(@:_config=) arm arm_cortexa8 mx50_rdp freescale mx50
mx51_bbg_android_config \
mx51_bbg_mfg_config \
mx51_bbg_iram_config \
mx51_bbg_config : unconfig
@[ -z "$(findstring iram_,$@)" ] || \
{ echo "TEXT_BASE = 0x1FFE5000" >$(obj)board/freescale/mx51_bbg/config.tmp ; \
echo "... with iram configuration" ; \
}
@$(MKCONFIG) $(@:_config=) arm arm_cortexa8 mx51_bbg freescale mx51
mx51_3stack_android_config \
mx51_3stack_config : unconfig
@$(MKCONFIG) $(@:_config=) arm arm_cortexa8 mx51_3stack freescale mx51
mx53_pcba_android_mfg_config \
mx53_pcba_android_config :unconfig
$(MKCONFIG) $(@:_config=) arm arm_cortexa8 mx53_pcba freescale mx53
mx53_smd_mfg_config \
mx53_smd_android_config \
mx53_smd_config :unconfig
$(MKCONFIG) $(@:_config=) arm arm_cortexa8 mx53_smd freescale mx53
mx53_loco_mfg_config \
mx53_loco_config :unconfig
$(MKCONFIG) $(@:_config=) arm arm_cortexa8 mx53_loco freescale mx53
mx53_ard_ddr3_mfg_config \
mx53_ard_ddr3_config \
mx53_ard_mfg_config \
mx53_ard_config : unconfig
$(MKCONFIG) $(@:_config=) arm arm_cortexa8 mx53_ard freescale mx53
mx53_arm2_ddr3_config \
mx53_arm2_ddr3_android_config \
mx53_evk_android_config \
mx53_evk_mfg_config \
mx53_evk_config : unconfig
@$(MKCONFIG) $(@:_config=) arm arm_cortexa8 mx53_evk freescale mx53
mx6dl_arm2_config \
mx6dl_arm2_iram_config \
mx6dl_arm2_mfg_config \
mx6dl_arm2_lpddr2_config \
mx6q_arm2_config \
mx6q_arm2_android_config \
mx6q_arm2_mfg_config \
mx6q_arm2_lpddr2_config \
mx6q_arm2_lpddr2pop_config \
mx6q_arm2_iram_config : unconfig
@[ -z "$(findstring iram_,$@)" ] || \
{ echo "TEXT_BASE = 0x00907000" >$(obj)board/freescale/mx6q_arm2/config.tmp ; \
echo "... with iram configuration" ; \
}
@$(MKCONFIG) $(@:_config=) arm arm_cortexa8 mx6q_arm2 freescale mx6
mx6q_sabresd_config \
mx6q_sabresd_android_config \
mx6q_sabresd_mfg_config \
mx6q_sabresd_iram_config : unconfig
@[ -z "$(findstring iram_,$@)" ] || \
{ echo "TEXT_BASE = 0x00907000" >$(obj)board/freescale/mx6q_sabresd/config.tmp ; \
echo "... with iram configuration" ; \
}
@$(MKCONFIG) $(@:_config=) arm arm_cortexa8 mx6q_sabresd freescale mx6
mx6q_sabrelite_config \
mx6q_sabrelite_android_config \
mx6q_sabrelite_mfg_config : unconfig
@$(MKCONFIG) $(@:_config=) arm arm_cortexa8 mx6q_sabrelite freescale mx6
mx6q_sabreauto_mfg_config \
mx6q_sabreauto_config : unconfig
@$(MKCONFIG) $(@:_config=) arm arm_cortexa8 mx6q_sabreauto freescale mx6
omap2420h4_config : unconfig
@$(MKCONFIG) $(@:_config=) arm arm1136 omap2420h4 NULL omap24xx

View File

@ -36,11 +36,13 @@ COBJS-${CONFIG_FSL_PIXIS} += pixis.o
COBJS-${CONFIG_PQ_MDS_PIB} += pq-mds-pib.o
COBJS-${CONFIG_ID_EEPROM} += sys_eeprom.o
COBJS-${CONFIG_FSL_SGMII_RISER} += sgmii_riser.o
COBJS-${CONFIG_VIDEO_MX5} += fsl_bmp_600x400.o
COBJS-${CONFIG_MPC8541CDS} += cds_pci_ft.o
COBJS-${CONFIG_MPC8548CDS} += cds_pci_ft.o
COBJS-${CONFIG_MPC8555CDS} += cds_pci_ft.o
COBJS-${CONFIG_ANDROID_RECOVERY} += recovery.o
SRCS := $(SOBJS:.o=.S) $(COBJS-y:.o=.c)
OBJS := $(addprefix $(obj),$(COBJS-y))

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,109 @@
/*
* Freescale Android Recovery mode checking routing
*
* Copyright (C) 2010-2012 Freescale Semiconductor, Inc.
*
* 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.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
*/
#include <common.h>
#include <malloc.h>
#include "recovery.h"
#ifdef CONFIG_MXC_KPD
#include <mxc_keyb.h>
#endif
extern int check_recovery_cmd_file(void);
extern enum boot_device get_boot_device(void);
#ifdef CONFIG_MXC_KPD
#define PRESSED_HOME 0x01
#define PRESSED_POWER 0x02
#define RECOVERY_KEY_MASK (PRESSED_HOME | PRESSED_POWER)
inline int test_key(int value, struct kpp_key_info *ki)
{
return (ki->val == value) && (ki->evt == KDepress);
}
int check_key_pressing(void)
{
struct kpp_key_info *key_info;
int state = 0, keys, i;
mxc_kpp_init();
puts("Detecting HOME+POWER key for recovery ...\n");
/* Check for home + power */
keys = mxc_kpp_getc(&key_info);
if (keys < 2)
return 0;
for (i = 0; i < keys; i++) {
if (test_key(CONFIG_POWER_KEY, &key_info[i]))
state |= PRESSED_HOME;
else if (test_key(CONFIG_HOME_KEY, &key_info[i]))
state |= PRESSED_POWER;
}
free(key_info);
if ((state & RECOVERY_KEY_MASK) == RECOVERY_KEY_MASK)
return 1;
return 0;
}
#else
/* If not using mxc keypad, currently we will detect power key on board */
int check_key_pressing(void)
{
return 0;
}
#endif
extern struct reco_envs supported_reco_envs[];
void setup_recovery_env(void)
{
char *env, *boot_args, *boot_cmd;
int bootdev = get_boot_device();
boot_cmd = supported_reco_envs[bootdev].cmd;
if (boot_cmd == NULL) {
printf("Unsupported bootup device for recovery\n");
return;
}
printf("setup env for recovery..\n");
env = getenv("bootcmd_android_recovery");
if (!env)
setenv("bootcmd_android_recovery", boot_cmd);
setenv("bootcmd", "run bootcmd_android_recovery");
}
/* export to lib_arm/board.c */
void check_recovery_mode(void)
{
if (check_key_pressing())
setup_recovery_env();
else if (check_recovery_cmd_file()) {
puts("Recovery command file founded!\n");
setup_recovery_env();
}
}

View File

@ -0,0 +1,30 @@
/*
* Android Recovery supported header file
*
* Copyright (C) 2010 Freescale Semiconductor.
*
* 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.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
*/
#ifndef __RECOVERY_H_
#define __RECOVERY_H_
struct reco_envs {
char *cmd;
char *args;
};
#endif

View File

@ -0,0 +1,52 @@
#
# (C) Copyright 2000-2006
# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
#
# See file CREDITS for list of people who contributed to this
# project.
#
# 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.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
# MA 02111-1307 USA
#
include $(TOPDIR)/config.mk
LIB = $(obj)lib$(BOARD).a
COBJS := mx23_evk.o
SOBJS := lowlevel_init.o
SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c)
OBJS := $(addprefix $(obj),$(COBJS))
SOBJS := $(addprefix $(obj),$(SOBJS))
$(LIB): $(obj).depend $(OBJS) $(SOBJS)
$(AR) $(ARFLAGS) $@ $(OBJS) $(SOBJS)
clean:
rm -f $(SOBJS) $(OBJS)
distclean: clean
rm -f $(LIB) core *.bak $(obj).depend
#########################################################################
# defines $(obj).depend target
include $(SRCTREE)/rules.mk
sinclude $(obj).depend
#########################################################################

View File

@ -0,0 +1,6 @@
#
# image should be loaded at 0x41008000
#
LDSCRIPT := $(SRCTREE)/board/$(VENDOR)/$(BOARD)/u-boot.lds
TEXT_BASE = 0x41008000

View File

@ -0,0 +1,36 @@
/*
* Board specific setup info
*
* (C) Copyright 2003, ARM Ltd.
* Philippe Robin, <philippe.robin@arm.com>
*
* Copyright (C) 2009-2011 Freescale Semiconductor, Inc.
* See file CREDITS for list of people who contributed to this
* project.
*
* 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.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
*/
#include <config.h>
#include <version.h>
/* Set up the platform, once the cpu has been initialized */
.globl lowlevel_init
lowlevel_init:
/* All SDRAM settings are done by sdram_prep */
mov pc, lr

View File

@ -0,0 +1,158 @@
/*
*
* (c) 2008 Embedded Alley Solutions, Inc.
*
* Copyright (C) 2009-2011 Freescale Semiconductor, Inc.
*
* See file CREDITS for list of people who contributed to this
* project.
*
* 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.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
*/
#include <common.h>
#include <asm/arch/mx23.h>
#include <asm/arch/clkctrl.h>
#include <asm/arch/pinmux.h>
#include <asm/arch/spi.h>
DECLARE_GLOBAL_DATA_PTR;
#define KHz 1000
#define MHz (1000 * KHz)
static void set_pinmux(void)
{
#if defined(CONFIG_SPI_SSP1)
/* Configure SSP1 pins for ENC28j60: 8maA */
REG_CLR(PINCTRL_BASE + PINCTRL_MUXSEL(4), 0x00003fff);
REG_CLR(PINCTRL_BASE + PINCTRL_DRIVE(8), 0X03333333);
REG_SET(PINCTRL_BASE + PINCTRL_DRIVE(8), 0x01111111);
REG_CLR(PINCTRL_BASE + PINCTRL_PULL(2), 0x0000003f);
#endif
#if defined(CONFIG_SPI_SSP2)
/* Configure SSP2 pins for ENC28j60: 8maA */
REG_CLR(PINCTRL_BASE + PINCTRL_MUXSEL(0), 0x00000fc3);
REG_SET(PINCTRL_BASE + PINCTRL_MUXSEL(0), 0x00000a82);
REG_CLR(PINCTRL_BASE + PINCTRL_MUXSEL(1), 0x00030300);
REG_SET(PINCTRL_BASE + PINCTRL_MUXSEL(1), 0x00020200);
REG_CLR(PINCTRL_BASE + PINCTRL_DRIVE(0), 0X00333003);
REG_SET(PINCTRL_BASE + PINCTRL_DRIVE(0), 0x00111001);
REG_CLR(PINCTRL_BASE + PINCTRL_DRIVE(2), 0x00030000);
REG_SET(PINCTRL_BASE + PINCTRL_DRIVE(2), 0x00010000);
REG_CLR(PINCTRL_BASE + PINCTRL_DRIVE(3), 0x00000003);
REG_SET(PINCTRL_BASE + PINCTRL_DRIVE(3), 0x00000001);
REG_CLR(PINCTRL_BASE + PINCTRL_PULL(0), 0x00100039);
#endif
}
#define IO_DIVIDER 18
static void set_clocks(void)
{
u32 ssp_source_clk, ssp_clk;
u32 ssp_div = 1;
u32 val = 0;
/*
* Configure 480Mhz IO clock
*/
/* Ungate IO_CLK and set divider */
REG_CLR(CLKCTRL_BASE + CLKCTRL_FRAC, FRAC_CLKGATEIO);
REG_CLR(CLKCTRL_BASE + CLKCTRL_FRAC, 0x3f << FRAC_IOFRAC);
REG_SET(CLKCTRL_BASE + CLKCTRL_FRAC, IO_DIVIDER << FRAC_IOFRAC);
/*
* Set SSP CLK to desired value
*/
/* Calculate SSP_CLK divider relatively to 480Mhz IO_CLK*/
ssp_source_clk = 480 * MHz;
ssp_clk = CONFIG_SSP_CLK;
ssp_div = (ssp_source_clk + ssp_clk - 1) / ssp_clk;
/* Enable SSP clock */
val = REG_RD(CLKCTRL_BASE + CLKCTRL_SSP);
val &= ~SSP_CLKGATE;
REG_WR(CLKCTRL_BASE + CLKCTRL_SSP, val);
/* Wait while clock is gated */
while (REG_RD(CLKCTRL_BASE + CLKCTRL_SSP) & SSP_CLKGATE)
;
/* Set SSP clock divider */
val &= ~(0x1ff << SSP_DIV);
val |= ssp_div << SSP_DIV;
REG_WR(CLKCTRL_BASE + CLKCTRL_SSP, val);
/* Wait until new divider value is set */
while (REG_RD(CLKCTRL_BASE + CLKCTRL_SSP) & SSP_BUSY)
;
/* Set SSP clock source to IO_CLK */
REG_SET(CLKCTRL_BASE + CLKCTRL_CLKSEQ, CLKSEQ_BYPASS_SSP);
REG_CLR(CLKCTRL_BASE + CLKCTRL_CLKSEQ, CLKSEQ_BYPASS_SSP);
}
int dram_init(void)
{
gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
return 0;
}
int board_init(void)
{
/* arch number of Freescale STMP 378x development board */
gd->bd->bi_arch_number = MACH_TYPE_MX23EVK;
/* adress of boot parameters */
gd->bd->bi_boot_params = LINUX_BOOT_PARAM_ADDR;
set_clocks();
set_pinmux();
/* Configure SPI on SSP1 or SSP2 */
spi_init();
return 0;
}
int misc_init_r(void)
{
return 0;
}
int checkboard(void)
{
printf("Board: MX23 EVK. \n");
return 0;
}

View File

@ -0,0 +1,51 @@
/*
* (C) Copyright 2002
* Gary Jennejohn, DENX Software Engineering, <gj@denx.de>
*
* See file CREDITS for list of people who contributed to this
* project.
*
* 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.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
*/
OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
OUTPUT_ARCH(arm)
ENTRY(_start)
SECTIONS
{
. = 0x00000000;
. = ALIGN(4);
.text :
{
cpu/arm926ejs/start.o (.text)
*(.text)
}
.rodata : { *(.rodata) }
. = ALIGN(4);
.data : { *(.data) }
. = ALIGN(4);
.got : { *(.got) }
. = .;
__u_boot_cmd_start = .;
.u_boot_cmd : { *(.u_boot_cmd) }
__u_boot_cmd_end = .;
. = ALIGN(4);
__bss_start = .;
.bss (NOLOAD) : { *(.bss) }
_end = .;
}

View File

@ -0,0 +1,53 @@
#
# (c) Copyright 2009 Freescale Semiconductor
#
# (C) Copyright 2000-2006
# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
#
# See file CREDITS for list of people who contributed to this
# project.
#
# 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.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
# MA 02111-1307 USA
#
include $(TOPDIR)/config.mk
LIB = $(obj)lib$(BOARD).a
COBJS := mx25_3stack.o
SOBJS := lowlevel_init.o dcdheader.o
SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c)
OBJS := $(addprefix $(obj),$(COBJS))
SOBJS := $(addprefix $(obj),$(SOBJS))
$(LIB): $(obj).depend $(OBJS) $(SOBJS)
$(AR) $(ARFLAGS) $@ $(OBJS) $(SOBJS)
clean:
rm -f $(SOBJS) $(OBJS)
distclean: clean
rm -f $(LIB) core *.bak .depend
#########################################################################
# defines $(obj).depend target
include $(SRCTREE)/rules.mk
sinclude $(obj).depend
#########################################################################

View File

@ -0,0 +1,3 @@
LDSCRIPT := $(SRCTREE)/board/$(VENDOR)/$(BOARD)/u-boot.lds
TEXT_BASE = 0x83F00000

View File

@ -0,0 +1,99 @@
/*
* Copyright (c) 2009 Freescale Semiconductor
*
* See file CREDITS for list of people who contributed to this
* project.
*
* 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.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
*/
#include <config.h>
#include <version.h>
.extern reset
#define DCDGEN(i,type, addr, data) \
dcd_##i: ;\
.long type ;\
.long addr ;\
.long data
.globl _initheader
_initheader:
b reset
.org 0x400
app_code_jump_v: .long reset
app_code_barker: .long 0xB1
app_code_csf: .long 0
hwcfg_ptr_ptr: .long hwcfg_ptr
super_root_key: .long 0
hwcfg_ptr: .long dcd_data
app_dest_ptr: .long TEXT_BASE
dcd_data: .long 0xB17219E9
#ifdef MXC_MEMORY_MDDR
dcd_len: .long 12*15
#else
dcd_len: .long 12*24
#endif
/* WEIM config-CS5 init -- CPLD */
DCDGEN( 1, 4, 0xB8002050, 0x0000D843) /* CS5_CSCRU */
DCDGEN( 2, 4, 0xB8002054, 0x22252521) /* CS5_CSCRL */
DCDGEN( 3, 4, 0xB8002058, 0x22220A00) /* CS5_CSCRA */
#ifdef MXC_MEMORY_MDDR
/* MDDR init */
DCDGEN( 4, 4, 0xB8001010, 0x00000004) /* enable mDDR */
DCDGEN( 5, 4, 0xB8001000, 0x92100000) /* precharge command */
DCDGEN( 6, 1, 0x80000400, 0x12344321) /* precharge all dummy write */
DCDGEN( 7, 4, 0xB8001000, 0xA2100000) /* auto-refresh command */
DCDGEN( 8, 4, 0x80000000, 0x12344321) /* dummy write for refresh */
DCDGEN( 9, 4, 0x80000000, 0x12344321) /* dummy write for refresh */
DCDGEN(10, 4, 0xB8001000, 0xB2100000) /* Load Mode Reg command - cas=3 bl=8 */
DCDGEN(11, 1, 0x80000033, 0xda) /* dummy write -- address has the mode bits */
DCDGEN(12, 1, 0x81000000, 0xff) /* dummy write -- address has the mode bits */
DCDGEN(13, 4, 0xB8001000, 0x82216880)
DCDGEN(14, 4, 0xB8001004, 0x00295729)
#else
/* DDR2 init */
DCDGEN( 4, 4, 0xB8001004, 0x0076E83A) /* initial value for ESDCFG0 */
DCDGEN( 5, 4, 0xB8001010, 0x00000204) /* ESD_MISC */
DCDGEN( 6, 4, 0xB8001000, 0x92210000) /* CS0 precharge command */
DCDGEN( 7, 4, 0x80000f00, 0x12344321) /* precharge all dummy write */
DCDGEN( 8, 4, 0xB8001000, 0xB2210000) /* Load Mode Register command */
DCDGEN( 9, 1, 0x82000000, 0xda) /* dummy write Load EMR2 */
DCDGEN(10, 1, 0x83000000, 0xda) /* dummy write Load EMR3 */
DCDGEN(11, 1, 0x81000400, 0xda) /* dummy write Load EMR1; enable DLL */
DCDGEN(12, 1, 0x80000333, 0xda) /* dummy write Load MR; reset DLL */
DCDGEN(13, 4, 0xB8001000, 0x92210000) /* CS0 precharge command */
DCDGEN(14, 1, 0x80000400, 0x12345678) /* precharge all dummy write */
DCDGEN(15, 4, 0xB8001000, 0xA2210000) /* select manual refresh mode */
DCDGEN(16, 4, 0x80000000, 0x87654321) /* manual refresh */
DCDGEN(17, 4, 0x80000000, 0x87654321) /* manual refresh twice */
DCDGEN(18, 4, 0xB8001000, 0xB2210000) /* Load Mode Register command */
DCDGEN(19, 1, 0x80000233, 0xda) /* Load MR; CL=3, BL=8, end DLL reset */
DCDGEN(20, 1, 0x81000780, 0xda) /* Load EMR1; OCD default */
DCDGEN(21, 1, 0x81000400, 0xda) /* Load EMR1; OCD exit */
DCDGEN(22, 4, 0xB8001000, 0x82216080) /* normal mode */
DCDGEN(23, 4, 0x43FAC454, 0x00001000) /* IOMUXC_SW_PAD_CTL_GRP_DDRTYPE(1-5) */
#endif
DCDGEN(99, 4, 0x53F80008, 0x20034000) /* CLKCTL ARM=400 AHB=133 */
card_cfg: .long UBOOT_IMAGE_SIZE

View File

@ -0,0 +1,97 @@
/*
* Copyright (c) 2009 Freescale Semiconductor
*
* See file CREDITS for list of people who contributed to this
* project.
*
* 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.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
*/
#include <asm/arch/mx25-regs.h>
.macro REG reg, val
ldr r2, =\reg
ldr r3, =\val
str r3, [r2]
.endm
.macro REG8 reg, val
ldr r2, =\reg
ldr r3, =\val
strb r3, [r2]
.endm
.globl lowlevel_init
lowlevel_init:
REG 0x53F80008, 0x20034000 // ARM clk = 399, AHB clk = 133
/* Init Debug Board CS5 */
REG 0xB8002050, 0x0000D843
REG 0xB8002054, 0x22252521
REG 0xB8002058, 0x22220A00
/* MAX (Multi-Layer AHB Crossbar Switch) setup */
/* MAX - priority for MX25 is (SDHC2/SDMA)>USBOTG>RTIC>IAHB>DAHB */
ldr r0, =MAX_BASE
ldr r1, =0x00002143
str r1, [r0, #0x000] /* for S0 */
str r1, [r0, #0x100] /* for S1 */
str r1, [r0, #0x200] /* for S2 */
str r1, [r0, #0x300] /* for S3 */
str r1, [r0, #0x400] /* for S4 */
/* SGPCR - always park on last master */
ldr r1, =0x10
str r1, [r0, #0x010] /* for S0 */
str r1, [r0, #0x110] /* for S1 */
str r1, [r0, #0x210] /* for S2 */
str r1, [r0, #0x310] /* for S3 */
str r1, [r0, #0x410] /* for S4 */
/* MGPCR - restore default values */
ldr r1, =0x0
str r1, [r0, #0x800] /* for M0 */
str r1, [r0, #0x900] /* for M1 */
str r1, [r0, #0xA00] /* for M2 */
str r1, [r0, #0xB00] /* for M3 */
str r1, [r0, #0xC00] /* for M4 */
/* M3IF setup */
ldr r1, =M3IF_BASE
ldr r0, =0x00000001
str r0, [r1] /* M3IF control reg */
/* default CLKO to 1/32 of the ARM core */
ldr r0, =CCM_MCR
ldr r1, =CCM_MCR
bic r1, r1, #0x00F00000
bic r1, r1, #0x7F000000
mov r2, #0x5F000000
add r2, r2, #0x00200000
orr r1, r1, r2
str r1, [r0]
/* enable all the clocks */
ldr r2, =0x1FFFFFFF
ldr r0, =CCM_CGR0
str r2, [r0]
ldr r2, =0xFFFFFFFF
ldr r0, =CCM_CGR1
str r2, [r0]
ldr r2, =0x000FDFFF
ldr r0, =CCM_CGR2
str r2, [r0]
mov pc, lr

View File

@ -0,0 +1,489 @@
/*
* (c) Copyright 2009-2010 Freescale Semiconductor
*
* (c) 2007 Pengutronix, Sascha Hauer <s.hauer@pengutronix.de>
*
* See file CREDITS for list of people who contributed to this
* project.
*
* 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.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
*/
#include <common.h>
#include <asm/io.h>
#include <asm/errno.h>
#include <asm/arch/mx25.h>
#include <asm/arch/mx25-regs.h>
#include <asm/arch/mx25_pins.h>
#include <asm/arch/iomux.h>
#include <asm/arch/gpio.h>
#include <imx_spi.h>
#ifdef CONFIG_LCD
#include <mx2fb.h>
#include <lcd.h>
#endif
#ifdef CONFIG_GET_FEC_MAC_ADDR_FROM_IIM
#include <asm/imx_iim.h>
#endif
#ifdef CONFIG_CMD_MMC
#include <mmc.h>
#include <fsl_esdhc.h>
#endif
DECLARE_GLOBAL_DATA_PTR;
static u32 system_rev;
#ifdef CONFIG_LCD
char lcd_cmap[256];
#endif
u32 get_board_rev(void)
{
return system_rev;
}
static inline void setup_soc_rev(void)
{
int reg;
reg = __REG(IIM_BASE + IIM_SREV);
if (!reg) {
reg = __REG(ROMPATCH_REV);
reg <<= 4;
} else
reg += CHIP_REV_1_0;
system_rev = 0x25000 + (reg & 0xFF);
}
inline int is_soc_rev(int rev)
{
return (system_rev & 0xFF) - rev;
}
int dram_init(void)
{
gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
return 0;
}
#ifdef CONFIG_CMD_MMC
struct fsl_esdhc_cfg esdhc_cfg[2] = {
{MMC_SDHC1_BASE, 1, 1},
{MMC_SDHC2_BASE, 1, 1},
};
int esdhc_gpio_init(bd_t *bis)
{
s32 status = 0;
u32 index = 0;
u32 val = 0;
for (index = 0; index < CONFIG_SYS_FSL_ESDHC_NUM;
++index) {
switch (index) {
case 0:
/* Pins */
writel(0x10, IOMUXC_BASE + 0x190); /* SD1_CMD */
writel(0x10, IOMUXC_BASE + 0x194); /* SD1_CLK */
writel(0x00, IOMUXC_BASE + 0x198); /* SD1_DATA0 */
writel(0x00, IOMUXC_BASE + 0x19c); /* SD1_DATA1 */
writel(0x00, IOMUXC_BASE + 0x1a0); /* SD1_DATA2 */
writel(0x00, IOMUXC_BASE + 0x1a4); /* SD1_DATA3 */
writel(0x06, IOMUXC_BASE + 0x094); /* D12 (SD1_DATA4) */
writel(0x06, IOMUXC_BASE + 0x090); /* D13 (SD1_DATA5) */
writel(0x06, IOMUXC_BASE + 0x08c); /* D14 (SD1_DATA6) */
writel(0x06, IOMUXC_BASE + 0x088); /* D15 (SD1_DATA7) */
writel(0x05, IOMUXC_BASE + 0x010); /* A14 (SD1_WP) */
writel(0x05, IOMUXC_BASE + 0x014); /* A15 (SD1_DET) */
/* Pads */
writel(0xD1, IOMUXC_BASE + 0x388); /* SD1_CMD */
writel(0xD1, IOMUXC_BASE + 0x38c); /* SD1_CLK */
writel(0xD1, IOMUXC_BASE + 0x390); /* SD1_DATA0 */
writel(0xD1, IOMUXC_BASE + 0x394); /* SD1_DATA1 */
writel(0xD1, IOMUXC_BASE + 0x398); /* SD1_DATA2 */
writel(0xD1, IOMUXC_BASE + 0x39c); /* SD1_DATA3 */
writel(0xD1, IOMUXC_BASE + 0x28c); /* D12 (SD1_DATA4) */
writel(0xD1, IOMUXC_BASE + 0x288); /* D13 (SD1_DATA5) */
writel(0xD1, IOMUXC_BASE + 0x284); /* D14 (SD1_DATA6) */
writel(0xD1, IOMUXC_BASE + 0x280); /* D15 (SD1_DATA7) */
writel(0xD1, IOMUXC_BASE + 0x230); /* A14 (SD1_WP) */
writel(0xD1, IOMUXC_BASE + 0x234); /* A15 (SD1_DET) */
/*
* Set write protect and card detect gpio as inputs
* A14 (SD1_WP) and A15 (SD1_DET)
*/
val = ~(3 << 0) & readl(GPIO1_BASE + GPIO_GDIR);
writel(val, GPIO1_BASE + GPIO_GDIR);
break;
case 1:
/* Pins */
writel(0x16, IOMUXC_BASE + 0x0e8); /* LD8 (SD1_CMD) */
writel(0x16, IOMUXC_BASE + 0x0ec); /* LD9 (SD1_CLK) */
writel(0x06, IOMUXC_BASE + 0x0f0); /* LD10 (SD1_DATA0)*/
writel(0x06, IOMUXC_BASE + 0x0f4); /* LD11 (SD1_DATA1)*/
writel(0x06, IOMUXC_BASE + 0x0f8); /* LD12 (SD1_DATA2)*/
writel(0x06, IOMUXC_BASE + 0x0fc); /* LD13 (SD1_DATA3)*/
/* CSI_D2 (SD1_DATA4) */
writel(0x02, IOMUXC_BASE + 0x120);
/* CSI_D3 (SD1_DATA5) */
writel(0x02, IOMUXC_BASE + 0x124);
/* CSI_D4 (SD1_DATA6) */
writel(0x02, IOMUXC_BASE + 0x128);
/* CSI_D5 (SD1_DATA7) */
writel(0x02, IOMUXC_BASE + 0x12c);
/* Pads */
writel(0xD1, IOMUXC_BASE + 0x2e0); /* LD8 (SD1_CMD) */
writel(0xD1, IOMUXC_BASE + 0x2e4); /* LD9 (SD1_CLK) */
writel(0xD1, IOMUXC_BASE + 0x2e8); /* LD10 (SD1_DATA0)*/
writel(0xD1, IOMUXC_BASE + 0x2ec); /* LD11 (SD1_DATA1)*/
writel(0xD1, IOMUXC_BASE + 0x2f0); /* LD12 (SD1_DATA2)*/
writel(0xD1, IOMUXC_BASE + 0x2f4); /* LD13 (SD1_DATA3)*/
/* CSI_D2 (SD1_DATA4) */
writel(0xD1, IOMUXC_BASE + 0x318);
/* CSI_D3 (SD1_DATA5) */
writel(0xD1, IOMUXC_BASE + 0x31c);
/* CSI_D4 (SD1_DATA6) */
writel(0xD1, IOMUXC_BASE + 0x320);
/* CSI_D5 (SD1_DATA7) */
writel(0xD1, IOMUXC_BASE + 0x324);
break;
default:
printf("Warning: you configured more ESDHC controller"
"(%d) as supported by the board(2)\n",
CONFIG_SYS_FSL_ESDHC_NUM);
return status;
break;
}
status |= fsl_esdhc_initialize(bis, &esdhc_cfg[index]);
}
return 0;
}
int board_mmc_init(bd_t *bis)
{
if (!esdhc_gpio_init(bis))
return 0;
else
return -1;
}
#endif
s32 spi_get_cfg(struct imx_spi_dev_t *dev)
{
switch (dev->slave.cs) {
case 0:
/* cpld */
dev->base = CSPI1_BASE;
dev->freq = 25000000;
dev->ss_pol = IMX_SPI_ACTIVE_LOW;
dev->ss = 0;
dev->fifo_sz = 32;
dev->us_delay = 0;
break;
default:
printf("Invalid Bus ID! \n");
break;
}
return 0;
}
void spi_io_init(struct imx_spi_dev_t *dev)
{
switch (dev->base) {
case CSPI1_BASE:
writel(0, IOMUXC_BASE + 0x180); /* CSPI1 SCLK */
writel(0x1C0, IOMUXC_BASE + 0x5c4);
writel(0, IOMUXC_BASE + 0x184); /* SPI_RDY */
writel(0x1E0, IOMUXC_BASE + 0x5c8);
writel(0, IOMUXC_BASE + 0x170); /* MOSI */
writel(0x1C0, IOMUXC_BASE + 0x5b4);
writel(0, IOMUXC_BASE + 0x174); /* MISO */
writel(0x1C0, IOMUXC_BASE + 0x5b8);
writel(0, IOMUXC_BASE + 0x17C); /* SS1 */
writel(0x1E0, IOMUXC_BASE + 0x5C0);
break;
default:
break;
}
}
#ifdef CONFIG_LCD
vidinfo_t panel_info = {
vl_refresh:60,
vl_col:640,
vl_row:480,
vl_pixclock:39683,
vl_left_margin:45,
vl_right_margin:114,
vl_upper_margin:33,
vl_lower_margin:11,
vl_hsync:1,
vl_vsync:1,
vl_sync : FB_SYNC_CLK_LAT_FALL,
vl_mode:0,
vl_flag:0,
vl_bpix:4,
cmap : (void *)lcd_cmap,
};
void lcdc_hw_init(void)
{
/* Set VSTBY_REQ as GPIO3[17] on ALT5 */
mxc_request_iomux(MX25_PIN_VSTBY_REQ, MUX_CONFIG_ALT5);
/* Set GPIO3[17] as output */
writel(0x20000, GPIO3_BASE + 0x04);
/* Set GPIOE as LCDC_LD[16] on ALT2 */
mxc_request_iomux(MX25_PIN_GPIO_E, MUX_CONFIG_ALT2);
/* Set GPIOF as LCDC_LD[17] on ALT2 */
mxc_request_iomux(MX25_PIN_GPIO_F, MUX_CONFIG_ALT2);
/* Enable pull up on LCDC_LD[16] */
mxc_iomux_set_pad(MX25_PIN_GPIO_E,
PAD_CTL_PKE_ENABLE | PAD_CTL_100K_PU);
/* Enable pull up on LCDC_LD[17] */
mxc_iomux_set_pad(MX25_PIN_GPIO_F,
PAD_CTL_PKE_ENABLE | PAD_CTL_100K_PU);
/* Enable Pull/Keeper for pad LSCKL */
mxc_iomux_set_pad(MX25_PIN_LSCLK,
PAD_CTL_PKE_ENABLE | PAD_CTL_PUE_PUD |
PAD_CTL_100K_PU | PAD_CTL_SRE_FAST);
gd->fb_base = CONFIG_FB_BASE;
}
#ifdef CONFIG_SPLASH_SCREEN
int setup_splash_img()
{
#ifdef CONFIG_SPLASH_IS_IN_MMC
int mmc_dev = CONFIG_SPLASH_IMG_MMC_DEV;
ulong offset = CONFIG_SPLASH_IMG_OFFSET;
ulong size = CONFIG_SPLASH_IMG_SIZE;
ulong addr = 0;
char *s = NULL;
struct mmc *mmc = find_mmc_device(mmc_dev);
uint blk_start, blk_cnt, n;
s = getenv("splashimage");
if (NULL == s) {
puts("env splashimage not found!\n");
return -1;
}
addr = simple_strtoul(s, NULL, 16);
if (!mmc) {
printf("MMC Device %d not found\n",
mmc_dev);
return -1;
}
if (mmc_init(mmc)) {
puts("MMC init failed\n");
return -1;
}
blk_start = ALIGN(offset, mmc->read_bl_len) / mmc->read_bl_len;
blk_cnt = ALIGN(size, mmc->read_bl_len) / mmc->read_bl_len;
n = mmc->block_dev.block_read(mmc_dev, blk_start,
blk_cnt, (u_char *)addr);
flush_cache((ulong)addr, blk_cnt * mmc->read_bl_len);
return (n == blk_cnt) ? 0 : -1;
#endif
}
#endif
#endif
#ifdef CONFIG_GET_FEC_MAC_ADDR_FROM_IIM
int fec_get_mac_addr(unsigned char *mac)
{
u32 *iim0_mac_base =
(u32 *)(IIM_BASE + IIM_BANK_AREA_0_OFFSET +
CONFIG_IIM_MAC_ADDR_OFFSET);
int i;
for (i = 0; i < 6; ++i, ++iim0_mac_base)
mac[i] = readl(iim0_mac_base);
return 0;
}
#endif
int board_init(void)
{
#ifdef CONFIG_MFG
/* MFG firmware need reset usb to avoid host crash firstly */
#define USBCMD 0x140
int val = readl(USB_BASE + USBCMD);
val &= ~0x1; /*RS bit*/
writel(val, USB_BASE + USBCMD);
#endif
setup_soc_rev();
/* setup pins for UART1 */
/* UART 1 IOMUX Configs */
mxc_request_iomux(MX25_PIN_UART1_RXD, MUX_CONFIG_FUNC);
mxc_request_iomux(MX25_PIN_UART1_TXD, MUX_CONFIG_FUNC);
mxc_request_iomux(MX25_PIN_UART1_RTS, MUX_CONFIG_FUNC);
mxc_request_iomux(MX25_PIN_UART1_CTS, MUX_CONFIG_FUNC);
mxc_iomux_set_pad(MX25_PIN_UART1_RXD,
PAD_CTL_HYS_SCHMITZ | PAD_CTL_PKE_ENABLE |
PAD_CTL_PUE_PUD | PAD_CTL_100K_PU);
mxc_iomux_set_pad(MX25_PIN_UART1_TXD,
PAD_CTL_PUE_PUD | PAD_CTL_100K_PD);
mxc_iomux_set_pad(MX25_PIN_UART1_RTS,
PAD_CTL_HYS_SCHMITZ | PAD_CTL_PKE_ENABLE |
PAD_CTL_PUE_PUD | PAD_CTL_100K_PU);
mxc_iomux_set_pad(MX25_PIN_UART1_CTS,
PAD_CTL_PUE_PUD | PAD_CTL_100K_PD);
/* setup pins for FEC */
mxc_request_iomux(MX25_PIN_FEC_TX_CLK, MUX_CONFIG_FUNC);
mxc_request_iomux(MX25_PIN_FEC_RX_DV, MUX_CONFIG_FUNC);
mxc_request_iomux(MX25_PIN_FEC_RDATA0, MUX_CONFIG_FUNC);
mxc_request_iomux(MX25_PIN_FEC_TDATA0, MUX_CONFIG_FUNC);
mxc_request_iomux(MX25_PIN_FEC_TX_EN, MUX_CONFIG_FUNC);
mxc_request_iomux(MX25_PIN_FEC_MDC, MUX_CONFIG_FUNC);
mxc_request_iomux(MX25_PIN_FEC_MDIO, MUX_CONFIG_FUNC);
mxc_request_iomux(MX25_PIN_FEC_RDATA1, MUX_CONFIG_FUNC);
mxc_request_iomux(MX25_PIN_FEC_TDATA1, MUX_CONFIG_FUNC);
mxc_request_iomux(MX25_PIN_POWER_FAIL, MUX_CONFIG_FUNC); /* PHY INT */
#define FEC_PAD_CTL1 (PAD_CTL_HYS_SCHMITZ | PAD_CTL_PUE_PUD | \
PAD_CTL_PKE_ENABLE)
#define FEC_PAD_CTL2 (PAD_CTL_PUE_PUD)
mxc_iomux_set_pad(MX25_PIN_FEC_TX_CLK, FEC_PAD_CTL1);
mxc_iomux_set_pad(MX25_PIN_FEC_RX_DV, FEC_PAD_CTL1);
mxc_iomux_set_pad(MX25_PIN_FEC_RDATA0, FEC_PAD_CTL1);
mxc_iomux_set_pad(MX25_PIN_FEC_TDATA0, FEC_PAD_CTL2);
mxc_iomux_set_pad(MX25_PIN_FEC_TX_EN, FEC_PAD_CTL2);
mxc_iomux_set_pad(MX25_PIN_FEC_MDC, FEC_PAD_CTL2);
mxc_iomux_set_pad(MX25_PIN_FEC_MDIO, FEC_PAD_CTL1 | PAD_CTL_22K_PU);
mxc_iomux_set_pad(MX25_PIN_FEC_RDATA1, FEC_PAD_CTL1);
mxc_iomux_set_pad(MX25_PIN_FEC_TDATA1, FEC_PAD_CTL2);
mxc_iomux_set_pad(MX25_PIN_POWER_FAIL, FEC_PAD_CTL1);
/*
* Set up the FEC_RESET_B and FEC_ENABLE GPIO pins.
* Assert FEC_RESET_B, then power up the PHY by asserting
* FEC_ENABLE, at the same time lifting FEC_RESET_B.
*
* FEC_RESET_B: gpio2[3] is ALT 5 mode of pin D12
* FEC_ENABLE_B: gpio4[8] is ALT 5 mode of pin A17
*/
mxc_request_iomux(MX25_PIN_A17, MUX_CONFIG_ALT5); /* FEC_EN */
mxc_request_iomux(MX25_PIN_D12, MUX_CONFIG_ALT5); /* FEC_RESET_B */
mxc_iomux_set_pad(MX25_PIN_A17, PAD_CTL_ODE_OpenDrain);
mxc_iomux_set_pad(MX25_PIN_D12, 0);
mxc_set_gpio_direction(MX25_PIN_A17, 0); /* FEC_EN */
mxc_set_gpio_direction(MX25_PIN_D12, 0); /* FEC_RESET_B */
/* drop PHY power */
mxc_set_gpio_dataout(MX25_PIN_A17, 0); /* FEC_EN */
/* assert reset */
mxc_set_gpio_dataout(MX25_PIN_D12, 0); /* FEC_RESET_B */
udelay(2); /* spec says 1us min */
/* turn on PHY power and lift reset */
mxc_set_gpio_dataout(MX25_PIN_A17, 1); /* FEC_EN */
mxc_set_gpio_dataout(MX25_PIN_D12, 1); /* FEC_RESET_B */
#define I2C_PAD_CTL (PAD_CTL_HYS_SCHMITZ | PAD_CTL_PKE_ENABLE | \
PAD_CTL_PUE_PUD | PAD_CTL_100K_PU | PAD_CTL_ODE_OpenDrain)
mxc_request_iomux(MX25_PIN_I2C1_CLK, MUX_CONFIG_SION);
mxc_request_iomux(MX25_PIN_I2C1_DAT, MUX_CONFIG_SION);
mxc_iomux_set_pad(MX25_PIN_I2C1_CLK, 0x1E8);
mxc_iomux_set_pad(MX25_PIN_I2C1_DAT, 0x1E8);
#ifdef CONFIG_LCD
lcdc_hw_init();
#endif
gd->bd->bi_arch_number = MACH_TYPE_MX25_3DS; /* board id for linux */
gd->bd->bi_boot_params = 0x80000100; /* address of boot parameters */
return 0;
#undef FEC_PAD_CTL1
#undef FEC_PAD_CTL2
#undef I2C_PAD_CTL
}
#ifdef BOARD_LATE_INIT
int board_late_init(void)
{
u8 reg[4];
/* Turn PMIC On*/
reg[0] = 0x09;
i2c_write(0x54, 0x02, 1, reg, 1);
#ifdef CONFIG_IMX_SPI_CPLD
mxc_cpld_spi_init();
#endif
#ifdef CONFIG_SPLASH_SCREEN
if (!setup_splash_img())
printf("Read splash screen failed!\n");
#endif
return 0;
}
#endif
int checkboard(void)
{
printf("Board: i.MX25 MAX PDK (3DS)\n");
return 0;
}
int board_eth_init(bd_t *bis)
{
int rc = -ENODEV;
#if defined(CONFIG_SMC911X)
rc = smc911x_initialize(0, CONFIG_SMC911X_BASE);
#endif
cpu_eth_init(bis);
return rc;
}

View File

@ -0,0 +1,62 @@
/*
* (c) Copyright 2009 Freescale Semiconductor
*
* January 2004 - Changed to support H4 device
* Copyright (c) 2004 Texas Instruments
*
* (C) Copyright 2002
* Gary Jennejohn, DENX Software Engineering, <gj@denx.de>
*
* See file CREDITS for list of people who contributed to this
* project.
*
* 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.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
*/
OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
OUTPUT_ARCH(arm)
ENTRY(_start)
SECTIONS
{
. = 0x00000000;
. = ALIGN(4);
.text :
{
board/freescale/mx25_3stack/dcdheader.o (.text)
cpu/arm926ejs/start.o (.text)
*(.text)
}
. = ALIGN(4);
.rodata : { *(.rodata) }
. = ALIGN(4);
.data : { *(.data) }
. = ALIGN(4);
.got : { *(.got) }
. = .;
__u_boot_cmd_start = .;
.u_boot_cmd : { *(.u_boot_cmd) }
__u_boot_cmd_end = .;
. = ALIGN(4);
__bss_start = .;
.bss : { *(.bss) }
_end = .;
}

View File

@ -0,0 +1,52 @@
#
# (C) Copyright 2000-2006
# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
#
# See file CREDITS for list of people who contributed to this
# project.
#
# 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.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
# MA 02111-1307 USA
#
include $(TOPDIR)/config.mk
LIB = $(obj)lib$(BOARD).a
COBJS := mx28_evk.o
SOBJS := lowlevel_init.o
SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c)
OBJS := $(addprefix $(obj),$(COBJS))
SOBJS := $(addprefix $(obj),$(SOBJS))
$(LIB): $(obj).depend $(OBJS) $(SOBJS)
$(AR) $(ARFLAGS) $@ $(OBJS) $(SOBJS)
clean:
rm -f $(SOBJS) $(OBJS)
distclean: clean
rm -f $(LIB) core *.bak $(obj).depend
#########################################################################
# defines $(obj).depend target
include $(SRCTREE)/rules.mk
sinclude $(obj).depend
#########################################################################

View File

@ -0,0 +1,6 @@
#
# image should be loaded at 0x41008000
#
LDSCRIPT := $(SRCTREE)/board/$(VENDOR)/$(BOARD)/u-boot.lds
TEXT_BASE = 0x41008000

View File

@ -0,0 +1,33 @@
/*
* Board specific setup info
*
* Copyright (C) 2010-2011 Freescale Semiconductor, Inc.
*
* See file CREDITS for list of people who contributed to this
* project.
*
* 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.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
*/
#include <config.h>
#include <version.h>
/* Set up the platform, once the cpu has been initialized */
.globl lowlevel_init
lowlevel_init:
/* All SDRAM settings are done by sdram_prep */
mov pc, lr

View File

@ -0,0 +1,287 @@
/*
* Copyright (C) 2010 Freescale Semiconductor, Inc.
*
* See file CREDITS for list of people who contributed to this
* project.
*
* 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.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
*/
#include <common.h>
#include <asm/arch/regs-pinctrl.h>
#include <asm/arch/pinctrl.h>
#include <asm/arch/regs-clkctrl.h>
#include <asm/arch/regs-ocotp.h>
#include <mmc.h>
#include <imx_ssp_mmc.h>
/* This should be removed after it's added into mach-types.h */
#ifndef MACH_TYPE_MX28EVK
#define MACH_TYPE_MX28EVK 2531
#endif
DECLARE_GLOBAL_DATA_PTR;
#ifdef CONFIG_IMX_SSP_MMC
/* MMC pins */
static struct pin_desc mmc0_pins_desc[] = {
{ PINID_SSP0_DATA0, PIN_FUN1, PAD_8MA, PAD_3V3, 1 },
{ PINID_SSP0_DATA1, PIN_FUN1, PAD_8MA, PAD_3V3, 1 },
{ PINID_SSP0_DATA2, PIN_FUN1, PAD_8MA, PAD_3V3, 1 },
{ PINID_SSP0_DATA3, PIN_FUN1, PAD_8MA, PAD_3V3, 1 },
{ PINID_SSP0_DATA4, PIN_FUN1, PAD_8MA, PAD_3V3, 1 },
{ PINID_SSP0_DATA5, PIN_FUN1, PAD_8MA, PAD_3V3, 1 },
{ PINID_SSP0_DATA6, PIN_FUN1, PAD_8MA, PAD_3V3, 1 },
{ PINID_SSP0_DATA7, PIN_FUN1, PAD_8MA, PAD_3V3, 1 },
{ PINID_SSP0_CMD, PIN_FUN1, PAD_8MA, PAD_3V3, 1 },
{ PINID_SSP0_DETECT, PIN_FUN1, PAD_8MA, PAD_3V3, 1 },
{ PINID_SSP0_SCK, PIN_FUN1, PAD_8MA, PAD_3V3, 1 },
};
static struct pin_desc mmc1_pins_desc[] = {
{ PINID_GPMI_D00, PIN_FUN2, PAD_8MA, PAD_3V3, 1 },
{ PINID_GPMI_D01, PIN_FUN2, PAD_8MA, PAD_3V3, 1 },
{ PINID_GPMI_D02, PIN_FUN2, PAD_8MA, PAD_3V3, 1 },
{ PINID_GPMI_D03, PIN_FUN2, PAD_8MA, PAD_3V3, 1 },
{ PINID_GPMI_D04, PIN_FUN2, PAD_8MA, PAD_3V3, 1 },
{ PINID_GPMI_D05, PIN_FUN2, PAD_8MA, PAD_3V3, 1 },
{ PINID_GPMI_D06, PIN_FUN2, PAD_8MA, PAD_3V3, 1 },
{ PINID_GPMI_D07, PIN_FUN2, PAD_8MA, PAD_3V3, 1 },
{ PINID_GPMI_RDY1, PIN_FUN2, PAD_8MA, PAD_3V3, 1 },
{ PINID_GPMI_RDY0, PIN_FUN2, PAD_8MA, PAD_3V3, 1 },
{ PINID_GPMI_WRN, PIN_FUN2, PAD_8MA, PAD_3V3, 1 }
};
static struct pin_group mmc0_pins = {
.pins = mmc0_pins_desc,
.nr_pins = ARRAY_SIZE(mmc0_pins_desc)
};
static struct pin_group mmc1_pins = {
.pins = mmc1_pins_desc,
.nr_pins = ARRAY_SIZE(mmc1_pins_desc)
};
struct imx_ssp_mmc_cfg ssp_mmc_cfg[2] = {
{REGS_SSP0_BASE, HW_CLKCTRL_SSP0, BM_CLKCTRL_CLKSEQ_BYPASS_SSP0},
{REGS_SSP1_BASE, HW_CLKCTRL_SSP1, BM_CLKCTRL_CLKSEQ_BYPASS_SSP1},
};
#endif
/* ENET pins */
static struct pin_desc enet_pins_desc[] = {
{ PINID_ENET0_MDC, PIN_FUN1, PAD_8MA, PAD_3V3, 1 },
{ PINID_ENET0_MDIO, PIN_FUN1, PAD_8MA, PAD_3V3, 1 },
{ PINID_ENET0_RX_EN, PIN_FUN1, PAD_8MA, PAD_3V3, 1 },
{ PINID_ENET0_RXD0, PIN_FUN1, PAD_8MA, PAD_3V3, 1 },
{ PINID_ENET0_RXD1, PIN_FUN1, PAD_8MA, PAD_3V3, 1 },
{ PINID_ENET0_TX_EN, PIN_FUN1, PAD_8MA, PAD_3V3, 1 },
{ PINID_ENET0_TXD0, PIN_FUN1, PAD_8MA, PAD_3V3, 1 },
{ PINID_ENET0_TXD1, PIN_FUN1, PAD_8MA, PAD_3V3, 1 },
{ PINID_ENET_CLK, PIN_FUN1, PAD_8MA, PAD_3V3, 1 }
};
/* Gpmi pins */
static struct pin_desc gpmi_pins_desc[] = {
{ PINID_GPMI_D00, PIN_FUN1, PAD_4MA, PAD_3V3, 0 },
{ PINID_GPMI_D01, PIN_FUN1, PAD_4MA, PAD_3V3, 0 },
{ PINID_GPMI_D02, PIN_FUN1, PAD_4MA, PAD_3V3, 0 },
{ PINID_GPMI_D03, PIN_FUN1, PAD_4MA, PAD_3V3, 0 },
{ PINID_GPMI_D04, PIN_FUN1, PAD_4MA, PAD_3V3, 0 },
{ PINID_GPMI_D05, PIN_FUN1, PAD_4MA, PAD_3V3, 0 },
{ PINID_GPMI_D06, PIN_FUN1, PAD_4MA, PAD_3V3, 0 },
{ PINID_GPMI_D07, PIN_FUN1, PAD_4MA, PAD_3V3, 0 },
{ PINID_GPMI_RDN, PIN_FUN1, PAD_8MA, PAD_1V8, 1 },
{ PINID_GPMI_WRN, PIN_FUN1, PAD_4MA, PAD_3V3, 0 },
{ PINID_GPMI_ALE, PIN_FUN1, PAD_4MA, PAD_3V3, 0 },
{ PINID_GPMI_CLE, PIN_FUN1, PAD_4MA, PAD_3V3, 0 },
{ PINID_GPMI_RDY0, PIN_FUN1, PAD_4MA, PAD_3V3, 0 },
{ PINID_GPMI_RDY1, PIN_FUN1, PAD_4MA, PAD_3V3, 0 },
{ PINID_GPMI_CE0N, PIN_FUN1, PAD_4MA, PAD_3V3, 0 },
{ PINID_GPMI_CE1N, PIN_FUN1, PAD_4MA, PAD_3V3, 0 },
{ PINID_GPMI_RESETN, PIN_FUN1, PAD_4MA, PAD_3V3, 0 }
};
static struct pin_group enet_pins = {
.pins = enet_pins_desc,
.nr_pins = ARRAY_SIZE(enet_pins_desc)
};
static struct pin_group gpmi_pins = {
.pins = gpmi_pins_desc,
.nr_pins = ARRAY_SIZE(gpmi_pins_desc)
};
/*
* Functions
*/
int board_init(void)
{
/* Will change it for MX28 EVK later */
gd->bd->bi_arch_number = MACH_TYPE_MX28EVK;
/* Adress of boot parameters */
gd->bd->bi_boot_params = PHYS_SDRAM_1 + 0x100;
#ifdef CONFIG_NAND_GPMI
setup_gpmi_nand();
#endif
return 0;
}
int dram_init(void)
{
gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
return 0;
}
#ifdef CONFIG_IMX_SSP_MMC
#ifdef CONFIG_DYNAMIC_MMC_DEVNO
int get_mmc_env_devno()
{
unsigned long global_boot_mode;
global_boot_mode = REG_RD_ADDR(GLOBAL_BOOT_MODE_ADDR);
return ((global_boot_mode & 0xf) == BOOT_MODE_SD1) ? 1 : 0;
}
#endif
#define PINID_SSP0_GPIO_WP PINID_SSP1_SCK
#define PINID_SSP1_GPIO_WP PINID_GPMI_RESETN
u32 ssp_mmc_is_wp(struct mmc *mmc)
{
return (mmc->block_dev.dev == 0) ?
pin_gpio_get(PINID_SSP0_GPIO_WP) :
pin_gpio_get(PINID_SSP1_GPIO_WP);
}
int ssp_mmc_gpio_init(bd_t *bis)
{
s32 status = 0;
u32 index = 0;
for (index = 0; index < CONFIG_SYS_SSP_MMC_NUM;
++index) {
switch (index) {
case 0:
/* Set up MMC pins */
pin_set_group(&mmc0_pins);
/* Power on the card slot 0 */
pin_set_type(PINID_PWM3, PIN_GPIO);
pin_gpio_direction(PINID_PWM3, 1);
pin_gpio_set(PINID_PWM3, 0);
/* Wait 10 ms for card ramping up */
udelay(10000);
/* Set up SD0 WP pin */
pin_set_type(PINID_SSP0_GPIO_WP, PIN_GPIO);
pin_gpio_direction(PINID_SSP0_GPIO_WP, 0);
break;
case 1:
#ifdef CONFIG_CMD_MMC
/* Set up MMC pins */
pin_set_group(&mmc1_pins);
/* Power on the card slot 1 */
pin_set_type(PINID_PWM4, PIN_GPIO);
pin_gpio_direction(PINID_PWM4, 1);
pin_gpio_set(PINID_PWM4, 0);
/* Wait 10 ms for card ramping up */
udelay(10000);
/* Set up SD1 WP pin */
pin_set_type(PINID_SSP1_GPIO_WP, PIN_GPIO);
pin_gpio_direction(PINID_SSP1_GPIO_WP, 0);
#endif
break;
default:
printf("Warning: you configured more ssp mmc controller"
"(%d) as supported by the board(2)\n",
CONFIG_SYS_SSP_MMC_NUM);
return status;
}
status |= imx_ssp_mmc_initialize(bis, &ssp_mmc_cfg[index]);
}
return status;
}
int board_mmc_init(bd_t *bis)
{
if (!ssp_mmc_gpio_init(bis))
return 0;
else
return -1;
}
#endif
#ifdef CONFIG_MXC_FEC
#ifdef CONFIG_GET_FEC_MAC_ADDR_FROM_IIM
int fec_get_mac_addr(unsigned char *mac)
{
u32 val;
/*set this bit to open the OTP banks for reading*/
REG_WR(REGS_OCOTP_BASE, HW_OCOTP_CTRL_SET,
BM_OCOTP_CTRL_RD_BANK_OPEN);
/*wait until OTP contents are readable*/
while (BM_OCOTP_CTRL_BUSY & REG_RD(REGS_OCOTP_BASE, HW_OCOTP_CTRL))
udelay(100);
mac[0] = 0x00;
mac[1] = 0x04;
val = REG_RD(REGS_OCOTP_BASE, HW_OCOTP_CUSTn(0));
mac[2] = (val >> 24) & 0xFF;
mac[3] = (val >> 16) & 0xFF;
mac[4] = (val >> 8) & 0xFF;
mac[5] = (val >> 0) & 0xFF;
return 0;
}
#endif
#endif
void enet_board_init(void)
{
/* Set up ENET pins */
pin_set_group(&enet_pins);
/* Power on the external phy */
pin_set_type(PINID_SSP1_DATA3, PIN_GPIO);
pin_gpio_direction(PINID_SSP1_DATA3, 1);
pin_gpio_set(PINID_SSP1_DATA3, 0);
/* Reset the external phy */
pin_set_type(PINID_ENET0_RX_CLK, PIN_GPIO);
pin_gpio_direction(PINID_ENET0_RX_CLK, 1);
pin_gpio_set(PINID_ENET0_RX_CLK, 0);
udelay(200);
pin_gpio_set(PINID_ENET0_RX_CLK, 1);
}
#ifdef CONFIG_NAND_GPMI
void setup_gpmi_nand()
{
/* Set up GPMI pins */
pin_set_group(&gpmi_pins);
}
#endif

View File

@ -0,0 +1,51 @@
/*
* (C) Copyright 2002
* Gary Jennejohn, DENX Software Engineering, <gj@denx.de>
*
* See file CREDITS for list of people who contributed to this
* project.
*
* 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.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
*/
OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
OUTPUT_ARCH(arm)
ENTRY(_start)
SECTIONS
{
. = 0x00000000;
. = ALIGN(4);
.text :
{
cpu/arm926ejs/start.o (.text)
*(.text)
}
.rodata : { *(.rodata) }
. = ALIGN(4);
.data : { *(.data) }
. = ALIGN(4);
.got : { *(.got) }
. = .;
__u_boot_cmd_start = .;
.u_boot_cmd : { *(.u_boot_cmd) }
__u_boot_cmd_end = .;
. = ALIGN(4);
__bss_start = .;
.bss (NOLOAD) : { *(.bss) }
_end = .;
}

View File

@ -0,0 +1,47 @@
#
# Copyright (C) 2008, Guennadi Liakhovetski <lg@denx.de>
#
# 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.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
# MA 02111-1307 USA
#
include $(TOPDIR)/config.mk
LIB = $(obj)lib$(BOARD).a
COBJS := mx31_3stack.o
SOBJS := lowlevel_init.o
SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c)
OBJS := $(addprefix $(obj),$(COBJS))
SOBJS := $(addprefix $(obj),$(SOBJS))
$(LIB): $(obj).depend $(OBJS) $(SOBJS)
$(AR) $(ARFLAGS) $@ $(OBJS) $(SOBJS)
clean:
rm -f $(SOBJS) $(OBJS)
distclean: clean
rm -f $(LIB) core *.bak .depend
#########################################################################
# defines $(obj).depend target
include $(SRCTREE)/rules.mk
sinclude $(obj).depend
#########################################################################

View File

@ -0,0 +1,3 @@
LDSCRIPT := $(SRCTREE)/board/$(VENDOR)/$(BOARD)/u-boot.lds
TEXT_BASE = 0x87f00000

View File

@ -0,0 +1,248 @@
/*
* Copyright (C) 2008, Guennadi Liakhovetski <lg@denx.de>
* Copyright (C) 2008, Freescale Semiconductor
* Modifications for MX31 3Stack board
*
* 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.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
*/
#include <asm/arch/mx31-regs.h>
.macro REG reg, val
ldr r2, =\reg
ldr r3, =\val
str r3, [r2]
.endm
.macro REG8 reg, val
ldr r2, =\reg
ldr r3, =\val
strb r3, [r2]
.endm
.macro DELAY loops
ldr r2, =\loops
1:
subs r2, r2, #1
nop
bcs 1b
.endm
.macro init_aips
/*
* Set all MPROTx to be non-bufferable, trusted for R/W,
* not forced to user-mode.
*/
ldr r0, =0x43F00000
ldr r1, =0x77777777
str r1, [r0, #0x00]
str r1, [r0, #0x04]
ldr r0, =0x53F00000
str r1, [r0, #0x00]
str r1, [r0, #0x04]
/*
* Clear the on and off peripheral modules Supervisor Protect bit
* for SDMA to access them. Did not change the AIPS control registers
* (offset 0x20) access type
*/
ldr r0, =0x43F00000
ldr r1, =0x0
str r1, [r0, #0x40]
str r1, [r0, #0x44]
str r1, [r0, #0x48]
str r1, [r0, #0x4C]
ldr r1, [r0, #0x50]
and r1, r1, #0x00FFFFFF
str r1, [r0, #0x50]
ldr r0, =0x53F00000
ldr r1, =0x0
str r1, [r0, #0x40]
str r1, [r0, #0x44]
str r1, [r0, #0x48]
str r1, [r0, #0x4C]
ldr r1, [r0, #0x50]
and r1, r1, #0x00FFFFFF
str r1, [r0, #0x50]
.endm /* init_aips */
.macro init_max
ldr r0, =0x43F04000
/* MPR - priority is M4 > M2 > M3 > M5 > M0 > M1 */
ldr r1, =0x00302154
str r1, [r0, #0x000] /* for S0 */
str r1, [r0, #0x100] /* for S1 */
str r1, [r0, #0x200] /* for S2 */
str r1, [r0, #0x300] /* for S3 */
str r1, [r0, #0x400] /* for S4 */
/* SGPCR - always park on last master */
ldr r1, =0x10
str r1, [r0, #0x010] /* for S0 */
str r1, [r0, #0x110] /* for S1 */
str r1, [r0, #0x210] /* for S2 */
str r1, [r0, #0x310] /* for S3 */
str r1, [r0, #0x410] /* for S4 */
/* MGPCR - restore default values */
ldr r1, =0x0
str r1, [r0, #0x800] /* for M0 */
str r1, [r0, #0x900] /* for M1 */
str r1, [r0, #0xA00] /* for M2 */
str r1, [r0, #0xB00] /* for M3 */
str r1, [r0, #0xC00] /* for M4 */
str r1, [r0, #0xD00] /* for M5 */
.endm /* init_max */
.macro init_m3if
/* Configure M3IF registers */
ldr r1, =0xB8003000
/*
* M3IF Control Register (M3IFCTL)
* MRRP[0] = L2CC0 not on priority list (0 << 0) = 0x00000000
* MRRP[1] = L2CC1 not on priority list (0 << 0) = 0x00000000
* MRRP[2] = MBX not on priority list (0 << 0) = 0x00000000
* MRRP[3] = MAX1 not on priority list (0 << 0) = 0x00000000
* MRRP[4] = SDMA not on priority list (0 << 0) = 0x00000000
* MRRP[5] = MPEG4 not on priority list (0 << 0) = 0x00000000
* MRRP[6] = IPU1 on priority list (1 << 6) = 0x00000040
* MRRP[7] = IPU2 not on priority list (0 << 0) = 0x00000000
* ------------
* 0x00000040
*/
ldr r0, =0x00000040
str r0, [r1] /* M3IF control reg */
.endm /* init_m3if */
.macro init_drive_strength
/*
* Disable maximum drive strength SDRAM/DDR lines by clearing DSE1 bits
* in SW_PAD_CTL registers
*/
/* SDCLK */
ldr r1, =0x43FAC200
ldr r0, [r1, #0x6C]
bic r0, r0, #(1 << 12)
str r0, [r1, #0x6C]
/* CAS */
ldr r0, [r1, #0x70]
bic r0, r0, #(1 << 22)
str r0, [r1, #0x70]
/* RAS */
ldr r0, [r1, #0x74]
bic r0, r0, #(1 << 2)
str r0, [r1, #0x74]
/* CS2 (CSD0) */
ldr r0, [r1, #0x7C]
bic r0, r0, #(1 << 22)
str r0, [r1, #0x7C]
/* DQM3 */
ldr r0, [r1, #0x84]
bic r0, r0, #(1 << 22)
str r0, [r1, #0x84]
/* DQM2, DQM1, DQM0, SD31-SD0, A25-A0, MA10 (0x288..0x2DC) */
ldr r2, =22 /* (0x2E0 - 0x288) / 4 = 22 */
pad_loop:
ldr r0, [r1, #0x88]
bic r0, r0, #(1 << 22)
bic r0, r0, #(1 << 12)
bic r0, r0, #(1 << 2)
str r0, [r1, #0x88]
add r1, r1, #4
subs r2, r2, #0x1
bne pad_loop
.endm /* init_drive_strength */
.section ".text.init", "x"
.globl lowlevel_init
lowlevel_init:
ldr r0, =0x40000015 /* start from AIPS 2GB region */
mcr p15, 0, r0, c15, c2, 4
init_aips
init_max
init_m3if
init_drive_strength
/* Image Processing Unit: */
/* Too early to switch display on? */
REG IPU_CONF, IPU_CONF_DI_EN
/* Clock Control Module: */
REG CCM_CCMR, 0x074B0BF5 /* Use CKIH, MCU PLL off */
DELAY 0x40000
REG CCM_CCMR, 0x074B0BF5 | CCMR_MPE /* MCU PLL on */
/* Switch to MCU PLL */
REG CCM_CCMR, (0x074B0BF5 | CCMR_MPE) & ~CCMR_MDS
/* 532-133-66.5 */
ldr r0, =CCM_BASE
ldr r1, =0xFF871D58
/* PDR0 */
str r1, [r0, #0x4]
ldr r1, MPCTL_PARAM_532
/* MPCTL */
str r1, [r0, #0x10]
/* Set UPLL=240MHz, USB=60MHz */
ldr r1, =0x49FCFE7F
/* PDR1 */
str r1, [r0, #0x8]
ldr r1, UPCTL_PARAM_240
/* UPCTL */
str r1, [r0, #0x14]
/* default CLKO to 1/8 of the ARM core */
mov r1, #0x000002C0
add r1, r1, #0x00000006
/* COSR */
str r1, [r0, #0x1c]
/* initial CSD0 MDDR */
REG 0xB8001004, 0x0075E73A
REG 0xB8001010, 0x00000002 /* reset */
REG 0xB8001010, 0x00000004
DELAY 0x10000
REG 0xB8001000, 0x92100000
REG 0x80000F00, 0x0
REG 0xB8001000, 0xA2100000
REG 0x80000000, 0x0
REG 0xB8001000, 0xB2100000
REG8 0x80000033, 0x0
REG8 0x81000000, 0xff
REG 0xB8001000, 0x82226080
REG 0x80000000, 0x0
REG 0xB8001010, 0x0000000c
mov r13, ip
/* copy blocks of total uboot to DDR */
b mxc_nand_load
MPCTL_PARAM_532:
.word (((1-1) << 26) + ((52-1) << 16) + (10 << 10) + (12 << 0))
UPCTL_PARAM_240:
.word (((2-1) << 26) + ((13-1) << 16) + (9 << 10) + (3 << 0))

View File

@ -0,0 +1,75 @@
/*
* Copyright (C) 2008, Guennadi Liakhovetski <lg@denx.de>
* Copyright 2008-2009 Freescale Semiconductor, Inc. All Rights Reserved.
* Modifications for MX31 3Stack board
*
* See file CREDITS for list of people who contributed to this
* project.
*
* 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.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
*/
#include <common.h>
#include <asm/io.h>
#include <asm/arch/mx31.h>
#include <asm/arch/mx31-regs.h>
DECLARE_GLOBAL_DATA_PTR;
int dram_init(void)
{
gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
return 0;
}
int board_init(void)
{
/* CS5: Debug board for ethernet */
__REG(CSCR_U(5)) = 0x0000D843;
__REG(CSCR_L(5)) = 0x22252521;
__REG(CSCR_A(5)) = 0x22220A00;
/* setup pins for UART1 */
mx31_gpio_mux(MUX_RXD1__UART1_RXD_MUX);
mx31_gpio_mux(MUX_TXD1__UART1_TXD_MUX);
mx31_gpio_mux(MUX_RTS1__UART1_RTS_B);
mx31_gpio_mux(MUX_CTS1__UART1_CTS_B);
/* SPI2 */
mx31_gpio_mux((MUX_CTL_FUNC << 8) | MUX_CTL_CSPI2_SS2);
mx31_gpio_mux((MUX_CTL_FUNC << 8) | MUX_CTL_CSPI2_SCLK);
mx31_gpio_mux((MUX_CTL_FUNC << 8) | MUX_CTL_CSPI2_SPI_RDY);
mx31_gpio_mux((MUX_CTL_FUNC << 8) | MUX_CTL_CSPI2_MOSI);
mx31_gpio_mux((MUX_CTL_FUNC << 8) | MUX_CTL_CSPI2_MISO);
mx31_gpio_mux((MUX_CTL_FUNC << 8) | MUX_CTL_CSPI2_SS0);
mx31_gpio_mux((MUX_CTL_FUNC << 8) | MUX_CTL_CSPI2_SS1);
/* start SPI2 clock */
__REG(CCM_CGR2) = __REG(CCM_CGR2) | (3 << 4);
gd->bd->bi_arch_number = MACH_TYPE_MX31_3DS; /* board id for linux */
gd->bd->bi_boot_params = 0x80000100; /* adress of boot parameters */
return 0;
}
int checkboard(void)
{
printf("Board: MX31 3Stack\n");
return 0;
}

View File

@ -0,0 +1,72 @@
/*
* Copyright 2008 Freescale Semiconductor, Inc. All Rights Reserved.
*
* (C) Copyright 2002
* Gary Jennejohn, DENX Software Engineering, <gj@denx.de>
*
* See file CREDITS for list of people who contributed to this
* project.
*
* 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.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
*/
OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
OUTPUT_ARCH(arm)
ENTRY(reset)
SECTIONS
{
. = 0x00000000;
. = ALIGN(4);
.text :
{
/* WARNING - the following is hand-optimized to fit within */
/* the sector layout of our flash chips! XXX FIXME XXX */
* (.text.head) /* arm reset handler */
* (.text.init) /* lowlevel initial */
* (.text.load) /* nand copy and load */
* (.text.setup)
board/freescale/mx31_3stack/libmx31_3stack.a (.text)
lib_arm/libarm.a (.text)
net/libnet.a (.text)
drivers/mtd/libmtd.a (.text)
. = DEFINED(env_offset) ? env_offset : .;
common/env_embedded.o(.text)
*(.text)
}
. = ALIGN(4);
.rodata : { *(.rodata) }
. = ALIGN(4);
.data : { *(.data) }
. = ALIGN(4);
.got : { *(.got) }
. = .;
__u_boot_cmd_start = .;
.u_boot_cmd : { *(.u_boot_cmd) }
__u_boot_cmd_end = .;
. = ALIGN(4);
__bss_start = .;
.bss : { *(.bss) }
_end = .;
}

View File

@ -0,0 +1,50 @@
#
# Copyright (C) 2007, Guennadi Liakhovetski <lg@denx.de>
#
# (C) Copyright 2008-2009 Freescale Semiconductor, Inc.
#
# 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.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
# MA 02111-1307 USA
#
include $(TOPDIR)/config.mk
LIB = $(obj)lib$(BOARD).a
COBJS := mx35_3stack.o
SOBJS := lowlevel_init.o
SOBJS += flash_header.o
SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c)
OBJS := $(addprefix $(obj),$(COBJS))
SOBJS := $(addprefix $(obj),$(SOBJS))
$(LIB): $(obj).depend $(OBJS) $(SOBJS)
$(AR) $(ARFLAGS) $@ $(OBJS) $(SOBJS)
clean:
rm -f $(SOBJS) $(OBJS)
distclean: clean
rm -f $(LIB) core *.bak .depend
#########################################################################
# defines $(obj).depend target
include $(SRCTREE)/rules.mk
sinclude $(obj).depend
#########################################################################

View File

@ -0,0 +1,123 @@
/*
*
* (c) 2007 Pengutronix, Sascha Hauer <s.hauer@pengutronix.de>
*
* (C) Copyright 2008-2011 Freescale Semiconductor, Inc.
*
* See file CREDITS for list of people who contributed to this
* project.
*
* 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.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
*/
#ifndef __BOARD_MX35_3STACK_H
#define __BOARD_MX35_3STACK_H
#define UNALIGNED_ACCESS_ENABLE
#define LOW_INT_LATENCY_ENABLE
#define BRANCH_PREDICTION_ENABLE
#define L2CC_AUX_CTL_CONFIG 0x00030024
#define AIPS_MPR_CONFIG 0x77777777
#define AIPS_PACR_CONFIG 0x00000000
#define AIPS_PACR0_CONFIG 0x40000000
/* MPR - priority is M4 > M2 > M3 > M5 > M0 > M1 */
#define MAX_MPR_CONFIG 0x00032154
/* SGPCR - always park on last master */
#define MAX_SGPCR_CONFIG 0x00000010
/* MGPCR - restore default values */
#define MAX_MGPCR_CONFIG 0x00000001
/*
* M3IF Control Register (M3IFCTL)
* MRRP[0] = L2CC0 not on priority list (0 << 0) = 0x00000000
* MRRP[1] = L2CC1 not on priority list (0 << 0) = 0x00000000
* MRRP[2] = MBX not on priority list (0 << 0) = 0x00000000
* MRRP[3] = MAX1 not on priority list (0 << 0) = 0x00000000
* MRRP[4] = SDMA not on priority list (0 << 0) = 0x00000000
* MRRP[5] = MPEG4 not on priority list (0 << 0) = 0x00000000
* MRRP[6] = IPU1 on priority list (1 << 6) = 0x00000040
* MRRP[7] = IPU2 not on priority list (0 << 0) = 0x00000000
* ------------
* 0x00000040
*/
#define M3IF_CONFIG 0x000000C0
#define DBG_BASE_ADDR WEIM_CTRL_CS5
#define DBG_CSCR_U_CONFIG 0x0000D000
#define DBG_CSCR_L_CONFIG 0x22252521
#define DBG_CSCR_A_CONFIG 0x22220A00
#define CCM_CCMR_CONFIG 0x003F4208
#define CCM_PDR0_CONFIG 0x00801000
#define PLL_BRM_OFFSET 31
#define PLL_PD_OFFSET 26
#define PLL_MFD_OFFSET 16
#define PLL_MFI_OFFSET 10
#define _PLL_BRM(x) ((x) << PLL_BRM_OFFSET)
#define _PLL_PD(x) (((x) - 1) << PLL_PD_OFFSET)
#define _PLL_MFD(x) (((x) - 1) << PLL_MFD_OFFSET)
#define _PLL_MFI(x) ((x) << PLL_MFI_OFFSET)
#define _PLL_MFN(x) (x)
#define _PLL_SETTING(brm, pd, mfd, mfi, mfn) \
(_PLL_BRM(brm) | _PLL_PD(pd) | _PLL_MFD(mfd) | _PLL_MFI(mfi) |\
_PLL_MFN(mfn))
#define CCM_MPLL_532_HZ _PLL_SETTING(1, 1, 12, 11, 1)
#define CCM_MPLL_399_HZ _PLL_SETTING(0, 1, 16, 8, 5)
#define CCM_PPLL_300_HZ _PLL_SETTING(0, 1, 4, 6, 1)
/*MEMORY SETING*/
/*
* ESDCTL constants
*/
#define ESDCTL_ESDCTL0_OFFSET 0x0000
#define ESDCTL_ESDCFG0_OFFSET 0x0004
#define ESDCTL_ESDCTL1_OFFSET 0x0008
#define ESDCTL_ESDCFG1_OFFSET 0x000C
#define ESDCTL_ESDMISC_OFFSET 0x0010
#define ESDCTL_ESDDLY1_OFFSET 0x0020
#define ESDCTL_ESDDLY2_OFFSET 0x0024
#define ESDCTL_ESDDLY3_OFFSET 0x0028
#define ESDCTL_ESDDLY4_OFFSET 0x002C
#define ESDCTL_ESDDLY5_OFFSET 0x0030
#define ESDCTL_0x92220000 0x92220000
#define ESDCTL_0xA2220000 0xA2220000
#define ESDCTL_0xB2220000 0xB2220000
#define ESDCTL_0x82228080 0x82228080
#define ESDCTL_0x82226080 0x82226080
#define ESDCTL_PRECHARGE 0x00000400
#define ESDCTL_MDDR_CONFIG 0x007FFC3F
#define ESDCTL_MDDR_MR 0x00000033
#define ESDCTL_MDDR_EMR 0x02000000
#define ESDCTL_DDR2_CONFIG 0x0079542A
#define ESDCTL_DDR2_EMR2 0x04000000
#define ESDCTL_DDR2_EMR3 0x06000000
#define ESDCTL_DDR2_EN_DLL 0x02000400
#define ESDCTL_DDR2_RESET_DLL 0x00000333
#define ESDCTL_DDR2_MR 0x00000233
#define ESDCTL_DDR2_OCD_DEFAULT 0x02000780
#define ESDCTL_DELAY_LINE5 0x00F49F00
#endif /* __BOARD_MX35_3STACK_H */

View File

@ -0,0 +1,3 @@
LDSCRIPT := $(SRCTREE)/board/$(VENDOR)/$(BOARD)/u-boot.lds
TEXT_BASE = 0x87800000

View File

@ -0,0 +1,130 @@
/*
* Copyright (C) 2009-2011 Freescale Semiconductor, Inc.
*
* 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.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
*/
#include <config.h>
#include <asm/arch/mx35.h>
#include "board-mx35_3stack.h"
#ifdef CONFIG_FLASH_HEADER
#ifndef CONFIG_FLASH_HEADER_OFFSET
# error "Must define the offset of flash header"
#endif
/* Flash header setup */
#define DCDGEN(i,type, addr, data) \
dcd_##i: ;\
.long type ;\
.long addr ;\
.long data
#define GEN_FHEADERADDR(x) (x)
.section ".text.flasheader", "x"
b _start
.org CONFIG_FLASH_HEADER_OFFSET
app_code_jump_v: .long GEN_FHEADERADDR(_start)
app_code_barker: .long CONFIG_FLASH_HEADER_BARKER
app_code_csf: .long 0
hwcfg_ptr_ptr: .long GEN_FHEADERADDR(hwcfg_ptr)
super_root_key: .long 0
hwcfg_ptr: .long GEN_FHEADERADDR(dcd_data)
app_dest_ptr: .long TEXT_BASE
dcd_data: .long 0xB17219E9
#ifdef MEMORY_MDDR_ENABLE
.long (dcd_data_end - dcd_data - 8)
//WEIM config-CS5 init
DCDGEN(1, 4, 0xB8002054, 0x444a4541)
DCDGEN(1_1, 4, 0xB8002050, 0x0000dcf6)
DCDGEN(1_2, 4, 0xB8002058, 0x44443302)
//MDDR init
//enable mDDR
DCDGEN(2, 4, 0xB8001010, 0x00000004)
//reset delay time
DCDGEN(3, 4, 0xB8001010, 0x0000000C)
DCDGEN(4, 4, 0xB800100C, 0x007ffc3f)
DCDGEN(5, 4, 0xB800100C, 0x007ffc3f)
DCDGEN(6, 4, 0xB8001004, 0x007ffc3f)
DCDGEN(7, 4, 0xB8001000, 0x92220000)
DCDGEN(8, 1, 0x80000400, 0xda)
DCDGEN(9, 4, 0xB8001000, 0xA2220000)
DCDGEN(10, 4, 0x80000000, 0x87654321)
DCDGEN(11, 4, 0x80000000, 0x87654321)
DCDGEN(12, 4, 0xB8001000, 0xB2220000)
DCDGEN(13, 1, 0x80000033, 0xda)
DCDGEN(14, 1, 0x82000000, 0xda)
DCDGEN(15, 4, 0xB8001000, 0x82226080)
DCDGEN(16, 4, 0xB8001010, 0x00000004)
DCDGEN(17, 4, 0xB8001008, 0x00002000)
#else
.long (dcd_data_end - dcd_data - 8)
//WEIM config-CS5 init
DCDGEN(1, 4, 0xB8002050, 0x0000d843)
DCDGEN(1_1, 4, 0xB8002054, 0x22252521)
DCDGEN(1_2, 4, 0xB8002058, 0x22220a00)
//DDR2 init
DCDGEN(2, 4, 0xB8001010, 0x00000304)
DCDGEN(3, 4, 0xB8001004, 0x0079542A)
DCDGEN(4, 4, 0xB8001000, 0x92220000)
DCDGEN(5, 1, 0x80000400, 0x00)
DCDGEN(6, 4, 0xB8001000, 0xB2220000)
DCDGEN(7, 1, 0x84000000, 0x00)
DCDGEN(8, 1, 0x86000000, 0x00)
DCDGEN(9, 1, 0x82000400, 0x00)
DCDGEN(10, 1, 0x80000333, 0x00)
DCDGEN(11, 4, 0xB8001000, 0x92220000)
DCDGEN(12, 1, 0x80000400, 0x00)
DCDGEN(13, 4, 0xB8001000, 0xA2220000)
DCDGEN(14, 1, 0x80000000, 0x00)
DCDGEN(15, 1, 0x80000000, 0x00)
DCDGEN(16, 4, 0xB8001000, 0xB2220000)
DCDGEN(17, 1, 0x80000233, 0x00)
DCDGEN(18, 1, 0x82000780, 0x00)
DCDGEN(19, 1, 0x82000400, 0x00)
DCDGEN(20, 4, 0xB8001000, 0x82226080)
#ifdef CONFIG_MX35_256M_RAM
DCDGEN(22, 4, 0xB800100C, 0x0079542A)
DCDGEN(23, 4, 0xB8001008, 0x92220000)
DCDGEN(24, 1, 0x90000400, 0x00)
DCDGEN(25, 4, 0xB8001008, 0xB2220000)
DCDGEN(26, 1, 0x84000000, 0x00)
DCDGEN(27, 1, 0x86000000, 0x00)
DCDGEN(28, 1, 0x82000400, 0x00)
DCDGEN(29, 1, 0x90000333, 0x00)
DCDGEN(30, 4, 0xB8001008, 0x92220000)
DCDGEN(31, 1, 0x82000400, 0x00)
DCDGEN(32, 4, 0xB8001008, 0xA2220000)
DCDGEN(33, 1, 0x90000000, 0x00)
DCDGEN(34, 1, 0x90000000, 0x00)
DCDGEN(35, 4, 0xB8001008, 0xB2220000)
DCDGEN(36, 1, 0x90000233, 0x00)
DCDGEN(37, 1, 0x82000780, 0x00)
DCDGEN(38, 1, 0x82000400, 0x00)
DCDGEN(39, 4, 0xB8001008, 0x82226080)
#endif
#endif
dcd_data_end:
//CARD_FLASH_CFG_PARMS_T---length
card_cfg: .long 0x100000
#endif

View File

@ -0,0 +1,756 @@
/*
* Copyright (C) 2007, Guennadi Liakhovetski <lg@denx.de>
*
* (C) Copyright 2008-2011 Freescale Semiconductor, Inc.
*
* 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.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
*/
#include <config.h>
#include <asm/arch/mx35.h>
#include "board-mx35_3stack.h"
/*
* return soc version
* 0x10: TO1
* 0x20: TO2
* 0x30: TO3
*/
.macro check_soc_version ret, tmp
ldr \tmp, =IIM_BASE_ADDR
ldr \ret, [\tmp, #IIM_SREV]
cmp \ret, #0x00
moveq \tmp, #ROMPATCH_REV
ldreq \ret, [\tmp]
moveq \ret, \ret, lsl #4
addne \ret, \ret, #0x10
.endm
/*
* L2CC Cache setup/invalidation/disable
*/
.macro init_l2cc
/* Disable L2 cache first */
mov r0, #L2CC_BASE_ADDR
ldr r1, [r0, #L2_CACHE_CTL_REG]
bic r1, r1, #0x1
str r1, [r0, #L2_CACHE_CTL_REG]
/*
* Configure L2 Cache:
* - 128k size(16k way)
* - 8-way associativity
* - 0 ws TAG/VALID/DIRTY
* - 4 ws DATA R/W
*/
ldr r1, [r0, #L2_CACHE_AUX_CTL_REG]
and r1, r1, #0xFE000000
ldr r2, =L2CC_AUX_CTL_CONFIG
orr r1, r1, r2
str r1, [r0, #L2_CACHE_AUX_CTL_REG]
/* Workaournd for TO1 DDR issue:WT*/
check_soc_version r1, r2
cmp r1, #CHIP_REV_2_0
ldrlo r1, [r0, #L2_CACHE_DBG_CTL_REG]
orrlo r1, r1, #2
strlo r1, [r0, #L2_CACHE_DBG_CTL_REG]
/* Invalidate L2 */
mov r1, #0x000000FF
str r1, [r0, #L2_CACHE_INV_WAY_REG]
1:
/* Poll Invalidate By Way register */
ldr r2, [r0, #L2_CACHE_INV_WAY_REG]
cmp r2, #0
bne 1b
.endm /* init_l2cc */
/* AIPS setup - Only setup MPROTx registers.
* The PACR default values are good.*/
.macro init_aips
/*
* Clear the on and off peripheral modules Supervisor Protect bit
* for SDMA to access them. Did not change the AIPS control registers
* (offset 0x20) access type
*/
ldr r0, =AIPS1_BASE_ADDR
ldr r1, =AIPS_PACR_CONFIG
str r1, [r0, #0x24]
str r1, [r0, #0x28]
str r1, [r0, #0x2C]
str r1, [r0, #0x40]
str r1, [r0, #0x44]
str r1, [r0, #0x48]
str r1, [r0, #0x4C]
str r1, [r0, #0x50]
ldr r0, =AIPS2_BASE_ADDR
str r1, [r0, #0x24]
str r1, [r0, #0x28]
str r1, [r0, #0x2C]
str r1, [r0, #0x40]
str r1, [r0, #0x44]
str r1, [r0, #0x48]
str r1, [r0, #0x4C]
str r1, [r0, #0x50]
ldr r0, =AIPS1_BASE_ADDR
ldr r1, =AIPS_PACR0_CONFIG
str r1, [r0, #0x20]
ldr r0, =AIPS2_BASE_ADDR
str r1, [r0, #0x20]
/*
* Set all MPROTx to be non-bufferable, trusted for R/W,
* not forced to user-mode.
*/
ldr r0, =AIPS1_BASE_ADDR
ldr r1, =AIPS_MPR_CONFIG
str r1, [r0, #0x00]
str r1, [r0, #0x04]
ldr r0, =AIPS2_BASE_ADDR
str r1, [r0, #0x00]
str r1, [r0, #0x04]
.endm /* init_aips */
/* MAX (Multi-Layer AHB Crossbar Switch) setup */
.macro init_max
ldr r0, =MAX_BASE_ADDR
/* MPR - priority is M4 > M2 > M3 > M5 > M0 > M1 */
ldr r1, =MAX_MPR_CONFIG
str r1, [r0, #0x000] /* for S0 */
str r1, [r0, #0x100] /* for S1 */
str r1, [r0, #0x200] /* for S2 */
str r1, [r0, #0x300] /* for S3 */
str r1, [r0, #0x400] /* for S4 */
/* SGPCR - always park on last master */
ldr r1, =MAX_SGPCR_CONFIG
str r1, [r0, #0x010] /* for S0 */
str r1, [r0, #0x110] /* for S1 */
str r1, [r0, #0x210] /* for S2 */
str r1, [r0, #0x310] /* for S3 */
str r1, [r0, #0x410] /* for S4 */
/* MGPCR - restore default values */
ldr r1, =MAX_MGPCR_CONFIG
str r1, [r0, #0x800] /* for M0 */
str r1, [r0, #0x900] /* for M1 */
str r1, [r0, #0xA00] /* for M2 */
str r1, [r0, #0xB00] /* for M3 */
str r1, [r0, #0xC00] /* for M4 */
str r1, [r0, #0xD00] /* for M5 */
.endm /* init_max */
/* M3IF setup */
.macro init_m3if
/* Configure M3IF registers */
ldr r1, =M3IF_BASE_ADDR
/*
* M3IF Control Register (M3IFCTL)
* MRRP[0] = L2CC0 not on priority list (0 << 0) = 0x00000000
* MRRP[1] = L2CC1 not on priority list (0 << 0) = 0x00000000
* MRRP[2] = MBX not on priority list (0 << 0) = 0x00000000
* MRRP[3] = MAX1 not on priority list (0 << 0) = 0x00000000
* MRRP[4] = SDMA not on priority list (0 << 0) = 0x00000000
* MRRP[5] = MPEG4 not on priority list (0 << 0) = 0x00000000
* MRRP[6] = IPU1 on priority list (1 << 6) = 0x00000040
* MRRP[7] = IPU2 not on priority list (0 << 0) = 0x00000000
* ------------
* 0x00000040
*/
ldr r0, =M3IF_CONFIG
str r0, [r1] /* M3IF control reg */
.endm /* init_m3if */
/* To support 133MHz DDR */
.macro init_drive_strength
/*
mov r0, #0x2
ldr r1, =IOMUXC_BASE_ADDR
add r1, r1, #0x368
add r2, r1, #0x4C8 - 0x368
1: str r0, [r1], #4
cmp r1, r2
ble 1b
*/
.endm /* init_drive_strength */
/* CPLD on CS5 setup */
.macro init_debug_board
ldr r0, =DBG_BASE_ADDR
ldr r1, =DBG_CSCR_U_CONFIG
str r1, [r0, #0x00]
ldr r1, =DBG_CSCR_L_CONFIG
str r1, [r0, #0x04]
ldr r1, =DBG_CSCR_A_CONFIG
str r1, [r0, #0x08]
.endm /* init_debug_board */
/* clock setup */
.macro init_clock
ldr r0, =CCM_BASE_ADDR
/* default CLKO to 1/32 of the ARM core*/
ldr r1, [r0, #CLKCTL_COSR]
bic r1, r1, #0x00000FF00
bic r1, r1, #0x0000000FF
mov r2, #0x00006C00
add r2, r2, #0x67
orr r1, r1, r2
str r1, [r0, #CLKCTL_COSR]
ldr r2, =CCM_CCMR_CONFIG
str r2, [r0, #CLKCTL_CCMR]
check_soc_version r1, r2
cmp r1, #CHIP_REV_2_0
ldrhs r3, =CCM_MPLL_532_HZ
bhs 1f
ldr r2, [r0, #CLKCTL_PDR0]
tst r2, #CLKMODE_CONSUMER
ldrne r3, =CCM_MPLL_532_HZ /* consumer path*/
ldreq r3, =CCM_MPLL_399_HZ /* auto path*/
1:
str r3, [r0, #CLKCTL_MPCTL]
ldr r1, =CCM_PPLL_300_HZ
str r1, [r0, #CLKCTL_PPCTL]
ldr r1, =CCM_PDR0_CONFIG
bic r1, r1, #0x800000
str r1, [r0, #CLKCTL_PDR0]
ldr r1, [r0, #CLKCTL_CGR0]
orr r1, r1, #0x0C300000
str r1, [r0, #CLKCTL_CGR0]
ldr r1, [r0, #CLKCTL_CGR1]
orr r1, r1, #0x00000C00
orr r1, r1, #0x00000003
str r1, [r0, #CLKCTL_CGR1]
.endm /* init_clock */
.macro setup_sdram
ldr r0, =ESDCTL_BASE_ADDR
mov r3, #0x2000
str r3, [r0, #0x0]
str r3, [r0, #0x8]
/*ip(r12) has used to save lr register in upper calling*/
mov fp, lr
mov r5, #0x00
mov r1, #CSD0_BASE_ADDR
bl setup_sdram_ddr2_bank
cmp r3, #0x0
orreq r5, r5, #1
blne setup_sdram_mddr_bank
mov lr, fp
check_soc_version r3, r4
cmp r1, #CHIP_REV_2_0
bhs 1f
cmp r5, #0
movne r3, #L2CC_BASE_ADDR
ldrne r4, [r3, #L2_CACHE_AUX_CTL_REG]
orrne r4, r4, #0x1000
strne r4, [r3, #L2_CACHE_AUX_CTL_REG]
1:
ldr r3, =ESDCTL_DELAY_LINE5
str r3, [r0, #0x30]
.endm /* setup_sdram */
.section ".text.init", "x"
.globl lowlevel_init
lowlevel_init:
/* Platform CHIP level init*/
#ifdef TURN_OFF_IMPRECISE_ABORT
mrs r0, cpsr
bic r0, r0, #0x100
msr cpsr, r0
#endif
mrc 15, 0, r1, c1, c0, 0
#ifndef BRANCH_PREDICTION_ENABLE
mrc 15, 0, r0, c1, c0, 1
bic r0, r0, #7
mcr 15, 0, r0, c1, c0, 1
#else
mrc 15, 0, r0, c1, c0, 1
orr r0, r0, #7
mcr 15, 0, r0, c1, c0, 1
orr r1, r1, #(1<<11)
#endif
#ifdef UNALIGNED_ACCESS_ENABLE
orr r1, r1, #(1<<22)
#endif
#ifdef LOW_INT_LATENCY_ENABLE
orr r1, r1, #(1<<21)
#endif
mcr 15, 0, r1, c1, c0, 0
mov r0, #0
#ifdef BRANCH_PREDICTION_ENABLE
mcr 15, 0, r0, c15, c2, 4
#endif
mcr 15, 0, r0, c7, c7, 0 /* invalidate I cache and D cache */
mcr 15, 0, r0, c8, c7, 0 /* invalidate TLBs */
mcr 15, 0, r0, c7, c10, 4 /* Drain the write buffer */
/* initializes very early AIPS, what for?
* Then it also initializes Multi-Layer AHB Crossbar Switch,
* M3IF */
/* Also setup the Peripheral Port Remap register inside the core */
ldr r0, =0x40000015 /* start from AIPS 2GB region */
mcr p15, 0, r0, c15, c2, 4
init_l2cc
init_aips
init_max
init_m3if
init_drive_strength
init_clock
init_debug_board
cmp pc, #PHYS_SDRAM_1
blo init_sdram_start
cmp pc, #(PHYS_SDRAM_1 + PHYS_SDRAM_1_SIZE)
blo skip_sdram_setup
init_sdram_start:
/*init_sdram*/
setup_sdram
skip_sdram_setup:
mov r0, #NFC_BASE_ADDR
add r1, r0, #NFC_BUF_SIZE
cmp pc, r0
movlo pc, lr
cmp pc, r1
movhi pc, lr
/* return from mxc_nand_load */
/* r12 saved upper lr*/
b mxc_nand_load
/*
* r0: ESDCTL control base, r1: sdram slot base
* r2: DDR type(0:DDR2, 1:MDDR) r3, r4:working base
*/
setup_sdram_ddr2_bank:
/*
* DDR2 initialization
*/
ldr r0, =ESDCTL_BASE_ADDR
/* Configure for DDR2 */
ldr r3, =0x30E /* bit 9 is DDR2_EN */
str r3, [r0, #ESDCTL_ESDMISC_OFFSET]
ldr r3, =0x304
str r3, [r0, #ESDCTL_ESDMISC_OFFSET]
/*----------------------------------------
* Configure DDR2 memory on CSD0
*----------------------------------------*/
ldr r1, =CSD0_BASE_ADDR
/* Configure timing parameters */
ldr r3, =ESDCTL_DDR2_CONFIG // Moderate
str r3, [r0, #ESDCTL_ESDCFG0_OFFSET]
/*
* Set precharge command
*
* DSIZ - 32-bit memory width (2 << 16) = 0x00020000
* COL - 10 column addresses (2 << 20) = 0x00200000
* ROW - 13 Row addresses (2 << 24) = 0x02000000
* SP - User mode access (0 << 27) = 0x00000000
* SMODE - Precharge command (1 << 28) = 0x10000000
* SDE - Enable controller (1 << 31) = 0x80000000
* ------------
* 0x92220000
*/
ldr r3, =ESDCTL_0x92220000
str r3, [r0, #ESDCTL_ESDCTL0_OFFSET]
/* Access SDRAM with A10 high to precharge all banks */
ldr r3, =0x0
strb r3, [r1, #ESDCTL_PRECHARGE]
/*
* Set load mode command
*
* DSIZ - 32-bit memory width (2 << 16) = 0x00020000
* COL - 10 column addresses (2 << 20) = 0x00200000
* ROW - 13 Row addresses (2 << 24) = 0x02000000
* SP - User mode access (0 << 27) = 0x00000000
* SMODE - Load mode command (3 << 28) = 0x30000000
* SDE - Enable controller (1 << 31) = 0x80000000
* ------------
* 0xB2220000
*/
ldr r3, =ESDCTL_0xB2220000
str r3, [r0, #ESDCTL_ESDCTL0_OFFSET]
/* DDR2 EMR2 */
ldr r3, =0x0
ldr r4, =ESDCTL_DDR2_EMR2
strb r3, [r1, r4]
/* DDR2 EMR3 */
ldr r3, =0x0
ldr r4, =ESDCTL_DDR2_EMR3
strb r3, [r1, r4]
/* DDR2 EMR1: enable DLL, disable /DQS */
ldr r3, =0x0
ldr r4, =ESDCTL_DDR2_EN_DLL
strb r3, [r1, r4]
/* DDR2 MR: reset DLL, BL=8, CL=3 */
ldr r3, =0x0
ldr r4, =ESDCTL_DDR2_RESET_DLL
strb r3, [r1, r4]
/*
* Set precharge command
*
* DSIZ - 32-bit memory width (2 << 16) = 0x00020000
* COL - 10 column addresses (2 << 20) = 0x00200000
* ROW - 13 Row addresses (2 << 24) = 0x02000000
* SP - User mode access (0 << 27) = 0x00000000
* SMODE - Precharge command (1 << 28) = 0x10000000
* SDE - Enable controller (1 << 31) = 0x80000000
* ------------
* 0x92220000
*/
ldr r3, =ESDCTL_0x92220000
str r3, [r0, #ESDCTL_ESDCTL0_OFFSET]
/* Access SDRAM with A10 high to precharge all banks */
ldr r3, =0x0
ldr r4, =ESDCTL_DDR2_EN_DLL
strb r3, [r1, r4]
/*
* Set autorefresh command
*
* DSIZ - 32-bit memory width (2 << 16) = 0x00020000
* COL - 10 column addresses (2 << 20) = 0x00200000
* ROW - 13 Row addresses (2 << 24) = 0x02000000
* SP - User mode access (0 << 27) = 0x00000000
* SMODE - Autorefresh command (2 << 28) = 0x20000000
* SDE - Enable controller (1 << 31) = 0x80000000
* ------------
* 0xA2220000
*/
ldr r3, =ESDCTL_0xA2220000
str r3, [r1, #ESDCTL_ESDCTL0_OFFSET]
/* Use writes to refresh all banks of SDRAM */
ldr r3, =0x0
strb r3, [r1]
strb r3, [r1]
/*
* Set load mode command
*
* DSIZ - 32-bit memory width (2 << 16) = 0x00020000
* COL - 10 column addresses (2 << 20) = 0x00200000
* ROW - 13 Row addresses (2 << 24) = 0x02000000
* SP - User mode access (0 << 27) = 0x00000000
* SMODE - Load mode command (3 << 28) = 0x30000000
* SDE - Enable controller (1 << 31) = 0x80000000
* ------------
* 0xB2220000
*/
ldr r3, =ESDCTL_0xB2220000
str r3, [r0, #ESDCTL_ESDCTL0_OFFSET]
/* DDR2 MR: end DLL reset, BL=8, CL=3 */
ldr r3, =0x0
strb r3, [r1, #ESDCTL_DDR2_MR]
/* Hold for more than 200 cycles */
ldr r3, =0x100
hold_1:
subs r3, r3, #1
bne hold_1
/* DDR2 EMR1: OCD calibration default */
ldr r3, =0x0
ldr r4, =ESDCTL_DDR2_OCD_DEFAULT
strb r3, [r1, r4]
/* DDR2 EMR1: OCD calibration exit, enable DLL, disable /DQS */
ldr r3, =0x0
ldr r4, =ESDCTL_DDR2_EN_DLL
strb r3, [r1, r4]
/*
* Set normal mode command
*
* PRCT - Precharge timer disabled (0 << 5) = 0x00000000
* BL - Burst of 8 for SDR/DDR (1 << 7) = 0x00000080
* FP - No full page mode (0 << 8) = 0x00000000
* PWDT - Power down timeout disabled (3 << 10) = 0x00000000
* SREFR - 4 rows refreshed each clock (3 << 13) = 0x00006000
* DSIZ - 32-bit memory width (2 << 16) = 0x00020000
* COL - 10 column addresses (2 << 20) = 0x00200000
* ROW - 13 Row addresses (2 << 24) = 0x02000000
* SP - User mode access (0 << 27) = 0x00000000
* SMODE - Normal mode command (0 << 28) = 0x00000000
* SDE - Enable controller (1 << 31) = 0x80000000
* ------------
* 0x82226080
*/
ldr r3, =ESDCTL_0x82226080
str r3, [r0, #ESDCTL_ESDCTL0_OFFSET]
#ifdef CONFIG_MX35_256M_RAM
/*----------------------------------------
* Configure DDR2 memory on CSD1
*----------------------------------------*/
ldr r1, =CSD1_BASE_ADDR
/* Configure timing parameters */
ldr r3, =ESDCTL_DDR2_CONFIG /* Moderate */
str r3, [r0, #ESDCTL_ESDCFG1_OFFSET]
/*
* Set precharge command
*
* DSIZ - 32-bit memory width (2 << 16) = 0x00020000
* COL - 10 column addresses (2 << 20) = 0x00200000
* ROW - 13 Row addresses (2 << 24) = 0x02000000
* SP - User mode access (0 << 27) = 0x00000000
* SMODE - Precharge command (1 << 28) = 0x10000000
* SDE - Enable controller (1 << 31) = 0x80000000
* ------------
* 0x92220000
*/
ldr r3, =ESDCTL_0x92220000
str r3, [r0, #ESDCTL_ESDCTL1_OFFSET]
/* Access SDRAM with A10 high to precharge all banks */
ldr r3, =0x0
ldr r4, =ESDCTL_DDR2_EN_DLL
strb r3, [r1, r4]
/*
* Set load mode command
*
* DSIZ - 32-bit memory width (2 << 16) = 0x00020000
* COL - 10 column addresses (2 << 20) = 0x00200000
* ROW - 13 Row addresses (2 << 24) = 0x02000000
* SP - User mode access (0 << 27) = 0x00000000
* SMODE - Load mode command (3 << 28) = 0x30000000
* SDE - Enable controller (1 << 31) = 0x80000000
* ------------
* 0xB2220000
*/
ldr r3, =ESDCTL_0xB2220000
str r3, [r0, #ESDCTL_ESDCTL1_OFFSET]
/* DDR2 EMR2 */
ldr r3, =0x0
ldr r4, =ESDCTL_DDR2_EMR2
strb r3, [r1, r4]
/* DDR2 EMR3 */
ldr r3, =0x0
ldr r4, =ESDCTL_DDR2_EMR3
strb r3, [r1, r4]
/* DDR2 EMR1: enable DLL, disable /DQS */
ldr r3, =0x0
ldr r4, =ESDCTL_DDR2_EN_DLL
strb r3, [r1, r4]
/* DDR2 MR: reset DLL, BL=8, CL=3 */
ldr r3, =0x0
strb r3, [r1, #ESDCTL_DDR2_RESET_DLL]
/*
* Set precharge command
*
* DSIZ - 32-bit memory width (2 << 16) = 0x00020000
* COL - 10 column addresses (2 << 20) = 0x00200000
* ROW - 13 Row addresses (2 << 24) = 0x02000000
* SP - User mode access (0 << 27) = 0x00000000
* SMODE - Precharge command (1 << 28) = 0x10000000
* SDE - Enable controller (1 << 31) = 0x80000000
* ------------
* 0x92220000
*/
ldr r3, =ESDCTL_0x92220000
str r3, [r0, #ESDCTL_ESDCTL1_OFFSET]
/* Access SDRAM with A10 high to precharge all banks */
ldr r3, =0x0
strb r3, [r1, #ESDCTL_PRECHARGE]
/*
* Set autorefresh command
*
* DSIZ - 32-bit memory width (2 << 16) = 0x00020000
* COL - 10 column addresses (2 << 20) = 0x00200000
* ROW - 13 Row addresses (2 << 24) = 0x02000000
* SP - User mode access (0 << 27) = 0x00000000
* SMODE - Autorefresh command (2 << 28) = 0x20000000
* SDE - Enable controller (1 << 31) = 0x80000000
* ------------
* 0xA2220000
*/
ldr r3, =ESDCTL_0xA2220000
str r3, [r0, #ESDCTL_ESDCTL1_OFFSET]
/* Use writes to refresh all banks of SDRAM */
ldr r3, =0x0
strb r3, [r1]
strb r3, [r1]
/*
* Set load mode command
*
* DSIZ - 32-bit memory width (2 << 16) = 0x00020000
* COL - 10 column addresses (2 << 20) = 0x00200000
* ROW - 13 Row addresses (2 << 24) = 0x02000000
* SP - User mode access (0 << 27) = 0x00000000
* SMODE - Load mode command (3 << 28) = 0x30000000
* SDE - Enable controller (1 << 31) = 0x80000000
* ------------
* 0xB2220000
*
*/
ldr r3, =ESDCTL_0xB2220000
str r3, [r0, #ESDCTL_ESDCTL1_OFFSET]
/* DDR2 MR: end DLL reset, BL=8, CL=3 */
ldr r3, =0x0
strb r3, [r1, #ESDCTL_DDR2_MR]
/* Hold for more than 200 cycles */
ldr r3, =0x100
hold1:
subs r3, r3, #1
bne hold1
/* DDR2 EMR1: OCD calibration default */
ldr r3, =0x0
ldr r4, =ESDCTL_DDR2_OCD_DEFAULT
strb r3, [r1, r4]
/* DDR2 EMR1: OCD calibration exit, enable DLL, disable /DQS */
ldr r3, =0x0
ldr r4, =ESDCTL_DDR2_EN_DLL
strb r3, [r1, r4]
/*
* Set normal mode command
*
* PRCT - Precharge timer disabled (0 << 5) = 0x00000000
* BL - Burst of 8 for SDR/DDR (1 << 7) = 0x00000080
* FP - No full page mode (0 << 8) = 0x00000000
* PWDT - Power down timeout disabled (3 << 10) = 0x00000000
* SREFR - 4 rows refreshed each clock (3 << 13) = 0x00006000
* DSIZ - 32-bit memory width (2 << 16) = 0x00020000
* COL - 10 column addresses (2 << 20) = 0x00200000
* ROW - 13 Row addresses (2 << 24) = 0x02000000
* SP - User mode access (0 << 27) = 0x00000000
* SMODE - Normal mode command (0 << 28) = 0x00000000
* SDE - Enable controller (1 << 31) = 0x80000000
* ------------
* 0x82226080
*/
ldr r3, =ESDCTL_0x82226080
str r3, [r0, #ESDCTL_ESDCTL1_OFFSET]
#endif
str r3, [r1, #0x100]
ldr r4, [r1, #0x100]
cmp r3, r4
movne r3, #1
moveq r3, #0
mov pc, lr
/*
* r0: ESDCTL control base, r1: sdram slot base
* r2: DDR type(0:DDR2, 1:MDDR) r3, r4:working base
*/
setup_sdram_mddr_bank:
mov r3, #0xE /*0xA + 0x4*/
str r3, [r0, #0x10]
bic r3, r3, #0x00A
str r3, [r0, #0x10]
mov r3, #0x20000
1:
subs r3, r3, #1
bne 1b
2:
ldr r3, =ESDCTL_MDDR_CONFIG
cmp r1, #CSD1_BASE_ADDR
strlo r3, [r0, #0x4]
strhs r3, [r0, #0xC]
ldr r3, =ESDCTL_0x92220000
strlo r3, [r0, #0x0]
strhs r3, [r0, #0x8]
mov r3, #0xDA
ldr r4, =ESDCTL_PRECHARGE
strb r3, [r1, r4]
ldr r3, =ESDCTL_0xA2220000
strlo r3, [r0, #0x0]
strhs r3, [r0, #0x8]
mov r3, #0xDA
strb r3, [r1]
strb r3, [r1]
ldr r3, =ESDCTL_0xB2220000
strlo r3, [r0, #0x0]
strhs r3, [r0, #0x8]
ldr r4, =ESDCTL_MDDR_MR
mov r3, #0xDA
strb r3, [r1, r4]
ldr r4, =ESDCTL_MDDR_EMR
strb r3, [r1, r4]
ldr r3, =ESDCTL_0x82226080
strlo r3, [r0, #0x0]
strhs r3, [r0, #0x8]
mov r4, #0x200
1: subs r4, r4, #1
bne 1b
str r3, [r1, #0x100]
ldr r4, [r1, #0x100]
cmp r3, r4
movne r3, #1
moveq r3, #0
mov pc, lr

View File

@ -0,0 +1,467 @@
/*
* Copyright (C) 2007, Guennadi Liakhovetski <lg@denx.de>
*
* Copyright (C) 2008-2011 Freescale Semiconductor, Inc.
*
* See file CREDITS for list of people who contributed to this
* project.
*
* 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.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
*/
#include <common.h>
#include <asm/io.h>
#include <asm/errno.h>
#include <asm/arch/mx35.h>
#include <asm/arch/mx35_pins.h>
#include <asm/arch/iomux.h>
#include <i2c.h>
#include <linux/types.h>
#ifdef CONFIG_CMD_MMC
#include <mmc.h>
#include <fsl_esdhc.h>
#endif
#ifdef CONFIG_ARCH_MMU
#include <asm/mmu.h>
#include <asm/arch/mmu.h>
#endif
DECLARE_GLOBAL_DATA_PTR;
static u32 system_rev;
u32 get_board_rev(void)
{
return system_rev;
}
static inline void setup_soc_rev(void)
{
int reg;
reg = __REG(IIM_BASE_ADDR + IIM_SREV);
if (!reg) {
reg = __REG(ROMPATCH_REV);
reg <<= 4;
} else
reg += CHIP_REV_1_0;
system_rev = 0x35000 + (reg & 0xFF);
}
static inline void set_board_rev(int rev)
{
system_rev = (system_rev & ~(0xF << 8)) | (rev & 0xF) << 8;
}
int is_soc_rev(int rev)
{
return (system_rev & 0xFF) - rev;
}
#ifdef CONFIG_ARCH_MMU
void board_mmu_init(void)
{
unsigned long ttb_base = PHYS_SDRAM_1 + 0x4000;
unsigned long i;
/*
* Set the TTB register
*/
asm volatile ("mcr p15,0,%0,c2,c0,0" : : "r"(ttb_base) /*:*/);
/*
* Set the Domain Access Control Register
*/
i = ARM_ACCESS_DACR_DEFAULT;
asm volatile ("mcr p15,0,%0,c3,c0,0" : : "r"(i) /*:*/);
/*
* First clear all TT entries - ie Set them to Faulting
*/
memset((void *)ttb_base, 0, ARM_FIRST_LEVEL_PAGE_TABLE_SIZE);
/* Actual Virtual Size Attributes Function */
/* Base Base MB cached? buffered? access permissions */
/* xxx00000 xxx00000 */
X_ARM_MMU_SECTION(0x000, 0xF00, 0x1,
ARM_UNCACHEABLE, ARM_UNBUFFERABLE,
ARM_ACCESS_PERM_RW_RW); /* ROM */
X_ARM_MMU_SECTION(0x100, 0x100, 0x1,
ARM_UNCACHEABLE, ARM_UNBUFFERABLE,
ARM_ACCESS_PERM_RW_RW); /* iRAM */
X_ARM_MMU_SECTION(0x300, 0x300, 0x1,
ARM_UNCACHEABLE, ARM_UNBUFFERABLE,
ARM_ACCESS_PERM_RW_RW); /* L2CC */
/* Internal Regsisters upto SDRAM*/
X_ARM_MMU_SECTION(0x400, 0x400, 0x400,
ARM_UNCACHEABLE, ARM_UNBUFFERABLE,
ARM_ACCESS_PERM_RW_RW);
X_ARM_MMU_SECTION(0x800, 0x000, 0x80,
ARM_CACHEABLE, ARM_BUFFERABLE,
ARM_ACCESS_PERM_RW_RW); /* SDRAM 0:128M*/
X_ARM_MMU_SECTION(0x800, 0x800, 0x80,
ARM_CACHEABLE, ARM_BUFFERABLE,
ARM_ACCESS_PERM_RW_RW); /* SDRAM 0:128M*/
X_ARM_MMU_SECTION(0x800, 0x880, 0x80,
ARM_UNCACHEABLE, ARM_UNBUFFERABLE,
ARM_ACCESS_PERM_RW_RW); /* SDRAM 0:128M*/
X_ARM_MMU_SECTION(0x900, 0x900, 0x80,
ARM_CACHEABLE, ARM_BUFFERABLE,
ARM_ACCESS_PERM_RW_RW); /* SDRAM 1:128M*/
X_ARM_MMU_SECTION(0x900, 0x980, 0x80,
ARM_UNCACHEABLE, ARM_UNBUFFERABLE,
ARM_ACCESS_PERM_RW_RW); /* SDRAM 1:128M*/
X_ARM_MMU_SECTION(0xA00, 0xA00, 0x40,
ARM_CACHEABLE, ARM_BUFFERABLE,
ARM_ACCESS_PERM_RW_RW); /* Flash */
X_ARM_MMU_SECTION(0xB00, 0xB00, 0x20,
ARM_CACHEABLE, ARM_BUFFERABLE,
ARM_ACCESS_PERM_RW_RW); /* PSRAM */
/* ESDCTL, WEIM, M3IF, EMI, NFC, External I/O */
X_ARM_MMU_SECTION(0xB20, 0xB20, 0x1E0,
ARM_UNCACHEABLE, ARM_UNBUFFERABLE,
ARM_ACCESS_PERM_RW_RW);
/* Enable MMU */
MMU_ON();
}
#endif
int dram_init(void)
{
gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
#ifdef CONFIG_MX35_256M_RAM
gd->bd->bi_dram[1].start = PHYS_SDRAM_2;
gd->bd->bi_dram[1].size = PHYS_SDRAM_2_SIZE;
#endif
return 0;
}
int board_init(void)
{
int pad;
#ifdef CONFIG_MFG
/* MFG firmware need reset usb to avoid host crash firstly */
#define USBCMD 0x53FF4140
int val = readl(USBCMD);
val &= ~0x1; /*RS bit*/
writel(val, USBCMD);
#endif
setup_soc_rev();
/* enable clocks */
__REG(CCM_BASE_ADDR + CLKCTL_CGR0) |= 0x003F0000;
__REG(CCM_BASE_ADDR + CLKCTL_CGR1) |= 0x00030FFF;
/* setup pins for I2C1 */
mxc_request_iomux(MX35_PIN_I2C1_CLK, MUX_CONFIG_SION);
mxc_request_iomux(MX35_PIN_I2C1_DAT, MUX_CONFIG_SION);
pad = (PAD_CTL_HYS_SCHMITZ | PAD_CTL_PKE_ENABLE \
| PAD_CTL_PUE_PUD | PAD_CTL_ODE_OpenDrain);
mxc_iomux_set_pad(MX35_PIN_I2C1_CLK, pad);
mxc_iomux_set_pad(MX35_PIN_I2C1_DAT, pad);
/* setup pins for FEC */
mxc_request_iomux(MX35_PIN_FEC_TX_CLK, MUX_CONFIG_FUNC);
mxc_request_iomux(MX35_PIN_FEC_RX_CLK, MUX_CONFIG_FUNC);
mxc_request_iomux(MX35_PIN_FEC_RX_DV, MUX_CONFIG_FUNC);
mxc_request_iomux(MX35_PIN_FEC_COL, MUX_CONFIG_FUNC);
mxc_request_iomux(MX35_PIN_FEC_RDATA0, MUX_CONFIG_FUNC);
mxc_request_iomux(MX35_PIN_FEC_TDATA0, MUX_CONFIG_FUNC);
mxc_request_iomux(MX35_PIN_FEC_TX_EN, MUX_CONFIG_FUNC);
mxc_request_iomux(MX35_PIN_FEC_MDC, MUX_CONFIG_FUNC);
mxc_request_iomux(MX35_PIN_FEC_MDIO, MUX_CONFIG_FUNC);
mxc_request_iomux(MX35_PIN_FEC_TX_ERR, MUX_CONFIG_FUNC);
mxc_request_iomux(MX35_PIN_FEC_RX_ERR, MUX_CONFIG_FUNC);
mxc_request_iomux(MX35_PIN_FEC_CRS, MUX_CONFIG_FUNC);
mxc_request_iomux(MX35_PIN_FEC_RDATA1, MUX_CONFIG_FUNC);
mxc_request_iomux(MX35_PIN_FEC_TDATA1, MUX_CONFIG_FUNC);
mxc_request_iomux(MX35_PIN_FEC_RDATA2, MUX_CONFIG_FUNC);
mxc_request_iomux(MX35_PIN_FEC_TDATA2, MUX_CONFIG_FUNC);
mxc_request_iomux(MX35_PIN_FEC_RDATA3, MUX_CONFIG_FUNC);
mxc_request_iomux(MX35_PIN_FEC_TDATA3, MUX_CONFIG_FUNC);
pad = (PAD_CTL_DRV_3_3V | PAD_CTL_PUE_PUD | PAD_CTL_ODE_CMOS | \
PAD_CTL_DRV_NORMAL | PAD_CTL_SRE_SLOW);
mxc_iomux_set_pad(MX35_PIN_FEC_TX_CLK, pad | PAD_CTL_HYS_SCHMITZ | \
PAD_CTL_PKE_ENABLE | PAD_CTL_100K_PD);
mxc_iomux_set_pad(MX35_PIN_FEC_RX_CLK, pad | PAD_CTL_HYS_SCHMITZ | \
PAD_CTL_PKE_ENABLE | PAD_CTL_100K_PD);
mxc_iomux_set_pad(MX35_PIN_FEC_RX_DV, pad | PAD_CTL_HYS_SCHMITZ | \
PAD_CTL_PKE_ENABLE | PAD_CTL_100K_PD);
mxc_iomux_set_pad(MX35_PIN_FEC_COL, pad | PAD_CTL_HYS_SCHMITZ | \
PAD_CTL_PKE_ENABLE | PAD_CTL_100K_PD);
mxc_iomux_set_pad(MX35_PIN_FEC_RDATA0, pad | PAD_CTL_HYS_SCHMITZ | \
PAD_CTL_PKE_ENABLE | PAD_CTL_100K_PD);
mxc_iomux_set_pad(MX35_PIN_FEC_TDATA0, pad | PAD_CTL_HYS_CMOS | \
PAD_CTL_PKE_NONE | PAD_CTL_100K_PD);
mxc_iomux_set_pad(MX35_PIN_FEC_TX_EN, pad | PAD_CTL_HYS_CMOS | \
PAD_CTL_PKE_NONE | PAD_CTL_100K_PD);
mxc_iomux_set_pad(MX35_PIN_FEC_MDC, pad | PAD_CTL_HYS_CMOS | \
PAD_CTL_PKE_NONE | PAD_CTL_100K_PD);
mxc_iomux_set_pad(MX35_PIN_FEC_MDIO, pad | PAD_CTL_HYS_SCHMITZ | \
PAD_CTL_PKE_ENABLE | PAD_CTL_22K_PU);
mxc_iomux_set_pad(MX35_PIN_FEC_TX_ERR, pad | PAD_CTL_HYS_CMOS | \
PAD_CTL_PKE_NONE | PAD_CTL_100K_PD);
mxc_iomux_set_pad(MX35_PIN_FEC_RX_ERR, pad | PAD_CTL_HYS_SCHMITZ | \
PAD_CTL_PKE_ENABLE | PAD_CTL_100K_PD);
mxc_iomux_set_pad(MX35_PIN_FEC_CRS, pad | PAD_CTL_HYS_SCHMITZ | \
PAD_CTL_PKE_ENABLE | PAD_CTL_100K_PD);
mxc_iomux_set_pad(MX35_PIN_FEC_RDATA1, pad | PAD_CTL_HYS_SCHMITZ | \
PAD_CTL_PKE_ENABLE | PAD_CTL_100K_PD);
mxc_iomux_set_pad(MX35_PIN_FEC_TDATA1, pad | PAD_CTL_HYS_CMOS | \
PAD_CTL_PKE_NONE | PAD_CTL_100K_PD);
mxc_iomux_set_pad(MX35_PIN_FEC_RDATA2, pad | PAD_CTL_HYS_SCHMITZ | \
PAD_CTL_PKE_ENABLE | PAD_CTL_100K_PD);
mxc_iomux_set_pad(MX35_PIN_FEC_TDATA2, pad | PAD_CTL_HYS_CMOS | \
PAD_CTL_PKE_NONE | PAD_CTL_100K_PD);
mxc_iomux_set_pad(MX35_PIN_FEC_RDATA3, pad | PAD_CTL_HYS_SCHMITZ | \
PAD_CTL_PKE_ENABLE | PAD_CTL_100K_PD);
mxc_iomux_set_pad(MX35_PIN_FEC_TDATA3, pad | PAD_CTL_HYS_CMOS | \
PAD_CTL_PKE_NONE | PAD_CTL_100K_PD);
gd->bd->bi_arch_number = MACH_TYPE_MX35_3DS; /* board id for linux */
gd->bd->bi_boot_params = 0x80000100; /* address of boot parameters */
return 0;
}
#ifdef BOARD_LATE_INIT
static inline int board_detect(void)
{
u8 buf[4];
int id;
if (i2c_read(0x08, 0x7, 1, buf, 3) < 0) {
printf("board_late_init: read PMIC@0x08:0x7 fail\n");
return 0;
}
id = (buf[0] << 16) + (buf[1] << 8) + buf[2];
printf("PMIC@0x08:0x7 is %x\n", id);
id = (id >> 6) & 0x7;
if (id == 0x7) {
set_board_rev(1);
return 1;
}
set_board_rev(0);
return 0;
}
int board_late_init(void)
{
u8 reg[3];
int i;
if (board_detect()) {
mxc_request_iomux(MX35_PIN_WATCHDOG_RST, MUX_CONFIG_SION |
MUX_CONFIG_ALT1);
printf("i.MX35 CPU board version 2.0\n");
if (i2c_read(0x08, 0x1E, 1, reg, 3)) {
printf("board_late_init: read PMIC@0x08:0x1E fail\n");
return 0;
}
reg[2] |= 0x3;
if (i2c_write(0x08, 0x1E, 1, reg, 3)) {
printf("board_late_init: write PMIC@0x08:0x1E fail\n");
return 0;
}
if (i2c_read(0x08, 0x20, 1, reg, 3)) {
printf("board_late_init: read PMIC@0x08:0x20 fail\n");
return 0;
}
reg[2] |= 0x1;
if (i2c_write(0x08, 0x20, 1, reg, 3)) {
printf("board_late_init: write PMIC@0x08:0x20 fail\n");
return 0;
}
mxc_request_iomux(MX35_PIN_COMPARE, MUX_CONFIG_GPIO);
mxc_iomux_set_input(MUX_IN_GPIO1_IN_5, INPUT_CTL_PATH0);
__REG(GPIO1_BASE_ADDR + 0x04) |= 1 << 5;
__REG(GPIO1_BASE_ADDR) |= 1 << 5;
} else
printf("i.MX35 CPU board version 1.0\n");
if (i2c_read(0x69, 0x20, 1, reg, 1) < 0) {
printf("board_late_init: read PMIC@0x69:0x20 fail\n");
return 0;
}
reg[0] |= 0x4;
if (i2c_write(0x69, 0x20, 1, reg, 1) < 0) {
printf("board_late_init: write back PMIC@0x69:0x20 fail\n");
return 0;
}
for (i = 0; i < 1000; i++)
udelay(200);
if (i2c_read(0x69, 0x1A, 1, reg, 1) < 0) {
printf("board_late_init: read PMIC@0x69:0x1A fail\n");
return 0;
}
reg[0] &= 0x7F;
if (i2c_write(0x69, 0x1A, 1, reg, 1) < 0) {
printf("board_late_init: write back PMIC@0x69:0x1A fail\n");
return 0;
}
for (i = 0; i < 1000; i++)
udelay(200);
reg[0] |= 0x80;
if (i2c_write(0x69, 0x1A, 1, reg, 1) < 0) {
printf("board_late_init: 2st write back PMIC@0x69:0x1A fail\n");
return 0;
}
return 0;
}
#endif
int checkboard(void)
{
printf("Board: MX35 3STACK ");
if (system_rev & CHIP_REV_2_0)
printf("2.0 [");
else
printf("1.0 [");
switch (__REG(CCM_BASE_ADDR + CLKCTL_RCSR) & 0x0F) {
case 0x0000:
printf("POR");
break;
case 0x0002:
printf("JTAG");
break;
case 0x0004:
printf("RST");
break;
case 0x0008:
printf("WDT");
break;
default:
printf("unknown");
}
printf("]\n");
return 0;
}
#if defined(CONFIG_SMC911X)
extern int smc911x_initialize(u8 dev_num, int base_addr);
#endif
int board_eth_init(bd_t *bis)
{
int rc = -ENODEV;
#if defined(CONFIG_SMC911X)
rc = smc911x_initialize(0, CONFIG_SMC911X_BASE);
#endif
cpu_eth_init(bis);
return rc;
}
#ifdef CONFIG_CMD_MMC
struct fsl_esdhc_cfg esdhc_cfg[2] = {
{MMC_SDHC1_BASE_ADDR, 1, 1},
{MMC_SDHC2_BASE_ADDR, 1, 1},
};
int esdhc_gpio_init(bd_t *bis)
{
u32 pad_val = 0, index = 0;
s32 status = 0;
/* IOMUX PROGRAMMING */
for (index = 0; index < CONFIG_SYS_FSL_ESDHC_NUM;
++index) {
switch (index) {
case 0:
pad_val = PAD_CTL_PUE_PUD | PAD_CTL_PKE_ENABLE |
PAD_CTL_HYS_SCHMITZ | PAD_CTL_DRV_HIGH |
PAD_CTL_100K_PD | PAD_CTL_SRE_FAST;
mxc_request_iomux(MX35_PIN_SD1_CMD,
MUX_CONFIG_FUNC | MUX_CONFIG_SION);
mxc_iomux_set_pad(MX35_PIN_SD1_CMD, pad_val);
pad_val = PAD_CTL_PUE_PUD | PAD_CTL_PKE_ENABLE |
PAD_CTL_HYS_SCHMITZ | PAD_CTL_DRV_HIGH |
PAD_CTL_100K_PU | PAD_CTL_SRE_FAST;
mxc_request_iomux(MX35_PIN_SD1_CLK,
MUX_CONFIG_FUNC | MUX_CONFIG_SION);
mxc_iomux_set_pad(MX35_PIN_SD1_CLK, pad_val);
mxc_request_iomux(MX35_PIN_SD1_DATA0,
MUX_CONFIG_FUNC);
mxc_iomux_set_pad(MX35_PIN_SD1_DATA0, pad_val);
mxc_request_iomux(MX35_PIN_SD1_DATA3,
MUX_CONFIG_FUNC);
mxc_iomux_set_pad(MX35_PIN_SD1_DATA3, pad_val);
break;
case 1:
mxc_request_iomux(MX35_PIN_SD2_CLK,
MUX_CONFIG_FUNC | MUX_CONFIG_SION);
mxc_request_iomux(MX35_PIN_SD2_CMD,
MUX_CONFIG_FUNC | MUX_CONFIG_SION);
mxc_request_iomux(MX35_PIN_SD2_DATA0,
MUX_CONFIG_FUNC);
mxc_request_iomux(MX35_PIN_SD2_DATA3,
MUX_CONFIG_FUNC);
pad_val = PAD_CTL_PUE_PUD | PAD_CTL_PKE_ENABLE |
PAD_CTL_HYS_SCHMITZ | PAD_CTL_DRV_MAX |
PAD_CTL_100K_PD | PAD_CTL_SRE_FAST;
mxc_iomux_set_pad(MX35_PIN_SD2_CMD, pad_val);
pad_val = PAD_CTL_PUE_PUD | PAD_CTL_PKE_ENABLE |
PAD_CTL_HYS_SCHMITZ | PAD_CTL_DRV_HIGH |
PAD_CTL_100K_PU | PAD_CTL_SRE_FAST;
mxc_iomux_set_pad(MX35_PIN_SD2_CLK, pad_val);
mxc_iomux_set_pad(MX35_PIN_SD2_DATA0, pad_val);
mxc_iomux_set_pad(MX35_PIN_SD2_DATA3, pad_val);
break;
default:
printf("Warning: you configured more ESDHC controller"
"(%d) as supported by the board(2)\n",
CONFIG_SYS_FSL_ESDHC_NUM);
return status;
break;
}
status |= fsl_esdhc_initialize(bis, &esdhc_cfg[index]);
}
return status;
}
int board_mmc_init(bd_t *bis)
{
if (!esdhc_gpio_init(bis))
return 0;
else
return -1;
}
#endif

View File

@ -0,0 +1,77 @@
/*
* January 2004 - Changed to support H4 device
* Copyright (c) 2004 Texas Instruments
*
* (C) Copyright 2002
* Gary Jennejohn, DENX Software Engineering, <gj@denx.de>
*
* (C) Copyright 2008-2009 Freescale Semiconductor, Inc.
*
* See file CREDITS for list of people who contributed to this
* project.
*
* 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.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
*/
OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
OUTPUT_ARCH(arm)
ENTRY(_start)
SECTIONS
{
. = 0x00000000;
. = ALIGN(4);
.text :
{
/* WARNING - the following is hand-optimized to fit within */
/* the sector layout of our flash chips! XXX FIXME XXX */
board/freescale/mx35_3stack/flash_header.o (.text.flasheader)
*(.text.head) /*arm startup code*/
*(.text.init) /*platform lowlevel initial code*/
*(.text.load) /*load bootloader*/
*(.text.setup) /*platform post lowlevel initial code*/
*(.text.vect) /*platform post lowlevel initial code*/
board/freescale/mx35_3stack/libmx35_3stack.a (.text)
lib_arm/libarm.a (.text)
net/libnet.a (.text)
drivers/mtd/libmtd.a (.text)
drivers/mmc/libmmc.a (.text)
. = DEFINED(env_offset) ? env_offset : .;
common/env_embedded.o(.text)
*(.text)
}
. = ALIGN(4);
.rodata : { *(.rodata) }
. = ALIGN(4);
.data : { *(.data) }
. = ALIGN(4);
.got : { *(.got) }
. = .;
__u_boot_cmd_start = .;
.u_boot_cmd : { *(.u_boot_cmd) }
__u_boot_cmd_end = .;
. = ALIGN(4);
__bss_start = .;
.bss : { *(.bss) }
_end = .;
}

View File

@ -0,0 +1,49 @@
#
# Copyright (C) 2007, Guennadi Liakhovetski <lg@denx.de>
#
# (C) Copyright 2010 Freescale Semiconductor, Inc.
#
# 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.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
# MA 02111-1307 USA
#
include $(TOPDIR)/config.mk
LIB = $(obj)lib$(BOARD).a
COBJS := mx50_rdp.o
SOBJS := lowlevel_init.o flash_header.o
SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c)
OBJS := $(addprefix $(obj),$(COBJS))
SOBJS := $(addprefix $(obj),$(SOBJS))
$(LIB): $(obj).depend $(OBJS) $(SOBJS)
$(AR) $(ARFLAGS) $@ $(OBJS) $(SOBJS)
clean:
rm -f $(SOBJS) $(OBJS)
distclean: clean
rm -f $(LIB) core *.bak .depend
#########################################################################
# defines $(obj).depend target
include $(SRCTREE)/rules.mk
sinclude $(obj).depend
#########################################################################

View File

@ -0,0 +1,7 @@
LDSCRIPT := $(SRCTREE)/board/$(VENDOR)/$(BOARD)/u-boot.lds
sinclude $(OBJTREE)/board/$(VENDOR)/$(BOARD)/config.tmp
ifndef TEXT_BASE
TEXT_BASE = 0x77800000
endif

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,207 @@
/*
* Copyright (C) 2007, Guennadi Liakhovetski <lg@denx.de>
*
* Copyright (C) 2010 Freescale Semiconductor, Inc.
*
* 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.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
*/
#include <config.h>
#include <asm/arch/mx50.h>
/*
* L2CC Cache setup/invalidation/disable
*/
.macro init_l2cc
/* explicitly disable L2 cache */
mrc 15, 0, r0, c1, c0, 1
bic r0, r0, #0x2
mcr 15, 0, r0, c1, c0, 1
/* reconfigure L2 cache aux control reg */
mov r0, #0xC0 /* tag RAM */
add r0, r0, #0x4 /* data RAM */
orr r0, r0, #(1 << 24) /* disable write allocate delay */
orr r0, r0, #(1 << 23) /* disable write allocate combine */
orr r0, r0, #(1 << 22) /* disable write allocate */
mcr 15, 1, r0, c9, c0, 2
.endm /* init_l2cc */
/* AIPS setup - Only setup MPROTx registers.
* The PACR default values are good.*/
.macro init_aips
/*
* Set all MPROTx to be non-bufferable, trusted for R/W,
* not forced to user-mode.
*/
ldr r0, =AIPS1_BASE_ADDR
ldr r1, =0x77777777
str r1, [r0, #0x0]
str r1, [r0, #0x4]
ldr r0, =AIPS2_BASE_ADDR
str r1, [r0, #0x0]
str r1, [r0, #0x4]
.endm /* init_aips */
.macro setup_pll pll, freq
ldr r0, =\pll
ldr r1, =0x00001232
str r1, [r0, #PLL_DP_CTL]
mov r1, #0x2
str r1, [r0, #PLL_DP_CONFIG]
ldr r1, W_DP_OP_\freq
str r1, [r0, #PLL_DP_OP]
str r1, [r0, #PLL_DP_HFS_OP]
ldr r1, W_DP_MFD_\freq
str r1, [r0, #PLL_DP_MFD]
str r1, [r0, #PLL_DP_HFS_MFD]
ldr r1, W_DP_MFN_\freq
str r1, [r0, #PLL_DP_MFN]
str r1, [r0, #PLL_DP_HFS_MFN]
ldr r1, =0x00001232
str r1, [r0, #PLL_DP_CTL]
1: ldr r1, [r0, #PLL_DP_CTL]
ands r1, r1, #0x1
beq 1b
.endm
.macro init_clock
setup_pll PLL3_BASE_ADDR, 400
/* Switch peripheral to PLL3 */
/* Set periph_clk_sel[1:0]=0b10 to PLL3 */
ldr r0, CCM_BASE_ADDR_W
ldr r1, [r0, #CLKCTL_CBCDR]
orr r1, r1, #(3 << 25)
eor r1, r1, #(3 << 25)
orr r1, r1, #(2 << 25)
str r1, [r0, #CLKCTL_CBCDR]
/* make sure change is effective */
1: ldr r1, [r0, #CLKCTL_CDHIPR]
cmp r1, #0x0
bne 1b
setup_pll PLL2_BASE_ADDR, CONFIG_SYS_PLL2_FREQ
/* Switch peripheral to PLL2 */
/* Set periph_clk_sel[1:0]=0b01 to PLL2 */
ldr r0, CCM_BASE_ADDR_W
ldr r1, [r0, #CLKCTL_CBCDR]
orr r1, r1, #(3 << 25)
eor r1, r1, #(3 << 25)
orr r1, r1, #(1 << 25)
orr r1, r1, #(CONFIG_SYS_AHB_PODF << 10)
orr r1, r1, #(CONFIG_SYS_AXIA_PODF << 16)
orr r1, r1, #(CONFIG_SYS_AXIB_PODF << 19)
str r1, [r0, #CLKCTL_CBCDR]
/* make sure change is effective */
1: ldr r1, [r0, #CLKCTL_CDHIPR]
cmp r1, #0x0
bne 1b
setup_pll PLL3_BASE_ADDR, 216
/* Set the platform clock dividers */
ldr r0, PLATFORM_BASE_ADDR_W
ldr r1, PLATFORM_CLOCK_DIV_W
str r1, [r0, #PLATFORM_ICGC]
/* ARM2 run at full speed */
ldr r0, CCM_BASE_ADDR_W
mov r1, #0
str r1, [r0, #CLKCTL_CACRR]
/* make sure change is effective */
1: ldr r1, [r0, #CLKCTL_CDHIPR]
cmp r1, #0x0
bne 1b
/* Restore the default values in the Gate registers */
ldr r1, =0xFFFFFFFF
str r1, [r0, #CLKCTL_CCGR0]
str r1, [r0, #CLKCTL_CCGR1]
str r1, [r0, #CLKCTL_CCGR2]
str r1, [r0, #CLKCTL_CCGR3]
str r1, [r0, #CLKCTL_CCGR4]
str r1, [r0, #CLKCTL_CCGR5]
str r1, [r0, #CLKCTL_CCGR6]
str r1, [r0, #CLKCTL_CCGR7]
/* for cko - for ARM div by 8 */
mov r1, #0x000A0000
add r1, r1, #0x00000F0
str r1, [r0, #CLKCTL_CCOSR]
.endm
.section ".text.init", "x"
.globl lowlevel_init
lowlevel_init:
#ifdef ENABLE_IMPRECISE_ABORT
mrs r1, spsr /* save old spsr */
mrs r0, cpsr /* read out the cpsr */
bic r0, r0, #0x100 /* clear the A bit */
msr spsr, r0 /* update spsr */
add lr, pc, #0x8 /* update lr */
movs pc, lr /* update cpsr */
nop
nop
nop
nop
msr spsr, r1 /* restore old spsr */
#endif
/* ARM errata ID #468414 */
mrc 15, 0, r1, c1, c0, 1
orr r1, r1, #(1 << 5) /* enable L1NEON bit */
mcr 15, 0, r1, c1, c0, 1
init_l2cc
init_aips
init_clock /* not finished */
mov pc, lr
/* Board level setting value */
CCM_BASE_ADDR_W: .word CCM_BASE_ADDR
W_DP_OP_800: .word DP_OP_800
W_DP_MFD_800: .word DP_MFD_800
W_DP_MFN_800: .word DP_MFN_800
W_DP_OP_600: .word DP_OP_600
W_DP_MFD_600: .word DP_MFD_600
W_DP_MFN_600: .word DP_MFN_600
W_DP_OP_400: .word DP_OP_400
W_DP_MFD_400: .word DP_MFD_400
W_DP_MFN_400: .word DP_MFN_400
W_DP_OP_216: .word DP_OP_216
W_DP_MFD_216: .word DP_MFD_216
W_DP_MFN_216: .word DP_MFN_216
PLATFORM_BASE_ADDR_W: .word ARM_BASE_ADDR
PLATFORM_CLOCK_DIV_W: .word 0x00000124

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,73 @@
/*
* January 2004 - Changed to support H4 device
* Copyright (c) 2004 Texas Instruments
*
* (C) Copyright 2002
* Gary Jennejohn, DENX Software Engineering, <gj@denx.de>
*
* (C) Copyright 2010 Freescale Semiconductor, Inc.
*
* See file CREDITS for list of people who contributed to this
* project.
*
* 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.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
*/
OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
OUTPUT_ARCH(arm)
ENTRY(_start)
SECTIONS
{
. = 0x00000000;
. = ALIGN(4);
.text :
{
/* WARNING - the following is hand-optimized to fit within */
/* the sector layout of our flash chips! XXX FIXME XXX */
board/freescale/mx50_rdp/flash_header.o (.text.flasheader)
cpu/arm_cortexa8/start.o
board/freescale/mx50_rdp/libmx50_rdp.a (.text)
lib_arm/libarm.a (.text)
net/libnet.a (.text)
drivers/mtd/libmtd.a (.text)
drivers/mmc/libmmc.a (.text)
. = DEFINED(env_offset) ? env_offset : .;
common/env_embedded.o(.text)
*(.text)
}
. = ALIGN(4);
.rodata : { *(.rodata) }
. = ALIGN(4);
.data : { *(.data) }
. = ALIGN(4);
.got : { *(.got) }
. = .;
__u_boot_cmd_start = .;
.u_boot_cmd : { *(.u_boot_cmd) }
__u_boot_cmd_end = .;
. = ALIGN(4);
__bss_start = .;
.bss : { *(.bss) }
_end = .;
}

View File

@ -0,0 +1,49 @@
#
# Copyright (C) 2007, Guennadi Liakhovetski <lg@denx.de>
#
# (C) Copyright 2009 Freescale Semiconductor, Inc.
#
# 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.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
# MA 02111-1307 USA
#
include $(TOPDIR)/config.mk
LIB = $(obj)lib$(BOARD).a
COBJS := mx51_3stack.o
SOBJS := lowlevel_init.o flash_header.o
SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c)
OBJS := $(addprefix $(obj),$(COBJS))
SOBJS := $(addprefix $(obj),$(SOBJS))
$(LIB): $(obj).depend $(OBJS) $(SOBJS)
$(AR) $(ARFLAGS) $@ $(OBJS) $(SOBJS)
clean:
rm -f $(SOBJS) $(OBJS)
distclean: clean
rm -f $(LIB) core *.bak .depend
#########################################################################
# defines $(obj).depend target
include $(SRCTREE)/rules.mk
sinclude $(obj).depend
#########################################################################

View File

@ -0,0 +1,64 @@
/*
* Copyright 2009 Freescale Semiconductor, Inc. All Rights Reserved.
*/
/*
* The code contained herein is licensed under the GNU General Public
* License. You may obtain a copy of the GNU General Public License
* Version 2 or later at the following locations:
*
* http://www.opensource.org/licenses/gpl-license.html
* http://www.gnu.org/copyleft/gpl.html
*/
#ifndef __BOARD_FREESCALE_BOARD_MX51_3STACK_H__
#define __BOARD_FREESCALE_BOARD_MX51_3STACK_H__
/*!
* @defgroup BRDCFG_MX51 Board Configuration Options
* @ingroup MSL_MX51
*/
/*!
* @file mx51_3stack/board-mx51_3stack.h
*
* @brief This file contains all the board level configuration options.
*
* It currently hold the options defined for MX51 3Stack Platform.
*
* @ingroup BRDCFG_MX51
*/
/* CPLD offsets */
#define PBC_LED_CTRL (0x20000)
#define PBC_SB_STAT (0x20008)
#define PBC_ID_AAAA (0x20040)
#define PBC_ID_5555 (0x20048)
#define PBC_VERSION (0x20050)
#define PBC_ID_CAFE (0x20058)
#define PBC_INT_STAT (0x20010)
#define PBC_INT_MASK (0x20038)
#define PBC_INT_REST (0x20020)
#define PBC_SW_RESET (0x20060)
/* LED switchs */
#define LED_SWITCH_REG 0x00
/* buttons */
#define SWITCH_BUTTONS_REG 0x08
/* status, interrupt */
#define INTR_STATUS_REG 0x10
#define INTR_MASK_REG 0x38
#define INTR_RESET_REG 0x20
/* magic word for debug CPLD */
#define MAGIC_NUMBER1_REG 0x40
#define MAGIC_NUMBER2_REG 0x48
/* CPLD code version */
#define CPLD_CODE_VER_REG 0x50
/* magic word for debug CPLD */
#define MAGIC_NUMBER3_REG 0x58
/* module reset register*/
#define MODULE_RESET_REG 0x60
/* CPU ID and Personality ID */
#define MCU_BOARD_ID_REG 0x68
#endif /* __BOARD_FREESCALE_BOARD_MX51_3STACK_H__ */

View File

@ -0,0 +1,3 @@
LDSCRIPT := $(SRCTREE)/board/$(VENDOR)/$(BOARD)/u-boot.lds
TEXT_BASE = 0x97800000

View File

@ -0,0 +1,113 @@
/*
* Copyright 2009 Freescale Semiconductor, Inc.
*
* 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.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
*/
#include <config.h>
#include <asm/arch/mx51.h>
#include "board-mx51_3stack.h"
#ifdef CONFIG_FLASH_HEADER
#ifndef CONFIG_FLASH_HEADER_OFFSET
# error "Must define the offset of flash header"
#endif
#define MXC_DCD_ITEM(i, type, addr, val) \
dcd_node_##i: \
.word type ; \
.word addr ; \
.word val ; \
.section ".text.flasheader", "x"
b _start
.org CONFIG_FLASH_HEADER_OFFSET
app_code_jump_v: .word _start
app_code_code_barker: .word CONFIG_FLASH_HEADER_BARKER
app_code_csf: .word 0
dcd_ptr_ptr: .word dcd_ptr
super_root_key: .word 0
dcd_ptr: .word dcd_array_start
app_dest_ptr: .word TEXT_BASE
dcd_array_start:
magic: .word 0xB17219E9
dcd_array_size: .word dcd_data_end - dcd_array_start - 8
/* DCD */
/* DDR2 IOMUX configuration */
MXC_DCD_ITEM(1, 4, IOMUXC_BASE_ADDR + 0x8a0, 0x200)
MXC_DCD_ITEM(2, 4, IOMUXC_BASE_ADDR + 0x50c, 0x20c5)
MXC_DCD_ITEM(3, 4, IOMUXC_BASE_ADDR + 0x510, 0x20c5)
MXC_DCD_ITEM(4, 4, IOMUXC_BASE_ADDR + 0x83c, 0x2)
MXC_DCD_ITEM(5, 4, IOMUXC_BASE_ADDR + 0x848, 0x2)
MXC_DCD_ITEM(6, 4, IOMUXC_BASE_ADDR + 0x4b8, 0xe7)
MXC_DCD_ITEM(7, 4, IOMUXC_BASE_ADDR + 0x4bc, 0x45)
MXC_DCD_ITEM(8, 4, IOMUXC_BASE_ADDR + 0x4c0, 0x45)
MXC_DCD_ITEM(9, 4, IOMUXC_BASE_ADDR + 0x4c4, 0x45)
MXC_DCD_ITEM(10, 4, IOMUXC_BASE_ADDR + 0x4c8, 0x45)
MXC_DCD_ITEM(11, 4, IOMUXC_BASE_ADDR + 0x820, 0x0)
MXC_DCD_ITEM(12, 4, IOMUXC_BASE_ADDR + 0x4a4, 0x3)
MXC_DCD_ITEM(13, 4, IOMUXC_BASE_ADDR + 0x4a8, 0x3)
MXC_DCD_ITEM(14, 4, IOMUXC_BASE_ADDR + 0x4ac, 0xe3)
MXC_DCD_ITEM(15, 4, IOMUXC_BASE_ADDR + 0x4b0, 0xe3)
MXC_DCD_ITEM(16, 4, IOMUXC_BASE_ADDR + 0x4b4, 0xe3)
MXC_DCD_ITEM(17, 4, IOMUXC_BASE_ADDR + 0x4cc, 0xe3)
MXC_DCD_ITEM(18, 4, IOMUXC_BASE_ADDR + 0x4d0, 0xe2)
/* Set drive strength to MAX */
MXC_DCD_ITEM(19, 4, IOMUXC_BASE_ADDR + 0x82c, 0x6)
MXC_DCD_ITEM(20, 4, IOMUXC_BASE_ADDR + 0x8a4, 0x6)
MXC_DCD_ITEM(21, 4, IOMUXC_BASE_ADDR + 0x8ac, 0x6)
MXC_DCD_ITEM(22, 4, IOMUXC_BASE_ADDR + 0x8b8, 0x6)
/* 13 ROW, 10 COL, 32Bit, SREF=4 Micron Model */
/* CAS=3, BL=4 */
MXC_DCD_ITEM(23, 4, ESDCTL_BASE_ADDR + ESDCTL_ESDCTL0, 0x82a20000)
MXC_DCD_ITEM(24, 4, ESDCTL_BASE_ADDR + ESDCTL_ESDCTL1, 0x82a20000)
MXC_DCD_ITEM(25, 4, ESDCTL_BASE_ADDR + ESDCTL_ESDMISC, 0x000ad0d0)
MXC_DCD_ITEM(26, 4, ESDCTL_BASE_ADDR + ESDCTL_ESDCFG0, 0x333574aa)
MXC_DCD_ITEM(27, 4, ESDCTL_BASE_ADDR + ESDCTL_ESDCFG1, 0x333574aa)
/* Init DRAM on CS0 */
MXC_DCD_ITEM(28, 4, ESDCTL_BASE_ADDR + ESDCTL_ESDSCR, 0x04008008)
MXC_DCD_ITEM(29, 4, ESDCTL_BASE_ADDR + ESDCTL_ESDSCR, 0x0000801a)
MXC_DCD_ITEM(30, 4, ESDCTL_BASE_ADDR + ESDCTL_ESDSCR, 0x0000801b)
MXC_DCD_ITEM(31, 4, ESDCTL_BASE_ADDR + ESDCTL_ESDSCR, 0x00448019)
MXC_DCD_ITEM(32, 4, ESDCTL_BASE_ADDR + ESDCTL_ESDSCR, 0x07328018)
MXC_DCD_ITEM(33, 4, ESDCTL_BASE_ADDR + ESDCTL_ESDSCR, 0x04008008)
MXC_DCD_ITEM(34, 4, ESDCTL_BASE_ADDR + ESDCTL_ESDSCR, 0x00008010)
MXC_DCD_ITEM(35, 4, ESDCTL_BASE_ADDR + ESDCTL_ESDSCR, 0x00008010)
MXC_DCD_ITEM(36, 4, ESDCTL_BASE_ADDR + ESDCTL_ESDSCR, 0x06328018)
MXC_DCD_ITEM(37, 4, ESDCTL_BASE_ADDR + ESDCTL_ESDSCR, 0x03808019)
MXC_DCD_ITEM(38, 4, ESDCTL_BASE_ADDR + ESDCTL_ESDSCR, 0x00408019)
MXC_DCD_ITEM(39, 4, ESDCTL_BASE_ADDR + ESDCTL_ESDSCR, 0x00008000)
/* Init DRAM on CS1 */
MXC_DCD_ITEM(40, 4, ESDCTL_BASE_ADDR + ESDCTL_ESDSCR, 0x0400800c)
MXC_DCD_ITEM(41, 4, ESDCTL_BASE_ADDR + ESDCTL_ESDSCR, 0x0000801e)
MXC_DCD_ITEM(42, 4, ESDCTL_BASE_ADDR + ESDCTL_ESDSCR, 0x0000801f)
MXC_DCD_ITEM(43, 4, ESDCTL_BASE_ADDR + ESDCTL_ESDSCR, 0x0000801d)
MXC_DCD_ITEM(44, 4, ESDCTL_BASE_ADDR + ESDCTL_ESDSCR, 0x0732801c)
MXC_DCD_ITEM(45, 4, ESDCTL_BASE_ADDR + ESDCTL_ESDSCR, 0x0400800c)
MXC_DCD_ITEM(46, 4, ESDCTL_BASE_ADDR + ESDCTL_ESDSCR, 0x00008014)
MXC_DCD_ITEM(47, 4, ESDCTL_BASE_ADDR + ESDCTL_ESDSCR, 0x00008014)
MXC_DCD_ITEM(48, 4, ESDCTL_BASE_ADDR + ESDCTL_ESDSCR, 0x0632801c)
MXC_DCD_ITEM(49, 4, ESDCTL_BASE_ADDR + ESDCTL_ESDSCR, 0x0380801d)
MXC_DCD_ITEM(50, 4, ESDCTL_BASE_ADDR + ESDCTL_ESDSCR, 0x0040801d)
MXC_DCD_ITEM(51, 4, ESDCTL_BASE_ADDR + ESDCTL_ESDSCR, 0x00008004)
MXC_DCD_ITEM(52, 4, ESDCTL_BASE_ADDR + ESDCTL_ESDCTL0, 0xb2a20000)
MXC_DCD_ITEM(53, 4, ESDCTL_BASE_ADDR + ESDCTL_ESDCTL1, 0xb2a20000)
MXC_DCD_ITEM(54, 4, ESDCTL_BASE_ADDR + ESDCTL_ESDMISC, 0x000ad6d0)
MXC_DCD_ITEM(55, 4, ESDCTL_BASE_ADDR + ESDCTL_ESDCDLYGD, 0x90000000)
MXC_DCD_ITEM(56, 4, ESDCTL_BASE_ADDR + ESDCTL_ESDSCR, 0x00000000)
dcd_data_end:
//image_len: .word 0x80000
image_len: .word __u_boot_cmd_end - TEXT_BASE
#endif

View File

@ -0,0 +1,365 @@
/*
* Copyright (C) 2007, Guennadi Liakhovetski <lg@denx.de>
*
* (C) Copyright 2009-2010 Freescale Semiconductor, Inc.
*
* 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.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
*/
#include <config.h>
#include <asm/arch/mx51.h>
#include "board-mx51_3stack.h"
/*
* return soc version
* 0x10: TO1
* 0x20: TO2
* 0x30: TO3
*/
.macro check_soc_version ret, tmp
.endm
/*
* L2CC Cache setup/invalidation/disable
*/
.macro init_l2cc
/* explicitly disable L2 cache */
mrc 15, 0, r0, c1, c0, 1
bic r0, r0, #0x2
mcr 15, 0, r0, c1, c0, 1
/* reconfigure L2 cache aux control reg */
mov r0, #0xC0 /* tag RAM */
add r0, r0, #0x4 /* data RAM */
orr r0, r0, #(1 << 24) /* disable write allocate delay */
orr r0, r0, #(1 << 23) /* disable write allocate combine */
orr r0, r0, #(1 << 22) /* disable write allocate */
ldr r1, =0x00000000
ldr r3, [r1, #ROM_SI_REV]
cmp r3, #0x10 /* r3 contains the silicon rev */
/* disable write combine for TO 2 and lower */
orrls r0, r0, #(1 << 25)
mcr 15, 1, r0, c9, c0, 2
.endm /* init_l2cc */
/* AIPS setup - Only setup MPROTx registers.
* The PACR default values are good.*/
.macro init_aips
/*
* Set all MPROTx to be non-bufferable, trusted for R/W,
* not forced to user-mode.
*/
ldr r0, =AIPS1_BASE_ADDR
ldr r1, =0x77777777
str r1, [r0, #0x0]
str r1, [r0, #0x4]
ldr r0, =AIPS2_BASE_ADDR
str r1, [r0, #0x0]
str r1, [r0, #0x4]
/*
* Clear the on and off peripheral modules Supervisor Protect bit
* for SDMA to access them. Did not change the AIPS control registers
* (offset 0x20) access type
*/
.endm /* init_aips */
/* MAX (Multi-Layer AHB Crossbar Switch) setup */
.macro init_max
.endm /* init_max */
/* M4IF setup */
.macro init_m4if
/* VPU and IPU given higher priority (0x4)
* IPU accesses with ID=0x1 given highest priority (=0xA)
*/
ldr r0, =M4IF_BASE_ADDR
ldr r1, =0x00000203
str r1, [r0, #0x40]
ldr r1, =0x0
str r1, [r0, #0x44]
ldr r1, =0x00120125
str r1, [r0, #0x9C]
ldr r1, =0x001901A3
str r1, [r0, #0x48]
.endm /* init_m4if */
/* To support 133MHz DDR */
.macro init_drive_strength
.endm /* init_drive_strength */
/* CPLD on CS5 setup */
.macro init_debug_board
.endm /* init_debug_board */
.macro setup_pll pll, freq
ldr r2, =\pll
ldr r1, =0x00001232
str r1, [r2, #PLL_DP_CTL] /* Set DPLL ON (set UPEN bit): BRMO=1 */
mov r1, #0x2
str r1, [r2, #PLL_DP_CONFIG] /* Enable auto-restart AREN bit */
str r3, [r2, #PLL_DP_OP]
str r3, [r2, #PLL_DP_HFS_OP]
str r4, [r2, #PLL_DP_MFD]
str r4, [r2, #PLL_DP_HFS_MFD]
str r5, [r2, #PLL_DP_MFN]
str r5, [r2, #PLL_DP_HFS_MFN]
ldr r1, =0x00001232
str r1, [r2, #PLL_DP_CTL]
1: ldr r1, [r2, #PLL_DP_CTL]
ands r1, r1, #0x1
beq 1b
.endm
.macro init_clock
ldr r0, =CCM_BASE_ADDR
/* Gate of clocks to the peripherals first */
ldr r1, =0x3FFFFFFF
str r1, [r0, #CLKCTL_CCGR0]
ldr r1, =0x0
str r1, [r0, #CLKCTL_CCGR1]
str r1, [r0, #CLKCTL_CCGR2]
str r1, [r0, #CLKCTL_CCGR3]
ldr r1, =0x00030000
str r1, [r0, #CLKCTL_CCGR4]
ldr r1, =0x00FFF030
str r1, [r0, #CLKCTL_CCGR5]
ldr r1, =0x00000300
str r1, [r0, #CLKCTL_CCGR6]
/* Disable IPU and HSC dividers */
mov r1, #0x60000
str r1, [r0, #CLKCTL_CCDR]
/* Make sure to switch the DDR away from PLL 1 */
ldr r1, =0x19239145
str r1, [r0, #CLKCTL_CBCDR]
/* make sure divider effective */
1: ldr r1, [r0, #CLKCTL_CDHIPR]
cmp r1, #0x0
bne 1b
/* Switch ARM to step clock */
mov r1, #0x4
str r1, [r0, #CLKCTL_CCSR]
mov r3, #DP_OP_800
mov r4, #DP_MFD_800
mov r5, #DP_MFN_800
setup_pll PLL1_BASE_ADDR
mov r3, #DP_OP_665
mov r4, #DP_MFD_665
mov r5, #DP_MFN_665
setup_pll PLL3_BASE_ADDR
/* Switch peripheral to PLL 3 */
ldr r0, =CCM_BASE_ADDR
ldr r1, =0x000010C0
str r1, [r0, #CLKCTL_CBCMR]
ldr r1, =0x13239145
str r1, [r0, #CLKCTL_CBCDR]
mov r3, #DP_OP_665
mov r4, #DP_MFD_665
mov r5, #DP_MFN_665
setup_pll PLL2_BASE_ADDR
/* Switch peripheral to PLL2 */
ldr r0, =CCM_BASE_ADDR
ldr r1, =0x19239145
str r1, [r0, #CLKCTL_CBCDR]
ldr r1, =0x000020C0
str r1, [r0, #CLKCTL_CBCMR]
mov r3, #DP_OP_216
mov r4, #DP_MFD_216
mov r5, #DP_MFN_216
setup_pll PLL3_BASE_ADDR
/* Set the platform clock dividers */
ldr r0, =ARM_BASE_ADDR
ldr r1, =0x00000725
str r1, [r0, #0x14]
ldr r0, =CCM_BASE_ADDR
/* Run TO 3.0 at Full speed, for other TO's wait
till we increase VDDGP */
ldr r1, =0x0
ldr r3, [r1, #ROM_SI_REV]
cmp r3, #0x10
movls r1, #0x1
movhi r1, #0
str r1, [r0, #CLKCTL_CACRR]
/* Switch ARM back to PLL 1 */
mov r1, #0
str r1, [r0, #CLKCTL_CCSR]
/* setup the rest */
/* Use lp_apm (24MHz) source for perclk */
ldr r1, =0x000020C2
str r1, [r0, #CLKCTL_CBCMR]
/* ddr clock from PLL 1, all perclk dividers are 1 since using 24MHz */
#ifdef CONFIG_IMX51_MDDR
ldr r1, =0x61E35100
#else
ldr r1, =0x59E35100
#endif
str r1, [r0, #CLKCTL_CBCDR]
/* Restore the default values in the Gate registers */
ldr r1, =0xFFFFFFFF
str r1, [r0, #CLKCTL_CCGR0]
str r1, [r0, #CLKCTL_CCGR1]
str r1, [r0, #CLKCTL_CCGR2]
str r1, [r0, #CLKCTL_CCGR3]
str r1, [r0, #CLKCTL_CCGR4]
str r1, [r0, #CLKCTL_CCGR5]
str r1, [r0, #CLKCTL_CCGR6]
/* Use PLL 2 for UART's, get 66.5MHz from it */
ldr r1, =0xA5A2A020
str r1, [r0, #CLKCTL_CSCMR1]
ldr r1, =0x00C30321
str r1, [r0, #CLKCTL_CSCDR1]
/* make sure divider effective */
1: ldr r1, [r0, #CLKCTL_CDHIPR]
cmp r1, #0x0
bne 1b
mov r1, #0x0
str r1, [r0, #CLKCTL_CCDR]
/* for cko - for ARM div by 8 */
mov r1, #0x000A0000
add r1, r1, #0x00000F0
str r1, [r0, #CLKCTL_CCOSR]
.endm
.macro setup_wdog
ldr r0, =WDOG1_BASE_ADDR
mov r1, #0x30
strh r1, [r0]
.endm
.macro setup_sdram
ldr r0, =ESDCTL_BASE_ADDR
/* Set CSD0 */
mov r1, #0x80000000
str r1, [r0, #ESDCTL_ESDCTL0]
/* Precharge command */
ldr r1, DDR_PERCHARGE_CMD
str r1, [r0, #ESDCTL_ESDSCR]
/* 2 refresh commands */
ldr r1, DDR_REFRESH_CMD
str r1, [r0, #ESDCTL_ESDSCR]
str r1, [r0, #ESDCTL_ESDSCR]
/* LMR with CAS=3 and BL=3 */
ldr r1, DDR_LMR1_W
str r1, [r0, #ESDCTL_ESDSCR]
/* 13 ROW, 10 COL, 32Bit, SREF=4 Micron Model */
ldr r1, DDR_LMR_CMD
str r1, [r0, #ESDCTL_ESDCTL0]
/* Timing parameters */
ldr r1, DDR_TIMING_W
str r1, [r0, #ESDCTL_ESDCFG0]
/* MDDR enable, RLAT=2 */
ldr r1, DDR_MISC_W
str r1, [r0, #ESDCTL_ESDMISC]
/* Normal mode */
mov r1, #0x00000000
str r1, [r0, #ESDCTL_ESDSCR]
1:
.endm /* setup_sdram */
.section ".text.init", "x"
.globl lowlevel_init
lowlevel_init:
ldr r1, =0x00000000
ldr r3, [r1, #ROM_SI_REV]
ldr r0, =GPC_BASE_ADDR
cmp r3, #0x10 // r3 contains the silicon rev
ldrls r1, =0x1FC00000
ldrhi r1, =0x1A800000
str r1, [r0, #4]
#ifdef ENABLE_IMPRECISE_ABORT
mrs r1, spsr /* save old spsr */
mrs r0, cpsr /* read out the cpsr */
bic r0, r0, #0x100 /* clear the A bit */
msr spsr, r0 /* update spsr */
add lr, pc, #0x8 /* update lr */
movs pc, lr /* update cpsr */
nop
nop
nop
nop
msr spsr, r1 /* restore old spsr */
#endif
/* ARM errata ID #468414 */
mrc 15, 0, r1, c1, c0, 1
orr r1, r1, #(1 << 5) /* enable L1NEON bit */
mcr 15, 0, r1, c1, c0, 1
init_l2cc
init_aips
init_max
init_m4if
init_drive_strength
cmp pc, #PHYS_SDRAM_1
blo do_sdram_setup
cmp pc, #(PHYS_SDRAM_1 + PHYS_SDRAM_1_SIZE)
blo init_clock_start
do_sdram_setup:
setup_sdram
init_clock_start:
init_clock
init_debug_board
/*init_sdram*/
/* return from mxc_nand_load */
/* r12 saved upper lr*/
b mxc_nand_load
/* Board level setting value */
DDR_PERCHARGE_CMD: .word 0x04008008
DDR_REFRESH_CMD: .word 0x00008010
DDR_LMR1_W: .word 0x00338018
DDR_LMR_CMD: .word 0xB2220000
DDR_TIMING_W: .word 0xB02567A9
DDR_MISC_W: .word 0x000A0104

View File

@ -0,0 +1,988 @@
/*
* Copyright (C) 2007, Guennadi Liakhovetski <lg@denx.de>
*
* (C) Copyright 2009-2010 Freescale Semiconductor, Inc.
*
* See file CREDITS for list of people who contributed to this
* project.
*
* 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.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
*/
#include <common.h>
#include <asm/io.h>
#include <asm/errno.h>
#include <asm/arch/mx51.h>
#include <asm/arch/mx51_pins.h>
#include <asm/arch/iomux.h>
#include <i2c.h>
#include "board-mx51_3stack.h"
#include <netdev.h>
#ifdef CONFIG_CMD_MMC
#include <mmc.h>
#include <fsl_esdhc.h>
#endif
#ifdef CONFIG_ARCH_MMU
#include <asm/mmu.h>
#include <asm/arch/mmu.h>
#endif
#ifdef CONFIG_ANDROID_RECOVERY
#include "../common/recovery.h"
#include <mxc_keyb.h>
#include <part.h>
#include <ext2fs.h>
#include <linux/mtd/mtd.h>
#include <linux/mtd/partitions.h>
#include <ubi_uboot.h>
#include <jffs2/load_kernel.h>
#endif
DECLARE_GLOBAL_DATA_PTR;
static u32 system_rev;
static enum boot_device boot_dev;
u32 mx51_io_base_addr;
static inline void setup_boot_device(void)
{
uint *fis_addr = (uint *)IRAM_BASE_ADDR;
switch (*fis_addr) {
case NAND_FLASH_BOOT:
boot_dev = NAND_BOOT;
break;
case SPI_NOR_FLASH_BOOT:
boot_dev = SPI_NOR_BOOT;
break;
case MMC_FLASH_BOOT:
boot_dev = MMC_BOOT;
break;
default:
{
uint soc_sbmr = readl(SRC_BASE_ADDR + 0x4);
uint bt_mem_ctl = soc_sbmr & 0x00000003;
uint bt_mem_type = (soc_sbmr & 0x00000180) >> 7;
switch (bt_mem_ctl) {
case 0x3:
if (bt_mem_type == 0)
boot_dev = MMC_BOOT;
else if (bt_mem_type == 3)
boot_dev = SPI_NOR_BOOT;
else
boot_dev = UNKNOWN_BOOT;
break;
case 0x1:
boot_dev = NAND_BOOT;
break;
default:
boot_dev = UNKNOWN_BOOT;
}
}
break;
}
}
enum boot_device get_boot_device(void)
{
return boot_dev;
}
u32 get_board_rev(void)
{
return system_rev;
}
static inline void setup_soc_rev(void)
{
int reg;
#ifdef CONFIG_ARCH_MMU
reg = __REG(0x20000000 + ROM_SI_REV); /* Virtual address */
#else
reg = __REG(ROM_SI_REV); /* Virtual address */
#endif
switch (reg) {
case 0x02:
system_rev = 0x51000 | CHIP_REV_1_1;
break;
case 0x10:
system_rev = 0x51000 | CHIP_REV_2_0;
break;
default:
system_rev = 0x51000 | CHIP_REV_1_0;
}
}
static inline void set_board_rev(int rev)
{
system_rev |= (rev & 0xF) << 8;
}
inline int is_soc_rev(int rev)
{
return (system_rev & 0xFF) - rev;
}
#ifdef CONFIG_ARCH_MMU
void board_mmu_init(void)
{
unsigned long ttb_base = PHYS_SDRAM_1 + 0x4000;
unsigned long i;
/*
* Set the TTB register
*/
asm volatile ("mcr p15, 0, %0, c2, c0, 0" : : "r"(ttb_base) /*:*/);
/*
* Set the Domain Access Control Register
*/
i = ARM_ACCESS_DACR_DEFAULT;
asm volatile ("mcr p15, 0, %0, c3, c0, 0" : : "r"(i) /*:*/);
/*
* First clear all TT entries - ie Set them to Faulting
*/
memset((void *)ttb_base, 0, ARM_FIRST_LEVEL_PAGE_TABLE_SIZE);
/* Actual Virtual Size Attributes Function */
/* Base Base MB cached? buffered? access permissions */
/* xxx00000 xxx00000 */
X_ARM_MMU_SECTION(0x000, 0x200, 0x1,
ARM_UNCACHEABLE, ARM_UNBUFFERABLE,
ARM_ACCESS_PERM_RW_RW); /* ROM */
X_ARM_MMU_SECTION(0x1FF, 0x1FF, 0x001,
ARM_UNCACHEABLE, ARM_UNBUFFERABLE,
ARM_ACCESS_PERM_RW_RW); /* IRAM */
X_ARM_MMU_SECTION(0x300, 0x300, 0x100,
ARM_UNCACHEABLE, ARM_UNBUFFERABLE,
ARM_ACCESS_PERM_RW_RW); /* GPU */
X_ARM_MMU_SECTION(0x400, 0x400, 0x200,
ARM_UNCACHEABLE, ARM_UNBUFFERABLE,
ARM_ACCESS_PERM_RW_RW); /* IPUv3D */
X_ARM_MMU_SECTION(0x600, 0x600, 0x300,
ARM_UNCACHEABLE, ARM_UNBUFFERABLE,
ARM_ACCESS_PERM_RW_RW); /* periperals */
X_ARM_MMU_SECTION(0x900, 0x000, 0x080,
ARM_CACHEABLE, ARM_BUFFERABLE,
ARM_ACCESS_PERM_RW_RW); /* SDRAM */
X_ARM_MMU_SECTION(0x900, 0x900, 0x080,
ARM_CACHEABLE, ARM_BUFFERABLE,
ARM_ACCESS_PERM_RW_RW); /* SDRAM */
X_ARM_MMU_SECTION(0x900, 0x980, 0x080,
ARM_UNCACHEABLE, ARM_UNBUFFERABLE,
ARM_ACCESS_PERM_RW_RW); /* SDRAM 0:128M*/
X_ARM_MMU_SECTION(0xA00, 0xA00, 0x100,
ARM_CACHEABLE, ARM_BUFFERABLE,
ARM_ACCESS_PERM_RW_RW); /* SDRAM */
X_ARM_MMU_SECTION(0xB80, 0xB80, 0x10,
ARM_UNCACHEABLE, ARM_UNBUFFERABLE,
ARM_ACCESS_PERM_RW_RW); /* CS1 EIM control*/
X_ARM_MMU_SECTION(0xCC0, 0xCC0, 0x040,
ARM_UNCACHEABLE, ARM_UNBUFFERABLE,
ARM_ACCESS_PERM_RW_RW); /* CS4/5/NAND Flash buffer */
/* Workaround for arm errata #709718 */
/* Setup PRRR so device is always mapped to non-shared */
asm volatile ("mrc p15, 0, %0, c10, c2, 0" : "=r"(i) : /*:*/);
i &= (~(3 << 0x10));
asm volatile ("mcr p15, 0, %0, c10, c2, 0" : : "r"(i) /*:*/);
/* Enable MMU */
MMU_ON();
}
#endif
int dram_init(void)
{
gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
return 0;
}
static void setup_uart(void)
{
unsigned int pad = PAD_CTL_HYS_ENABLE | PAD_CTL_PKE_ENABLE |
PAD_CTL_PUE_PULL | PAD_CTL_DRV_HIGH;
mxc_request_iomux(MX51_PIN_UART1_RXD, IOMUX_CONFIG_ALT0);
mxc_iomux_set_pad(MX51_PIN_UART1_RXD, pad | PAD_CTL_SRE_FAST);
mxc_request_iomux(MX51_PIN_UART1_TXD, IOMUX_CONFIG_ALT0);
mxc_iomux_set_pad(MX51_PIN_UART1_TXD, pad | PAD_CTL_SRE_FAST);
mxc_request_iomux(MX51_PIN_UART1_RTS, IOMUX_CONFIG_ALT0);
mxc_iomux_set_pad(MX51_PIN_UART1_RTS, pad);
mxc_request_iomux(MX51_PIN_UART1_CTS, IOMUX_CONFIG_ALT0);
mxc_iomux_set_pad(MX51_PIN_UART1_CTS, pad);
}
void setup_nfc(void)
{
/* Enable NFC IOMUX */
mxc_request_iomux(MX51_PIN_NANDF_CS0, IOMUX_CONFIG_ALT0);
mxc_request_iomux(MX51_PIN_NANDF_CS1, IOMUX_CONFIG_ALT0);
mxc_request_iomux(MX51_PIN_NANDF_CS2, IOMUX_CONFIG_ALT0);
mxc_request_iomux(MX51_PIN_NANDF_CS3, IOMUX_CONFIG_ALT0);
mxc_request_iomux(MX51_PIN_NANDF_CS4, IOMUX_CONFIG_ALT0);
mxc_request_iomux(MX51_PIN_NANDF_CS5, IOMUX_CONFIG_ALT0);
mxc_request_iomux(MX51_PIN_NANDF_CS6, IOMUX_CONFIG_ALT0);
mxc_request_iomux(MX51_PIN_NANDF_CS7, IOMUX_CONFIG_ALT0);
}
static void setup_expio(void)
{
u32 reg;
/* CS5 setup */
mxc_request_iomux(MX51_PIN_EIM_CS5, IOMUX_CONFIG_ALT0);
writel(0x00410089, WEIM_BASE_ADDR + 0x78 + CSGCR1);
writel(0x00000002, WEIM_BASE_ADDR + 0x78 + CSGCR2);
/* RWSC=50, RADVA=2, RADVN=6, OEA=0, OEN=0, RCSA=0, RCSN=0 */
writel(0x32260000, WEIM_BASE_ADDR + 0x78 + CSRCR1);
/* APR = 0 */
writel(0x00000000, WEIM_BASE_ADDR + 0x78 + CSRCR2);
/* WAL=0, WBED=1, WWSC=50, WADVA=2, WADVN=6, WEA=0, WEN=0,
* WCSA=0, WCSN=0
*/
writel(0x72080F00, WEIM_BASE_ADDR + 0x78 + CSWCR1);
if ((readw(CS5_BASE_ADDR + PBC_ID_AAAA) == 0xAAAA) &&
(readw(CS5_BASE_ADDR + PBC_ID_5555) == 0x5555)) {
if (is_soc_rev(CHIP_REV_2_0) < 0) {
reg = readl(CCM_BASE_ADDR + CLKCTL_CBCDR);
reg = (reg & (~0x70000)) | 0x30000;
writel(reg, CCM_BASE_ADDR + CLKCTL_CBCDR);
/* make sure divider effective */
while (readl(CCM_BASE_ADDR + CLKCTL_CDHIPR) != 0)
;
writel(0x0, CCM_BASE_ADDR + CLKCTL_CCDR);
}
mx51_io_base_addr = CS5_BASE_ADDR;
} else {
/* CS1 */
writel(0x00410089, WEIM_BASE_ADDR + 0x18 + CSGCR1);
writel(0x00000002, WEIM_BASE_ADDR + 0x18 + CSGCR2);
/* RWSC=50, RADVA=2, RADVN=6, OEA=0, OEN=0, RCSA=0, RCSN=0 */
writel(0x32260000, WEIM_BASE_ADDR + 0x18 + CSRCR1);
/* APR=0 */
writel(0x00000000, WEIM_BASE_ADDR + 0x18 + CSRCR2);
/* WAL=0, WBED=1, WWSC=50, WADVA=2, WADVN=6, WEA=0,
* WEN=0, WCSA=0, WCSN=0
*/
writel(0x72080F00, WEIM_BASE_ADDR + 0x18 + CSWCR1);
mx51_io_base_addr = CS1_BASE_ADDR;
}
/* Reset interrupt status reg */
writew(0x1F, mx51_io_base_addr + PBC_INT_REST);
writew(0x00, mx51_io_base_addr + PBC_INT_REST);
writew(0xFFFF, mx51_io_base_addr + PBC_INT_MASK);
/* Reset the XUART and Ethernet controllers */
reg = readw(mx51_io_base_addr + PBC_SW_RESET);
reg |= 0x9;
writew(reg, mx51_io_base_addr + PBC_SW_RESET);
reg &= ~0x9;
writew(reg, mx51_io_base_addr + PBC_SW_RESET);
}
#if defined(CONFIG_MXC_ATA)
int setup_ata(void)
{
u32 pad;
pad = (PAD_CTL_DRV_HIGH | PAD_CTL_DRV_VOT_HIGH);
/* Need to disable nand iomux first */
mxc_request_iomux(MX51_PIN_NANDF_ALE, IOMUX_CONFIG_ALT1);
mxc_iomux_set_pad(MX51_PIN_NANDF_ALE, pad);
mxc_request_iomux(MX51_PIN_NANDF_CS2, IOMUX_CONFIG_ALT1);
mxc_iomux_set_pad(MX51_PIN_NANDF_CS2, pad);
mxc_request_iomux(MX51_PIN_NANDF_CS3, IOMUX_CONFIG_ALT1);
mxc_iomux_set_pad(MX51_PIN_NANDF_CS3, pad);
mxc_request_iomux(MX51_PIN_NANDF_CS4, IOMUX_CONFIG_ALT1);
mxc_iomux_set_pad(MX51_PIN_NANDF_CS4, pad);
mxc_request_iomux(MX51_PIN_NANDF_CS5, IOMUX_CONFIG_ALT1);
mxc_iomux_set_pad(MX51_PIN_NANDF_CS5, pad);
mxc_request_iomux(MX51_PIN_NANDF_CS6, IOMUX_CONFIG_ALT1);
mxc_iomux_set_pad(MX51_PIN_NANDF_CS6, pad);
mxc_request_iomux(MX51_PIN_NANDF_RE_B, IOMUX_CONFIG_ALT1);
mxc_iomux_set_pad(MX51_PIN_NANDF_RE_B, pad);
mxc_request_iomux(MX51_PIN_NANDF_WE_B, IOMUX_CONFIG_ALT1);
mxc_iomux_set_pad(MX51_PIN_NANDF_WE_B, pad);
mxc_request_iomux(MX51_PIN_NANDF_CLE, IOMUX_CONFIG_ALT1);
mxc_iomux_set_pad(MX51_PIN_NANDF_CLE, pad);
mxc_request_iomux(MX51_PIN_NANDF_RB0, IOMUX_CONFIG_ALT1);
mxc_iomux_set_pad(MX51_PIN_NANDF_RB0, pad);
mxc_request_iomux(MX51_PIN_NANDF_WP_B, IOMUX_CONFIG_ALT1);
mxc_iomux_set_pad(MX51_PIN_NANDF_WP_B, pad);
/* TO 2.0 */
mxc_request_iomux(MX51_PIN_GPIO_NAND, IOMUX_CONFIG_ALT1);
mxc_iomux_set_pad(MX51_PIN_GPIO_NAND, pad);
/* TO 1.0 */
mxc_request_iomux(MX51_PIN_NANDF_RB5, IOMUX_CONFIG_ALT1);
mxc_iomux_set_pad(MX51_PIN_NANDF_RB5, pad);
mxc_request_iomux(MX51_PIN_NANDF_RB1, IOMUX_CONFIG_ALT1);
mxc_iomux_set_pad(MX51_PIN_NANDF_RB1, pad);
mxc_request_iomux(MX51_PIN_NANDF_D0, IOMUX_CONFIG_ALT1);
mxc_iomux_set_pad(MX51_PIN_NANDF_D0, pad);
mxc_request_iomux(MX51_PIN_NANDF_D1, IOMUX_CONFIG_ALT1);
mxc_iomux_set_pad(MX51_PIN_NANDF_D1, pad);
mxc_request_iomux(MX51_PIN_NANDF_D2, IOMUX_CONFIG_ALT1);
mxc_iomux_set_pad(MX51_PIN_NANDF_D2, pad);
mxc_request_iomux(MX51_PIN_NANDF_D3, IOMUX_CONFIG_ALT1);
mxc_iomux_set_pad(MX51_PIN_NANDF_D3, pad);
mxc_request_iomux(MX51_PIN_NANDF_D4, IOMUX_CONFIG_ALT1);
mxc_iomux_set_pad(MX51_PIN_NANDF_D4, pad);
mxc_request_iomux(MX51_PIN_NANDF_D5, IOMUX_CONFIG_ALT1);
mxc_iomux_set_pad(MX51_PIN_NANDF_D5, pad);
mxc_request_iomux(MX51_PIN_NANDF_D6, IOMUX_CONFIG_ALT1);
mxc_iomux_set_pad(MX51_PIN_NANDF_D6, pad);
mxc_request_iomux(MX51_PIN_NANDF_D7, IOMUX_CONFIG_ALT1);
mxc_iomux_set_pad(MX51_PIN_NANDF_D7, pad);
mxc_request_iomux(MX51_PIN_NANDF_D8, IOMUX_CONFIG_ALT1);
mxc_iomux_set_pad(MX51_PIN_NANDF_D8, pad);
mxc_request_iomux(MX51_PIN_NANDF_D9, IOMUX_CONFIG_ALT1);
mxc_iomux_set_pad(MX51_PIN_NANDF_D9, pad);
mxc_request_iomux(MX51_PIN_NANDF_D10, IOMUX_CONFIG_ALT1);
mxc_iomux_set_pad(MX51_PIN_NANDF_D10, pad);
mxc_request_iomux(MX51_PIN_NANDF_D11, IOMUX_CONFIG_ALT1);
mxc_iomux_set_pad(MX51_PIN_NANDF_D11, pad);
mxc_request_iomux(MX51_PIN_NANDF_D12, IOMUX_CONFIG_ALT1);
mxc_iomux_set_pad(MX51_PIN_NANDF_D12, pad);
mxc_request_iomux(MX51_PIN_NANDF_D13, IOMUX_CONFIG_ALT1);
mxc_iomux_set_pad(MX51_PIN_NANDF_D13, pad);
mxc_request_iomux(MX51_PIN_NANDF_D14, IOMUX_CONFIG_ALT1);
mxc_iomux_set_pad(MX51_PIN_NANDF_D14, pad);
mxc_request_iomux(MX51_PIN_NANDF_D15, IOMUX_CONFIG_ALT1);
mxc_iomux_set_pad(MX51_PIN_NANDF_D15, pad);
return 0;
}
#endif
#ifdef CONFIG_I2C_MXC
static setup_i2c(unsigned int module_base)
{
unsigned int reg;
switch (module_base) {
case I2C1_BASE_ADDR:
reg = IOMUXC_BASE_ADDR + 0x210; /* i2c SDA */
writel(0x11, reg);
reg = IOMUXC_BASE_ADDR + 0x600;
writel(0x1ad, reg);
reg = IOMUXC_BASE_ADDR + 0x9B4;
writel(0x1, reg);
reg = IOMUXC_BASE_ADDR + 0x224; /* i2c SCL */
writel(0x11, reg);
reg = IOMUXC_BASE_ADDR + 0x614;
writel(0x1ad, reg);
reg = IOMUXC_BASE_ADDR + 0x9B0;
writel(0x1, reg);
break;
case I2C2_BASE_ADDR:
/* Workaround for Atlas Lite */
writel(0x0, IOMUXC_BASE_ADDR + 0x3CC); /* i2c SCL */
writel(0x0, IOMUXC_BASE_ADDR + 0x3D0); /* i2c SDA */
reg = readl(GPIO1_BASE_ADDR + 0x0);
reg |= 0xC; /* write a 1 on the SCL and SDA lines */
writel(reg, GPIO1_BASE_ADDR + 0x0);
reg = readl(GPIO1_BASE_ADDR + 0x4);
reg |= 0xC; /* configure GPIO lines as output */
writel(reg, GPIO1_BASE_ADDR + 0x4);
reg = readl(GPIO1_BASE_ADDR + 0x0);
reg &= ~0x4 ; /* set SCL low for a few milliseconds */
writel(reg, GPIO1_BASE_ADDR + 0x0);
udelay(20000);
reg |= 0x4;
writel(reg, GPIO1_BASE_ADDR + 0x0);
udelay(10);
reg = readl(GPIO1_BASE_ADDR + 0x4);
reg &= ~0xC; /* configure GPIO lines back as input */
writel(reg, GPIO1_BASE_ADDR + 0x4);
writel(0x12, IOMUXC_BASE_ADDR + 0x3CC); /* i2c SCL */
writel(0x3, IOMUXC_BASE_ADDR + 0x9B8);
writel(0x1ed, IOMUXC_BASE_ADDR + 0x7D4);
writel(0x12, IOMUXC_BASE_ADDR + 0x3D0); /* i2c SDA */
writel(0x3, IOMUXC_BASE_ADDR + 0x9BC);
writel(0x1ed, IOMUXC_BASE_ADDR + 0x7D8);
break;
default:
printf("Invalid I2C base: 0x%x\n", module_base);
break;
}
}
#define REV_ATLAS_LITE_1_0 0x8
#define REV_ATLAS_LITE_1_1 0x9
#define REV_ATLAS_LITE_2_0 0x10
#define REV_ATLAS_LITE_2_1 0x11
void setup_core_voltages(void)
{
unsigned char buf[4] = { 0 };
i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE);
if (is_soc_rev(CHIP_REV_2_0) <= 0) {
/* Set core voltage to 1.1V */
if (i2c_read(0x8, 24, 1, buf, 3)) {
puts("setup_core_voltages: read PMIC@0x08:0x18 fail\n");
return;
}
buf[2] = (buf[2] & (~0x1F)) | 0x14;
if (i2c_write(0x8, 24, 1, buf, 3)) {
puts("setup_core_voltages: write PMIC@0x08:0x18 fail\n");
return;
}
/* Setup VCC (SW2) to 1.25 */
if (i2c_read(0x8, 25, 1, buf, 3)) {
puts("setup_core_voltages: read PMIC@0x08:0x19 fail\n");
return;
}
buf[2] = (buf[2] & (~0x1F)) | 0x1A;
if (i2c_write(0x8, 25, 1, buf, 3)) {
puts("setup_core_voltages: write PMIC@0x08:0x19 fail\n");
return;
}
/* Setup 1V2_DIG1 (SW3) to 1.25 */
if (i2c_read(0x8, 26, 1, buf, 3)) {
puts("setup_core_voltages: read PMIC@0x08:0x1A fail\n");
return;
}
buf[2] = (buf[2] & (~0x1F)) | 0x1A;
if (i2c_write(0x8, 26, 1, buf, 3)) {
puts("setup_core_voltages: write PMIC@0x08:0x1A fail\n");
return;
}
udelay(50);
/* Raise the core frequency to 800MHz */
writel(0x0, CCM_BASE_ADDR + CLKCTL_CACRR);
} else {
/* TO 3.0 */
/* Setup VCC (SW2) to 1.225 */
if (i2c_read(0x8, 25, 1, buf, 3)) {
puts("setup_core_voltages: read PMIC@0x08:0x19 fail\n");
return;
}
buf[2] = (buf[2] & (~0x1F)) | 0x19;
if (i2c_write(0x8, 25, 1, buf, 3)) {
puts("setup_core_voltages: write PMIC@0x08:0x19 fail\n");
return;
}
/* Setup 1V2_DIG1 (SW3) to 1.2 */
if (i2c_read(0x8, 26, 1, buf, 3)) {
puts("setup_core_voltages: read PMIC@0x08:0x1A fail\n");
return;
}
buf[2] = (buf[2] & (~0x1F)) | 0x18;
if (i2c_write(0x8, 26, 1, buf, 3)) {
puts("setup_core_voltages: write PMIC@0x08:0x1A fail\n");
return;
}
}
if (i2c_read(0x8, 7, 1, buf, 3)) {
puts("setup_core_voltages: read PMIC@0x08:0x07 fail\n");
return;
}
if (((buf[2] & 0x1F) < REV_ATLAS_LITE_2_0) || (((buf[1] >> 1) & 0x3) == 0)) {
/* Set switchers in PWM mode for Atlas 2.0 and lower */
/* Setup the switcher mode for SW1 & SW2*/
if (i2c_read(0x8, 28, 1, buf, 3)) {
puts("setup_core_voltages: read PMIC@0x08:0x1C fail\n");
return;
}
buf[2] = (buf[2] & (~0xF)) | 0x5;
buf[1] = (buf[1] & (~0x3C)) | 0x14;
if (i2c_write(0x8, 28, 1, buf, 3)) {
puts("setup_core_voltages: write PMIC@0x08:0x1C fail\n");
return;
}
/* Setup the switcher mode for SW3 & SW4*/
if (i2c_read(0x8, 29, 1, buf, 3)) {
puts("setup_core_voltages: read PMIC@0x08:0x1D fail\n");
return;
}
buf[2] = (buf[2] & (~0xF)) | 0x5;
buf[1] = (buf[1] & (~0xF)) | 0x5;
if (i2c_write(0x8, 29, 1, buf, 3)) {
puts("setup_core_voltages: write PMIC@0x08:0x1D fail\n");
return;
}
} else {
/* Set switchers in Auto in NORMAL mode & STANDBY mode for Atlas 2.0a */
/* Setup the switcher mode for SW1 & SW2*/
if (i2c_read(0x8, 28, 1, buf, 3)) {
puts("setup_core_voltages: read PMIC@0x08:0x1C fail\n");
return;
}
buf[2] = (buf[2] & (~0xF)) | 0x8;
buf[1] = (buf[1] & (~0x3C)) | 0x20;
if (i2c_write(0x8, 28, 1, buf, 3)) {
puts("setup_core_voltages: write PMIC@0x08:0x1C fail\n");
return;
}
/* Setup the switcher mode for SW3 & SW4*/
if (i2c_read(0x8, 29, 1, buf, 3)) {
puts("setup_core_voltages: read PMIC@0x08:0x1D fail\n");
return;
}
buf[2] = (buf[2] & (~0xF)) | 0x8;
buf[1] = (buf[1] & (~0xF)) | 0x8;
if (i2c_write(0x8, 29, 1, buf, 3)) {
puts("setup_core_voltages: write PMIC@0x08:0x1D fail\n");
return;
}
}
}
#endif
int board_init(void)
{
setup_boot_device();
setup_soc_rev();
gd->bd->bi_arch_number = MACH_TYPE_MX51_3DS; /* board id for linux */
/* address of boot parameters */
gd->bd->bi_boot_params = PHYS_SDRAM_1 + 0x100;
setup_uart();
setup_nfc();
setup_expio();
#ifdef CONFIG_I2C_MXC
setup_i2c(I2C2_BASE_ADDR);
setup_core_voltages();
#endif
return 0;
}
#ifdef CONFIG_ANDROID_RECOVERY
struct reco_envs supported_reco_envs[BOOT_DEV_NUM] = {
{
.cmd = CONFIG_ANDROID_RECOVERY_BOOTCMD_NAND,
.args = CONFIG_ANDROID_RECOVERY_BOOTARGS_NAND,
},
{
.cmd = NULL,
.args = NULL,
},
{
.cmd = CONFIG_ANDROID_RECOVERY_BOOTCMD_MMC,
.args = CONFIG_ANDROID_RECOVERY_BOOTARGS_MMC,
},
};
static int check_mmc_recovery_cmd_file(int dev_num, int part_num, char *path)
{
block_dev_desc_t *dev_desc = NULL;
struct mmc *mmc = find_mmc_device(dev_num);
disk_partition_t info;
ulong part_length = 0;
int filelen = 0;
memset(&info, 0, sizeof(disk_partition_t));
dev_desc = get_dev("mmc", dev_num);
if (NULL == dev_desc) {
printf("** Block device MMC %d not supported\n",
dev_num);
return 0;
}
mmc_init(mmc);
if (get_partition_info(dev_desc,
part_num,
&info)) {
printf("** Bad partition %d **\n",
part_num);
return 0;
}
part_length = ext2fs_set_blk_dev(dev_desc,
part_num);
if (part_length == 0) {
printf("** Bad partition - mmc 0:%d **\n",
part_num);
ext2fs_close();
return 0;
}
if (!ext2fs_mount(part_length)) {
printf("** Bad ext2 partition or disk - mmc 0:%d **\n",
part_num);
ext2fs_close();
return 0;
}
filelen = ext2fs_open(path);
ext2fs_close();
return (filelen > 0) ? 1 : 0;
}
extern int ubifs_init(void);
extern int ubifs_mount(char *vol_name);
extern int ubifs_load(char *filename, u32 addr, u32 size);
static int check_nand_recovery_cmd_file(char *mtd_part_name,
char *ubi_part_name,
char *path)
{
struct mtd_device *dev_desc = NULL;
struct part_info *part = NULL;
struct mtd_partition mtd_part;
struct mtd_info *mtd_info = NULL;
char mtd_dev[16] = { 0 };
char mtd_buffer[80] = { 0 };
u8 pnum = 0,
read_test = 0;
int err = 0,
filelen = 0;
memset(&mtd_part, 0, sizeof(struct mtd_partition));
/* ========== ubi and mtd operations ========== */
if (mtdparts_init() != 0) {
printf("Error initializing mtdparts!\n");
return 0;
}
if (find_dev_and_part(mtd_part_name, &dev_desc, &pnum, &part)) {
printf("Partition %s not found!\n", mtd_part_name);
return 0;
}
sprintf(mtd_dev, "%s%d",
MTD_DEV_TYPE(dev_desc->id->type),
dev_desc->id->num);
mtd_info = get_mtd_device_nm(mtd_dev);
if (IS_ERR(mtd_info)) {
printf("Partition %s not found on device %s!\n",
"nand", mtd_dev);
return 0;
}
sprintf(mtd_buffer, "mtd=%d", pnum);
memset(&mtd_part, 0, sizeof(mtd_part));
mtd_part.name = mtd_buffer;
mtd_part.size = part->size;
mtd_part.offset = part->offset;
add_mtd_partitions(mtd_info, &mtd_part, 1);
err = ubi_mtd_param_parse(mtd_buffer, NULL);
if (err) {
del_mtd_partitions(mtd_info);
return 0;
}
err = ubi_init();
if (err) {
del_mtd_partitions(mtd_info);
return 0;
}
/* ========== ubifs operations ========== */
/* Init ubifs */
ubifs_init();
if (ubifs_mount(ubi_part_name)) {
printf("Mount ubifs volume %s fail!\n",
ubi_part_name);
return 0;
}
/* Try to read one byte for a read test. */
if (ubifs_load(path, (u32)&read_test, 1)) {
/* File not found */
filelen = 0;
} else
filelen = 1;
return filelen;
}
int check_recovery_cmd_file(void)
{
int if_exist = 0;
char *env = NULL;
switch (get_boot_device()) {
case MMC_BOOT:
if_exist = check_mmc_recovery_cmd_file(0,
CONFIG_ANDROID_CACHE_PARTITION_MMC,
CONFIG_ANDROID_RECOVERY_CMD_FILE);
break;
case NAND_BOOT:
env = getenv("mtdparts");
if (!env)
setenv("mtdparts", MTDPARTS_DEFAULT);
env = getenv("mtdids");
if (!env)
setenv("mtdids", MTDIDS_DEFAULT);
env = getenv("partition");
if (!env)
setenv("partition", MTD_ACTIVE_PART);
/*
if_exist = check_nand_recovery_cmd_file(CONFIG_ANDROID_UBIFS_PARTITION_NM,
CONFIG_ANDROID_CACHE_PARTITION_NAND,
CONFIG_ANDROID_RECOVERY_CMD_FILE);
*/
break;
case SPI_NOR_BOOT:
return 0;
break;
case UNKNOWN_BOOT:
default:
return 0;
break;
}
return if_exist;
}
#endif
#ifdef BOARD_LATE_INIT
int board_late_init(void)
{
return 0;
}
#endif
int checkboard(void)
{
printf("Board: MX51 3STACK ");
if (system_rev & CHIP_REV_2_0) {
printf("2.0 [");
} else if (system_rev & CHIP_REV_1_1) {
printf("1.1 [");
} else {
printf("1.0 [");
}
switch (__REG(SRC_BASE_ADDR + 0x8)) {
case 0x0001:
printf("POR");
break;
case 0x0009:
printf("RST");
break;
case 0x0010:
case 0x0011:
printf("WDOG");
break;
default:
printf("unknown");
}
printf("]\n");
printf("Boot Device: ");
switch (get_boot_device()) {
case NAND_BOOT:
printf("NAND\n");
break;
case SPI_NOR_BOOT:
printf("SPI NOR\n");
break;
case MMC_BOOT:
printf("MMC\n");
break;
case UNKNOWN_BOOT:
default:
printf("UNKNOWN\n");
break;
}
return 0;
}
#if defined(CONFIG_SMC911X)
extern int smc911x_initialize(u8 dev_num, int base_addr);
#endif
#ifdef CONFIG_NET_MULTI
int board_eth_init(bd_t *bis)
{
int rc = -ENODEV;
#if defined(CONFIG_SMC911X)
rc = smc911x_initialize(0, CONFIG_SMC911X_BASE);
#endif
cpu_eth_init(bis);
return rc;
}
#endif
#ifdef CONFIG_CMD_MMC
struct fsl_esdhc_cfg esdhc_cfg[2] = {
{MMC_SDHC1_BASE_ADDR, 1, 1},
};
#ifdef CONFIG_DYNAMIC_MMC_DEVNO
int get_mmc_env_devno()
{
uint soc_sbmr = readl(SRC_BASE_ADDR + 0x4);
return (soc_sbmr & 0x00180000) ? 1 : 0;
}
#endif
int esdhc_gpio_init(bd_t *bis)
{
u32 index = 0;
s32 status = 0;
for (index = 0; index < CONFIG_SYS_FSL_ESDHC_NUM;
++index) {
switch (index) {
case 0:
mxc_request_iomux(MX51_PIN_SD1_CMD,
IOMUX_CONFIG_ALT0 | IOMUX_CONFIG_SION);
mxc_request_iomux(MX51_PIN_SD1_CLK,
IOMUX_CONFIG_ALT0 | IOMUX_CONFIG_SION);
mxc_request_iomux(MX51_PIN_SD1_DATA0,
IOMUX_CONFIG_ALT0 | IOMUX_CONFIG_SION);
mxc_request_iomux(MX51_PIN_SD1_DATA1,
IOMUX_CONFIG_ALT0 | IOMUX_CONFIG_SION);
mxc_request_iomux(MX51_PIN_SD1_DATA2,
IOMUX_CONFIG_ALT0 | IOMUX_CONFIG_SION);
mxc_request_iomux(MX51_PIN_SD1_DATA3,
IOMUX_CONFIG_ALT0 | IOMUX_CONFIG_SION);
mxc_iomux_set_pad(MX51_PIN_SD1_CMD,
PAD_CTL_DRV_MAX | PAD_CTL_DRV_VOT_HIGH |
PAD_CTL_HYS_ENABLE | PAD_CTL_47K_PU |
PAD_CTL_PUE_PULL |
PAD_CTL_PKE_ENABLE | PAD_CTL_SRE_FAST);
mxc_iomux_set_pad(MX51_PIN_SD1_CLK,
PAD_CTL_DRV_MAX | PAD_CTL_DRV_VOT_HIGH |
PAD_CTL_HYS_NONE | PAD_CTL_47K_PU |
PAD_CTL_PUE_PULL |
PAD_CTL_PKE_ENABLE | PAD_CTL_SRE_FAST);
mxc_iomux_set_pad(MX51_PIN_SD1_DATA0,
PAD_CTL_DRV_MAX | PAD_CTL_DRV_VOT_HIGH |
PAD_CTL_HYS_ENABLE | PAD_CTL_47K_PU |
PAD_CTL_PUE_PULL |
PAD_CTL_PKE_ENABLE | PAD_CTL_SRE_FAST);
mxc_iomux_set_pad(MX51_PIN_SD1_DATA1,
PAD_CTL_DRV_MAX | PAD_CTL_DRV_VOT_HIGH |
PAD_CTL_HYS_ENABLE | PAD_CTL_47K_PU |
PAD_CTL_PUE_PULL |
PAD_CTL_PKE_ENABLE | PAD_CTL_SRE_FAST);
mxc_iomux_set_pad(MX51_PIN_SD1_DATA2,
PAD_CTL_DRV_MAX | PAD_CTL_DRV_VOT_HIGH |
PAD_CTL_HYS_ENABLE | PAD_CTL_47K_PU |
PAD_CTL_PUE_PULL |
PAD_CTL_PKE_ENABLE | PAD_CTL_SRE_FAST);
mxc_iomux_set_pad(MX51_PIN_SD1_DATA3,
PAD_CTL_DRV_MAX | PAD_CTL_DRV_VOT_HIGH |
PAD_CTL_HYS_ENABLE | PAD_CTL_100K_PD |
PAD_CTL_PUE_PULL |
PAD_CTL_PKE_ENABLE | PAD_CTL_SRE_FAST);
break;
case 1:
status = 1;
break;
case 2:
status = 1;
break;
case 3:
status = 1;
break;
default:
status = 1;
break;
}
status |= fsl_esdhc_initialize(bis, &esdhc_cfg[index]);
}
return status;
}
int board_mmc_init(bd_t *bis)
{
if (!esdhc_gpio_init(bis))
return fsl_esdhc_mmc_init(gd->bd);
else
return -1;
}
#endif
#if defined(CONFIG_MXC_KPD)
int setup_mxc_kpd(void)
{
mxc_request_iomux(MX51_PIN_KEY_COL0, IOMUX_CONFIG_ALT0);
mxc_request_iomux(MX51_PIN_KEY_COL1, IOMUX_CONFIG_ALT0);
mxc_request_iomux(MX51_PIN_KEY_COL2, IOMUX_CONFIG_ALT0);
mxc_request_iomux(MX51_PIN_KEY_COL3, IOMUX_CONFIG_ALT0);
mxc_request_iomux(MX51_PIN_KEY_COL4, IOMUX_CONFIG_ALT0);
mxc_request_iomux(MX51_PIN_KEY_COL5, IOMUX_CONFIG_ALT0);
mxc_request_iomux(MX51_PIN_KEY_ROW0, IOMUX_CONFIG_ALT0);
mxc_request_iomux(MX51_PIN_KEY_ROW1, IOMUX_CONFIG_ALT0);
mxc_request_iomux(MX51_PIN_KEY_ROW2, IOMUX_CONFIG_ALT0);
mxc_request_iomux(MX51_PIN_KEY_ROW3, IOMUX_CONFIG_ALT0);
return 0;
}
#endif

View File

@ -0,0 +1,73 @@
/*
* January 2004 - Changed to support H4 device
* Copyright (c) 2004 Texas Instruments
*
* (C) Copyright 2002
* Gary Jennejohn, DENX Software Engineering, <gj@denx.de>
*
* (C) Copyright 2009 Freescale Semiconductor, Inc.
*
* See file CREDITS for list of people who contributed to this
* project.
*
* 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.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
*/
OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
OUTPUT_ARCH(arm)
ENTRY(_start)
SECTIONS
{
. = 0x00000000;
. = ALIGN(4);
.text :
{
/* WARNING - the following is hand-optimized to fit within */
/* the sector layout of our flash chips! XXX FIXME XXX */
board/freescale/mx51_3stack/flash_header.o (.text.flasheader)
cpu/arm_cortexa8/start.o
board/freescale/mx51_3stack/libmx51_3stack.a (.text)
lib_arm/libarm.a (.text)
net/libnet.a (.text)
drivers/mtd/libmtd.a (.text)
drivers/mmc/libmmc.a (.text)
. = DEFINED(env_offset) ? env_offset : .;
common/env_embedded.o(.text)
*(.text)
}
. = ALIGN(4);
.rodata : { *(.rodata) }
. = ALIGN(4);
.data : { *(.data) }
. = ALIGN(4);
.got : { *(.got) }
. = .;
__u_boot_cmd_start = .;
.u_boot_cmd : { *(.u_boot_cmd) }
__u_boot_cmd_end = .;
. = ALIGN(4);
__bss_start = .;
.bss : { *(.bss) }
_end = .;
}

View File

@ -0,0 +1,49 @@
#
# Copyright (C) 2007, Guennadi Liakhovetski <lg@denx.de>
#
# (C) Copyright 2009 Freescale Semiconductor, Inc.
#
# 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.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
# MA 02111-1307 USA
#
include $(TOPDIR)/config.mk
LIB = $(obj)lib$(BOARD).a
COBJS := mx51_bbg.o
SOBJS := lowlevel_init.o flash_header.o
SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c)
OBJS := $(addprefix $(obj),$(COBJS))
SOBJS := $(addprefix $(obj),$(SOBJS))
$(LIB): $(obj).depend $(OBJS) $(SOBJS)
$(AR) $(ARFLAGS) $@ $(OBJS) $(SOBJS)
clean:
rm -f $(SOBJS) $(OBJS)
distclean: clean
rm -f $(LIB) core *.bak .depend
#########################################################################
# defines $(obj).depend target
include $(SRCTREE)/rules.mk
sinclude $(obj).depend
#########################################################################

View File

@ -0,0 +1,64 @@
/*
* Copyright 2009 Freescale Semiconductor, Inc. All Rights Reserved.
*/
/*
* The code contained herein is licensed under the GNU General Public
* License. You may obtain a copy of the GNU General Public License
* Version 2 or later at the following locations:
*
* http://www.opensource.org/licenses/gpl-license.html
* http://www.gnu.org/copyleft/gpl.html
*/
#ifndef __BOARD_FREESCALE_BOARD_IMX51_H__
#define __BOARD_FREESCALE_BOARD_IMX51_H__
/*!
* @defgroup BRDCFG_MX51 Board Configuration Options
* @ingroup MSL_MX51
*/
/*!
* @file mx51_3stack/board-imx51.h
*
* @brief This file contains all the board level configuration options.
*
* It currently hold the options defined for MX51 3Stack Platform.
*
* @ingroup BRDCFG_IMX51
*/
/* CPLD offsets */
#define PBC_LED_CTRL (0x20000)
#define PBC_SB_STAT (0x20008)
#define PBC_ID_AAAA (0x20040)
#define PBC_ID_5555 (0x20048)
#define PBC_VERSION (0x20050)
#define PBC_ID_CAFE (0x20058)
#define PBC_INT_STAT (0x20010)
#define PBC_INT_MASK (0x20038)
#define PBC_INT_REST (0x20020)
#define PBC_SW_RESET (0x20060)
/* LED switchs */
#define LED_SWITCH_REG 0x00
/* buttons */
#define SWITCH_BUTTONS_REG 0x08
/* status, interrupt */
#define INTR_STATUS_REG 0x10
#define INTR_MASK_REG 0x38
#define INTR_RESET_REG 0x20
/* magic word for debug CPLD */
#define MAGIC_NUMBER1_REG 0x40
#define MAGIC_NUMBER2_REG 0x48
/* CPLD code version */
#define CPLD_CODE_VER_REG 0x50
/* magic word for debug CPLD */
#define MAGIC_NUMBER3_REG 0x58
/* module reset register*/
#define MODULE_RESET_REG 0x60
/* CPU ID and Personality ID */
#define MCU_BOARD_ID_REG 0x68
#endif /* __BOARD_FREESCALE_BOARD_IMX51_H__ */

View File

@ -0,0 +1,7 @@
LDSCRIPT := $(SRCTREE)/board/$(VENDOR)/$(BOARD)/u-boot.lds
sinclude $(OBJTREE)/board/$(VENDOR)/$(BOARD)/config.tmp
ifndef TEXT_BASE
TEXT_BASE = 0x97800000
endif

View File

@ -0,0 +1,112 @@
/*
* (C) Copyright 2009-2010 Freescale Semiconductor, Inc.
*
* 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.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
*/
#include <config.h>
#include <asm/arch/mx51.h>
#include "board-imx51.h"
#ifdef CONFIG_FLASH_HEADER
#ifndef CONFIG_FLASH_HEADER_OFFSET
# error "Must define the offset of flash header"
#endif
#define MXC_DCD_ITEM(i, type, addr, val) \
dcd_node_##i: \
.word type ; \
.word addr ; \
.word val ; \
.section ".text.flasheader", "x"
b _start
.org CONFIG_FLASH_HEADER_OFFSET
app_code_jump_v: .word _start
app_code_code_barker: .word CONFIG_FLASH_HEADER_BARKER
app_code_csf: .word 0
dcd_ptr_ptr: .word dcd_ptr
super_root_key: .word 0
dcd_ptr: .word dcd_array_start
app_dest_ptr: .word TEXT_BASE
dcd_array_start:
magic: .word 0xB17219E9
dcd_array_size: .word dcd_data_end - dcd_array_start - 8
/* DCD */
/* DDR2 IOMUX configuration */
MXC_DCD_ITEM(1, 4, IOMUXC_BASE_ADDR + 0x8a0, 0x200)
MXC_DCD_ITEM(2, 4, IOMUXC_BASE_ADDR + 0x50c, 0x20c5)
MXC_DCD_ITEM(3, 4, IOMUXC_BASE_ADDR + 0x510, 0x20c5)
MXC_DCD_ITEM(4, 4, IOMUXC_BASE_ADDR + 0x83c, 0x2)
MXC_DCD_ITEM(5, 4, IOMUXC_BASE_ADDR + 0x848, 0x2)
MXC_DCD_ITEM(6, 4, IOMUXC_BASE_ADDR + 0x4b8, 0xe7)
MXC_DCD_ITEM(7, 4, IOMUXC_BASE_ADDR + 0x4bc, 0x45)
MXC_DCD_ITEM(8, 4, IOMUXC_BASE_ADDR + 0x4c0, 0x45)
MXC_DCD_ITEM(9, 4, IOMUXC_BASE_ADDR + 0x4c4, 0x45)
MXC_DCD_ITEM(10, 4, IOMUXC_BASE_ADDR + 0x4c8, 0x45)
MXC_DCD_ITEM(11, 4, IOMUXC_BASE_ADDR + 0x820, 0x0)
MXC_DCD_ITEM(12, 4, IOMUXC_BASE_ADDR + 0x4a4, 0x3)
MXC_DCD_ITEM(13, 4, IOMUXC_BASE_ADDR + 0x4a8, 0x3)
MXC_DCD_ITEM(14, 4, IOMUXC_BASE_ADDR + 0x4ac, 0xe3)
MXC_DCD_ITEM(15, 4, IOMUXC_BASE_ADDR + 0x4b0, 0xe3)
MXC_DCD_ITEM(16, 4, IOMUXC_BASE_ADDR + 0x4b4, 0xe3)
MXC_DCD_ITEM(17, 4, IOMUXC_BASE_ADDR + 0x4cc, 0xe3)
MXC_DCD_ITEM(18, 4, IOMUXC_BASE_ADDR + 0x4d0, 0xe2)
/* Set drive strength to MAX */
MXC_DCD_ITEM(19, 4, IOMUXC_BASE_ADDR + 0x82c, 0x4)
MXC_DCD_ITEM(20, 4, IOMUXC_BASE_ADDR + 0x8a4, 0x4)
MXC_DCD_ITEM(21, 4, IOMUXC_BASE_ADDR + 0x8ac, 0x4)
MXC_DCD_ITEM(22, 4, IOMUXC_BASE_ADDR + 0x8b8, 0x4)
/* 13 ROW, 10 COL, 32Bit, SREF=4 Micron Model */
/* CAS=3, BL=4 */
MXC_DCD_ITEM(23, 4, ESDCTL_BASE_ADDR + ESDCTL_ESDCTL0, 0x82a20000)
MXC_DCD_ITEM(24, 4, ESDCTL_BASE_ADDR + ESDCTL_ESDCTL1, 0x82a20000)
MXC_DCD_ITEM(25, 4, ESDCTL_BASE_ADDR + ESDCTL_ESDMISC, 0x000ad0d0)
MXC_DCD_ITEM(26, 4, ESDCTL_BASE_ADDR + ESDCTL_ESDCFG0, 0x333584ab)
MXC_DCD_ITEM(27, 4, ESDCTL_BASE_ADDR + ESDCTL_ESDCFG1, 0x333584ab)
/* Init DRAM on CS0 */
MXC_DCD_ITEM(28, 4, ESDCTL_BASE_ADDR + ESDCTL_ESDSCR, 0x04008008)
MXC_DCD_ITEM(29, 4, ESDCTL_BASE_ADDR + ESDCTL_ESDSCR, 0x0000801a)
MXC_DCD_ITEM(30, 4, ESDCTL_BASE_ADDR + ESDCTL_ESDSCR, 0x0000801b)
MXC_DCD_ITEM(31, 4, ESDCTL_BASE_ADDR + ESDCTL_ESDSCR, 0x00448019)
MXC_DCD_ITEM(32, 4, ESDCTL_BASE_ADDR + ESDCTL_ESDSCR, 0x07328018)
MXC_DCD_ITEM(33, 4, ESDCTL_BASE_ADDR + ESDCTL_ESDSCR, 0x04008008)
MXC_DCD_ITEM(34, 4, ESDCTL_BASE_ADDR + ESDCTL_ESDSCR, 0x00008010)
MXC_DCD_ITEM(35, 4, ESDCTL_BASE_ADDR + ESDCTL_ESDSCR, 0x00008010)
MXC_DCD_ITEM(36, 4, ESDCTL_BASE_ADDR + ESDCTL_ESDSCR, 0x06328018)
MXC_DCD_ITEM(37, 4, ESDCTL_BASE_ADDR + ESDCTL_ESDSCR, 0x03808019)
MXC_DCD_ITEM(38, 4, ESDCTL_BASE_ADDR + ESDCTL_ESDSCR, 0x00408019)
MXC_DCD_ITEM(39, 4, ESDCTL_BASE_ADDR + ESDCTL_ESDSCR, 0x00008000)
/* Init DRAM on CS1 */
MXC_DCD_ITEM(40, 4, ESDCTL_BASE_ADDR + ESDCTL_ESDSCR, 0x0400800c)
MXC_DCD_ITEM(41, 4, ESDCTL_BASE_ADDR + ESDCTL_ESDSCR, 0x0000801e)
MXC_DCD_ITEM(42, 4, ESDCTL_BASE_ADDR + ESDCTL_ESDSCR, 0x0000801f)
MXC_DCD_ITEM(43, 4, ESDCTL_BASE_ADDR + ESDCTL_ESDSCR, 0x0000801d)
MXC_DCD_ITEM(44, 4, ESDCTL_BASE_ADDR + ESDCTL_ESDSCR, 0x0732801c)
MXC_DCD_ITEM(45, 4, ESDCTL_BASE_ADDR + ESDCTL_ESDSCR, 0x0400800c)
MXC_DCD_ITEM(46, 4, ESDCTL_BASE_ADDR + ESDCTL_ESDSCR, 0x00008014)
MXC_DCD_ITEM(47, 4, ESDCTL_BASE_ADDR + ESDCTL_ESDSCR, 0x00008014)
MXC_DCD_ITEM(48, 4, ESDCTL_BASE_ADDR + ESDCTL_ESDSCR, 0x0632801c)
MXC_DCD_ITEM(49, 4, ESDCTL_BASE_ADDR + ESDCTL_ESDSCR, 0x0380801d)
MXC_DCD_ITEM(50, 4, ESDCTL_BASE_ADDR + ESDCTL_ESDSCR, 0x0040801d)
MXC_DCD_ITEM(51, 4, ESDCTL_BASE_ADDR + ESDCTL_ESDSCR, 0x00008004)
MXC_DCD_ITEM(52, 4, ESDCTL_BASE_ADDR + ESDCTL_ESDCTL0, 0xb2a20000)
MXC_DCD_ITEM(53, 4, ESDCTL_BASE_ADDR + ESDCTL_ESDCTL1, 0xb2a20000)
MXC_DCD_ITEM(54, 4, ESDCTL_BASE_ADDR + ESDCTL_ESDMISC, 0x000ad6d0)
MXC_DCD_ITEM(55, 4, ESDCTL_BASE_ADDR + ESDCTL_ESDCDLYGD, 0x90000000)
MXC_DCD_ITEM(56, 4, ESDCTL_BASE_ADDR + ESDCTL_ESDSCR, 0x00000000)
dcd_data_end:
image_len: .word _end - TEXT_BASE
#endif

View File

@ -0,0 +1,372 @@
/*
* Copyright (C) 2007, Guennadi Liakhovetski <lg@denx.de>
*
* (C) Copyright 2009-2011 Freescale Semiconductor, Inc.
*
* 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.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
*/
#include <config.h>
#include <asm/arch/mx51.h>
#include "board-imx51.h"
/*
* return soc version
* 0x10: TO1
* 0x20: TO2
* 0x30: TO3
*/
.macro check_soc_version ret, tmp
.endm
/*
* L2CC Cache setup/invalidation/disable
*/
.macro init_l2cc
/* explicitly disable L2 cache */
mrc 15, 0, r0, c1, c0, 1
bic r0, r0, #0x2
mcr 15, 0, r0, c1, c0, 1
/* reconfigure L2 cache aux control reg */
mov r0, #0xC0 /* tag RAM */
add r0, r0, #0x4 /* data RAM */
orr r0, r0, #(1 << 24) /* disable write allocate delay */
orr r0, r0, #(1 << 23) /* disable write allocate combine */
orr r0, r0, #(1 << 22) /* disable write allocate */
ldr r1, =0x00000000
ldr r3, [r1, #ROM_SI_REV]
cmp r3, #0x10 /* r3 contains the silicon rev */
orrls r0, r0, #(1 << 25) /* disable write combine for TO 2 and lower revs */
mcr 15, 1, r0, c9, c0, 2
.endm /* init_l2cc */
/* AIPS setup - Only setup MPROTx registers.
* The PACR default values are good.*/
.macro init_aips
/*
* Set all MPROTx to be non-bufferable, trusted for R/W,
* not forced to user-mode.
*/
ldr r0, =AIPS1_BASE_ADDR
ldr r1, =0x77777777
str r1, [r0, #0x0]
str r1, [r0, #0x4]
ldr r0, =AIPS2_BASE_ADDR
str r1, [r0, #0x0]
str r1, [r0, #0x4]
/*
* Clear the on and off peripheral modules Supervisor Protect bit
* for SDMA to access them. Did not change the AIPS control registers
* (offset 0x20) access type
*/
.endm /* init_aips */
/* MAX (Multi-Layer AHB Crossbar Switch) setup */
.macro init_max
.endm /* init_max */
/* M4IF setup */
.macro init_m4if
/* VPU and IPU given higher priority (0x4)
* IPU accesses with ID=0x1 given highest priority (=0xA)
*/
ldr r0, =M4IF_BASE_ADDR
ldr r1, =0x00000203
str r1, [r0, #0x40]
ldr r1, =0x0
str r1, [r0, #0x44]
ldr r1, =0x00120125
str r1, [r0, #0x9C]
ldr r1, =0x001901A3
str r1, [r0, #0x48]
/*
ldr r1, =0x00000a01
str r1, [r0, #0x48]
ldr r1, =0x00000404
str r1, [r0, #0x40]
*/
.endm /* init_m4if */
/* To support 133MHz DDR */
.macro init_drive_strength
.endm /* init_drive_strength */
/* CPLD on CS5 setup */
.macro init_debug_board
.endm /* init_debug_board */
.macro setup_pll pll, freq
ldr r2, =\pll
ldr r1, =PLL1_BASE_ADDR
cmp r1, r2
bne 5f
ldr r1, [r2, #PLL_DP_CONFIG]
bic r1, r1, #0x2
str r1, [r2, #PLL_DP_CONFIG] /* disable auto-restart AREN bit */
5: str r3, [r2, #PLL_DP_OP]
str r3, [r2, #PLL_DP_HFS_OP]
str r4, [r2, #PLL_DP_MFD]
str r4, [r2, #PLL_DP_HFS_MFD]
str r5, [r2, #PLL_DP_MFN]
str r5, [r2, #PLL_DP_HFS_MFN]
ldr r1, =PLL1_BASE_ADDR
cmp r1, r2
bne 6f
ldr r1, =0x00001236 /* Set PLM =1, manual restart and enable PLL*/
b 7f
6: ldr r1, =0x00001232
7: str r1, [r2, #PLL_DP_CTL]
1: ldr r1, [r2, #PLL_DP_CTL]
ands r1, r1, #0x1
beq 1b
/* Workaround for PLL1 issue */
ldr r1, =PLL1_BASE_ADDR
cmp r1, r2
bne 4f
/* set PLL1 to 800Mhz */
ldr r1, =60
str r1, [r2, #PLL_DP_MFN]
ldr r1, [r2, #PLL_DP_CONFIG]
orr r1, r1, #1 /* set LDREQ */
str r1, [r2, #PLL_DP_CONFIG]
/* Wait till LDREQ bit is cleared. */
2: ldr r1, [r2, #PLL_DP_CONFIG]
tst r1, #1
bne 2b
mov r0, #100 /* delay more than 4.6 us */
3: subs r0, r0, #1
bge 3b
4:
.endm
.macro init_clock
ldr r0, =CCM_BASE_ADDR
/* Gate of clocks to the peripherals first */
ldr r1, =0x3FFFFFFF
str r1, [r0, #CLKCTL_CCGR0]
ldr r1, =0x0
str r1, [r0, #CLKCTL_CCGR1]
str r1, [r0, #CLKCTL_CCGR2]
str r1, [r0, #CLKCTL_CCGR3]
ldr r1, =0x00030000
str r1, [r0, #CLKCTL_CCGR4]
ldr r1, =0x00FFF030
str r1, [r0, #CLKCTL_CCGR5]
ldr r1, =0x00000300
str r1, [r0, #CLKCTL_CCGR6]
/* Disable IPU and HSC dividers */
mov r1, #0x60000
str r1, [r0, #CLKCTL_CCDR]
/* PLL1 workaround */
/* (1). switch off all clock from PLL1, CPU/DDR */
/* Make sure to switch the DDR away from PLL 1 */
ldr r1, =0x19239145
str r1, [r0, #CLKCTL_CBCDR]
/* make sure divider effective */
1: ldr r1, [r0, #CLKCTL_CDHIPR]
cmp r1, #0x0
bne 1b
/* Make sure step clock is 24MHz OSC. */
ldr r1, [r0, #CLKCTL_CCSR]
bic r1, r1, #(3 << 7)
str r1, [r0, #CLKCTL_CCSR]
/* Switch ARM to step clock */
ldr r1, [r0, #CLKCTL_CCSR]
orr r1, r1, #4
str r1, [r0, #CLKCTL_CCSR]
/* PLL1 workaround:|MFN/(MFD+1)| <1 */
mov r3, #0x80 /* MFI = 8*/
mov r4, #179 /* MFD = 179 */
mov r5, #180 /* MFN = 180 */
setup_pll PLL1_BASE_ADDR
mov r3, #DP_OP_665
mov r4, #DP_MFD_665
mov r5, #DP_MFN_665
setup_pll PLL3_BASE_ADDR
/* Switch peripheral to PLL 3 */
ldr r0, =CCM_BASE_ADDR
ldr r1, =0x000010C0
str r1, [r0, #CLKCTL_CBCMR]
ldr r1, =0x13239145
str r1, [r0, #CLKCTL_CBCDR]
mov r3, #DP_OP_665
mov r4, #DP_MFD_665
mov r5, #DP_MFN_665
setup_pll PLL2_BASE_ADDR
/* Switch peripheral to PLL2 */
ldr r0, =CCM_BASE_ADDR
ldr r1, =0x19239145
str r1, [r0, #CLKCTL_CBCDR]
ldr r1, =0x000020C0
str r1, [r0, #CLKCTL_CBCMR]
mov r3, #DP_OP_216
mov r4, #DP_MFD_216
mov r5, #DP_MFN_216
setup_pll PLL3_BASE_ADDR
/* Set the platform clock dividers */
ldr r0, =ARM_BASE_ADDR
ldr r1, =0x00000725
str r1, [r0, #0x14]
ldr r0, =CCM_BASE_ADDR
/* Run TO 3.0 at Full speed, for other TO's wait till we increase VDDGP */
ldr r1, =0x0
ldr r3, [r1, #ROM_SI_REV]
cmp r3, #0x10
movls r1, #0x1
movhi r1, #0
str r1, [r0, #CLKCTL_CACRR]
/* Switch ARM back to PLL 1 */
mov r1, #0
str r1, [r0, #CLKCTL_CCSR]
/* setup the rest */
/* Use lp_apm (24MHz) source for perclk */
ldr r1, =0x000020C2
str r1, [r0, #CLKCTL_CBCMR]
/* ddr clock from PLL 1, all perclk dividers are 1 since using 24MHz */
ldr r1, =0x59E35100
str r1, [r0, #CLKCTL_CBCDR]
/* Restore the default values in the Gate registers */
ldr r1, =0xFFFFFFFF
str r1, [r0, #CLKCTL_CCGR0]
str r1, [r0, #CLKCTL_CCGR1]
str r1, [r0, #CLKCTL_CCGR2]
str r1, [r0, #CLKCTL_CCGR3]
str r1, [r0, #CLKCTL_CCGR4]
str r1, [r0, #CLKCTL_CCGR5]
str r1, [r0, #CLKCTL_CCGR6]
/* Use PLL 2 for UART's, get 66.5MHz from it */
ldr r1, =0xA5A2A020
str r1, [r0, #CLKCTL_CSCMR1]
ldr r1, =0x00C30321
str r1, [r0, #CLKCTL_CSCDR1]
/* make sure divider effective */
1: ldr r1, [r0, #CLKCTL_CDHIPR]
cmp r1, #0x0
bne 1b
mov r1, #0x0
str r1, [r0, #CLKCTL_CCDR]
/* for cko - for ARM div by 8 */
mov r1, #0x000A0000
add r1, r1, #0x00000F0
str r1, [r0, #CLKCTL_CCOSR]
.endm
.macro setup_wdog
ldr r0, =WDOG1_BASE_ADDR
mov r1, #0x30
strh r1, [r0]
.endm
.section ".text.init", "x"
.globl lowlevel_init
lowlevel_init:
ldr r0, =GPIO1_BASE_ADDR
ldr r1, [r0, #0x0]
orr r1, r1, #(1 << 23)
str r1, [r0, #0x0]
ldr r1, [r0, #0x4]
orr r1, r1, #(1 << 23)
str r1, [r0, #0x4]
#ifdef ENABLE_IMPRECISE_ABORT
mrs r1, spsr /* save old spsr */
mrs r0, cpsr /* read out the cpsr */
bic r0, r0, #0x100 /* clear the A bit */
msr spsr, r0 /* update spsr */
add lr, pc, #0x8 /* update lr */
movs pc, lr /* update cpsr */
nop
nop
nop
nop
msr spsr, r1 /* restore old spsr */
#endif
/* ARM errata ID #468414 */
mrc 15, 0, r1, c1, c0, 1
orr r1, r1, #(1 << 5) /* enable L1NEON bit */
mcr 15, 0, r1, c1, c0, 1
init_l2cc
init_aips
init_max
init_m4if
init_drive_strength
init_clock
init_debug_board
/* return from mxc_nand_load */
/* r12 saved upper lr*/
b mxc_nand_load
/* Board level setting value */
DDR_PERCHARGE_CMD: .word 0x04008008
DDR_REFRESH_CMD: .word 0x00008010
DDR_LMR1_W: .word 0x00338018
DDR_LMR_CMD: .word 0xB2220000
DDR_TIMING_W: .word 0xB02567A9
DDR_MISC_W: .word 0x000A0104

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,73 @@
/*
* January 2004 - Changed to support H4 device
* Copyright (c) 2004 Texas Instruments
*
* (C) Copyright 2002
* Gary Jennejohn, DENX Software Engineering, <gj@denx.de>
*
* (C) Copyright 2009 Freescale Semiconductor, Inc.
*
* See file CREDITS for list of people who contributed to this
* project.
*
* 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.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
*/
OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
OUTPUT_ARCH(arm)
ENTRY(_start)
SECTIONS
{
. = 0x00000000;
. = ALIGN(4);
.text :
{
/* WARNING - the following is hand-optimized to fit within */
/* the sector layout of our flash chips! XXX FIXME XXX */
board/freescale/mx51_bbg/flash_header.o (.text.flasheader)
cpu/arm_cortexa8/start.o
board/freescale/mx51_bbg/libmx51_bbg.a (.text)
lib_arm/libarm.a (.text)
net/libnet.a (.text)
drivers/mtd/libmtd.a (.text)
drivers/mmc/libmmc.a (.text)
. = DEFINED(env_offset) ? env_offset : .;
common/env_embedded.o(.text)
*(.text)
}
. = ALIGN(4);
.rodata : { *(.rodata) }
. = ALIGN(4);
.data : { *(.data) }
. = ALIGN(4);
.got : { *(.got) }
. = .;
__u_boot_cmd_start = .;
.u_boot_cmd : { *(.u_boot_cmd) }
__u_boot_cmd_end = .;
. = ALIGN(4);
__bss_start = .;
.bss : { *(.bss) }
_end = .;
}

View File

@ -0,0 +1,49 @@
#
# Copyright (C) 2007, Guennadi Liakhovetski <lg@denx.de>
#
# (C) Copyright 2010 Freescale Semiconductor, Inc.
#
# 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.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
# MA 02111-1307 USA
#
include $(TOPDIR)/config.mk
LIB = $(obj)lib$(BOARD).a
COBJS := mx53_ard.o
SOBJS := lowlevel_init.o flash_header.o
SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c)
OBJS := $(addprefix $(obj),$(COBJS))
SOBJS := $(addprefix $(obj),$(SOBJS))
$(LIB): $(obj).depend $(OBJS) $(SOBJS)
$(AR) $(ARFLAGS) $@ $(OBJS) $(SOBJS)
clean:
rm -f $(SOBJS) $(OBJS)
distclean: clean
rm -f $(LIB) core *.bak .depend
#########################################################################
# defines $(obj).depend target
include $(SRCTREE)/rules.mk
sinclude $(obj).depend
#########################################################################

View File

@ -0,0 +1,3 @@
LDSCRIPT := $(SRCTREE)/board/$(VENDOR)/$(BOARD)/u-boot.lds
TEXT_BASE = 0x77800000

View File

@ -0,0 +1,304 @@
/*
* Copyright (C) 2010-2011 Freescale Semiconductor, Inc.
*
* 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.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
*/
#include <config.h>
#include <asm/arch/mx53.h>
#define REG_LD_AND_STR_INIT(base) \
ldr r0, =base;
#define REG_LD_AND_STR_OP(i, offset, val) \
ldr r1, =val; \
ldr r2, =offset; \
str r1, [r0, r2];
#define REG_LD_AND_STR_END(base)
#ifdef CONFIG_FLASH_HEADER
#ifndef CONFIG_FLASH_HEADER_OFFSET
# error "Must define the offset of flash header"
#endif
.section ".text.flasheader", "x"
b _start
.org CONFIG_FLASH_HEADER_OFFSET
ivt_header: .long 0x402000D1/* Tag=0xD1, Len=0x0020, Ver=0x40 */
app_code_jump_v: .long (0xF8006000 + (plugin_start - TEXT_BASE))
reserv1: .long 0x0
dcd_ptr: .long 0x0
boot_data_ptr: .long (0xF8006000 + (boot_data - TEXT_BASE))
self_ptr: .long (0xF8006000 + (ivt_header - TEXT_BASE))
app_code_csf: .long 0x0
reserv2: .long 0x0
boot_data: .long 0xF8006000
image_len: .long (3 * 1024)
plugin: .long 0x1
/* Second IVT to give entry point into the bootloader copied to DDR */
ivt2_header: .long 0x402000D1/*Tag=0xD1, Len=0x0020, Ver=0x40 */
app2_code_jump_v: .long _start /* Entry point for the bootloader */
reserv3: .long 0x0
dcd2_ptr: .long 0x0
boot_data2_ptr: .long boot_data2
self_ptr2: .long ivt2_header
app_code_csf2: .long 0x0
reserv4: .long 0x0
boot_data2: .long TEXT_BASE
image_len2: .long _end_of_copy - TEXT_BASE + CONFIG_FLASH_HEADER_OFFSET
plugin2: .long 0x0
/* Here starts the plugin code */
plugin_start:
/* Save the return address and the function arguments */
push {r0-r6, lr}
/* We should distinguish USB recovery mode(SDP mode) and internal boot mode.
If ROM runs in SDP mode, then it needn't load boot code from storage media.
If ROM runs in SDP mode, then r0 must be 0x00
If ROM runs in internal boot mode, then r0 should be larger than IRAM base address. */
mov r7, r0
#if defined(CONFIG_MX53_ARD_DDR3)
/* IOMUX */
REG_LD_AND_STR_INIT(IOMUXC_BASE_ADDR)
REG_LD_AND_STR_OP(1, 0x554, 0x00300000)
REG_LD_AND_STR_OP(2, 0x558, 0x00300040)
REG_LD_AND_STR_OP(3, 0x560, 0x00300000)
REG_LD_AND_STR_OP(4, 0x564, 0x00300040)
REG_LD_AND_STR_OP(5, 0x568, 0x00300040)
REG_LD_AND_STR_OP(6, 0x570, 0x00300000)
REG_LD_AND_STR_OP(7, 0x574, 0x00300000)
REG_LD_AND_STR_OP(8, 0x578, 0x00300000)
REG_LD_AND_STR_OP(9, 0x57c, 0x00300040)
REG_LD_AND_STR_OP(10, 0x580, 0x00300040)
REG_LD_AND_STR_OP(11, 0x584, 0x00300000)
REG_LD_AND_STR_OP(12, 0x588, 0x00300000)
REG_LD_AND_STR_OP(13, 0x590, 0x00300040)
REG_LD_AND_STR_OP(14, 0x594, 0x00300000)
REG_LD_AND_STR_OP(15, 0x6f0, 0x00300000)
REG_LD_AND_STR_OP(16, 0x6f4, 0x00000000)
REG_LD_AND_STR_OP(17, 0x6fc, 0x00000000)
REG_LD_AND_STR_OP(18, 0x714, 0x00000000)
REG_LD_AND_STR_OP(19, 0x718, 0x00300000)
REG_LD_AND_STR_OP(20, 0x71c, 0x00300000)
REG_LD_AND_STR_OP(21, 0x720, 0x00300000)
REG_LD_AND_STR_OP(22, 0x724, 0x04000000)
REG_LD_AND_STR_OP(23, 0x728, 0x00300000)
REG_LD_AND_STR_OP(24, 0x72c, 0x00300000)
REG_LD_AND_STR_END(IOMUXC_BASE_ADDR)
/* ESDCTL */
REG_LD_AND_STR_INIT(ESDCTL_BASE_ADDR)
REG_LD_AND_STR_OP(25, 0x088, 0x35343535)
REG_LD_AND_STR_OP(26, 0x090, 0x4d444c44)
REG_LD_AND_STR_OP(27, 0x07c, 0x01370138)
REG_LD_AND_STR_OP(28, 0x080, 0x013b013c)
REG_LD_AND_STR_OP(29, 0x0f8, 0x00000800)
REG_LD_AND_STR_OP(30, 0x018, 0x00001740)
REG_LD_AND_STR_OP(31, 0x000, 0xc3190000)
REG_LD_AND_STR_OP(32, 0x00c, 0x9f5152e3)
REG_LD_AND_STR_OP(33, 0x010, 0xb68e8a63)
REG_LD_AND_STR_OP(34, 0x014, 0x01ff00db)
REG_LD_AND_STR_OP(35, 0x02c, 0x000026d2)
REG_LD_AND_STR_OP(36, 0x030, 0x009f0e21)
REG_LD_AND_STR_OP(37, 0x008, 0x12273030)
REG_LD_AND_STR_OP(38, 0x004, 0x0002002d)
REG_LD_AND_STR_OP(39, 0x01c, 0x00008032)
REG_LD_AND_STR_OP(40, 0x01c, 0x00008033)
REG_LD_AND_STR_OP(41, 0x01c, 0x00028031)
REG_LD_AND_STR_OP(42, 0x01c, 0x052080b0)
REG_LD_AND_STR_OP(43, 0x01c, 0x04008040)
REG_LD_AND_STR_OP(44, 0x01c, 0x0000803a)
REG_LD_AND_STR_OP(45, 0x01c, 0x0000803b)
REG_LD_AND_STR_OP(46, 0x01c, 0x00028039)
REG_LD_AND_STR_OP(47, 0x01c, 0x05208138)
REG_LD_AND_STR_OP(48, 0x01c, 0x04008048)
REG_LD_AND_STR_OP(49, 0x020, 0x00005800)
REG_LD_AND_STR_OP(50, 0x040, 0x04b80003)
REG_LD_AND_STR_OP(51, 0x058, 0x00022227)
REG_LD_AND_STR_OP(52, 0x01C, 0x00000000)
REG_LD_AND_STR_END(ESDCTL_BASE_ADDR)
#else
/* IOMUX */
REG_LD_AND_STR_INIT(IOMUXC_BASE_ADDR)
REG_LD_AND_STR_OP(1, 0x554, 0x00200000)
REG_LD_AND_STR_OP(2, 0x560, 0x00200000)
REG_LD_AND_STR_OP(3, 0x594, 0x00200000)
REG_LD_AND_STR_OP(4, 0x584, 0x00200000)
REG_LD_AND_STR_OP(5, 0x558, 0x00200040)
REG_LD_AND_STR_OP(6, 0x568, 0x00200040)
REG_LD_AND_STR_OP(7, 0x590, 0x00200040)
REG_LD_AND_STR_OP(8, 0x57c, 0x00200040)
REG_LD_AND_STR_OP(9, 0x564, 0x00200040)
REG_LD_AND_STR_OP(10, 0x580, 0x00200040)
REG_LD_AND_STR_OP(11, 0x570, 0x00200000)
REG_LD_AND_STR_OP(12, 0x578, 0x00200000)
REG_LD_AND_STR_OP(13, 0x72c, 0x00200000)
REG_LD_AND_STR_OP(14, 0x728, 0x00200000)
REG_LD_AND_STR_OP(15, 0x71c, 0x00200000)
REG_LD_AND_STR_OP(16, 0x718, 0x00200000)
REG_LD_AND_STR_OP(17, 0x574, 0x00280000)
REG_LD_AND_STR_OP(18, 0x588, 0x00280000)
REG_LD_AND_STR_OP(19, 0x6f0, 0x00280000)
REG_LD_AND_STR_OP(20, 0x720, 0x00280000)
REG_LD_AND_STR_OP(21, 0x6fc, 0x00000000)
REG_LD_AND_STR_OP(22, 0x6f4, 0x00000200)
REG_LD_AND_STR_OP(23, 0x714, 0x00000000)
REG_LD_AND_STR_OP(24, 0x724, 0x06000000)
REG_LD_AND_STR_END(IOMUXC_BASE_ADDR)
/* ESDCTL */
REG_LD_AND_STR_INIT(ESDCTL_BASE_ADDR)
REG_LD_AND_STR_OP(25, 0x088, 0x34333936)
REG_LD_AND_STR_OP(26, 0x090, 0x49434942)
REG_LD_AND_STR_OP(27, 0x0f8, 0x00000800)
REG_LD_AND_STR_OP(28, 0x07c, 0x01350138)
REG_LD_AND_STR_OP(29, 0x080, 0x01380139)
REG_LD_AND_STR_OP(30, 0x0f8, 0x00000800)
REG_LD_AND_STR_OP(31, 0x018, 0x00001710)
REG_LD_AND_STR_OP(32, 0x000, 0xc4110000)
REG_LD_AND_STR_OP(33, 0x00c, 0x4d5122d2)
REG_LD_AND_STR_OP(34, 0x010, 0x92d18a22)
REG_LD_AND_STR_OP(35, 0x014, 0x00c70092)
REG_LD_AND_STR_OP(36, 0x02c, 0x000026d2)
REG_LD_AND_STR_OP(37, 0x030, 0x009f000e)
REG_LD_AND_STR_OP(38, 0x008, 0x12272000)
REG_LD_AND_STR_OP(39, 0x004, 0x00030012)
REG_LD_AND_STR_OP(40, 0x01c, 0x04008010)
REG_LD_AND_STR_OP(41, 0x01c, 0x00008032)
REG_LD_AND_STR_OP(42, 0x01c, 0x00008033)
REG_LD_AND_STR_OP(43, 0x01c, 0x00008031)
REG_LD_AND_STR_OP(44, 0x01c, 0x0b5280b0)
REG_LD_AND_STR_OP(45, 0x01c, 0x04008010)
REG_LD_AND_STR_OP(46, 0x01c, 0x00008020)
REG_LD_AND_STR_OP(47, 0x01c, 0x00008020)
REG_LD_AND_STR_OP(48, 0x01c, 0x0a528030)
REG_LD_AND_STR_OP(49, 0x01c, 0x03c68031)
REG_LD_AND_STR_OP(50, 0x01c, 0x00448031)
REG_LD_AND_STR_OP(51, 0x01c, 0x04008018)
REG_LD_AND_STR_OP(52, 0x01c, 0x0000803a)
REG_LD_AND_STR_OP(53, 0x01c, 0x0000803b)
REG_LD_AND_STR_OP(54, 0x01c, 0x00008039)
REG_LD_AND_STR_OP(55, 0x01c, 0x0b528138)
REG_LD_AND_STR_OP(56, 0x01c, 0x04008018)
REG_LD_AND_STR_OP(57, 0x01c, 0x00008028)
REG_LD_AND_STR_OP(58, 0x01c, 0x00008028)
REG_LD_AND_STR_OP(59, 0x01c, 0x0a528038)
REG_LD_AND_STR_OP(60, 0x01c, 0x03c68039)
REG_LD_AND_STR_OP(61, 0x01c, 0x00448039)
REG_LD_AND_STR_OP(62, 0x020, 0x00005800)
REG_LD_AND_STR_OP(63, 0x058, 0x00033335)
REG_LD_AND_STR_OP(64, 0x01c, 0x00000000)
REG_LD_AND_STR_OP(65, 0x040, 0x04b80003)
REG_LD_AND_STR_END(ESDCTL_BASE_ADDR)
#endif
/*
* The following is to fill in those arguments for this ROM function
* pu_irom_hwcnfg_setup(void **start, size_t *bytes, const void *boot_data)
*
* This function is used to copy data from the storage media into DDR.
*
* start - Initial (possibly partial) image load address on entry. Final image
* load address on exit.
* bytes - Initial (possibly partial) image size on entry. Final image size on
* exit.
* boot_data - Initial @ref ivt Boot Data load address.
*/
adr r0, DDR_DEST_ADDR
adr r1, COPY_SIZE
adr r2, BOOT_DATA
before_calling_rom___pu_irom_hwcnfg_setup:
/* We should distinguish USB recovery mode(SDP mode) and internal boot mode.
If ROM runs in SDP mode, then it needn't load boot code from storage media.
If ROM runs in SDP mode, then r0 must be 0x00
If ROM runs in internal boot mode, then r0 should be larger than IRAM base address. */
cmp r7, #0xF8000000
bls return_sdp
/* Different ROM address for TO 1.0 & TO 2.0 */
ldr r3, =ROM_SI_REV
ldr r4, [r3]
cmp r4, #0x21
/* TO2.1 */
moveq r6, #0x1800
addeq r6, r6, #0x4d
beq 2f
cmp r4, #0x20
/* TO2 */
moveq r6, #0x1800
addeq r6, r6, #0x4d
beq 2f
/* TO1 */
mov r6, #0x400000
add r6, r6, #0x5000
add r6, r6, #0xc7
2:
blx r6 /* This address might change in future ROM versions */
after_calling_rom___pu_irom_hwcnfg_setup:
return_sdp:
cmp r7, #0xF8000000
bhi quit_plugin
/* Workaround run plug-ins in SDP mode without USB re-enumeration.
how it works:
ROM running in usb download mode.
Host manufacturing application sends SDP command to download plug-in image.
Host manufacturing application sends SDP command to jump to plug-in image and run it.
Plug-in starts execution and after its regular tasks plug-in will then call into ROM
call into pl_parse_and_handle() */
ldr r3, =ROM_SI_REV
ldr r5, [r3]
cmp r5, #0x20 /* check silicon revision to determine the function entry address */
ldrlt r4, =0x00000edd /* function entry in TO1 ROM */
ldrge r4, =0x0040487d /* function entry in TO2 ROM */
blx r4
/* To return to ROM from plugin, we need to fill in these argument.
* Here is what need to do:
* Need to construct the paramters for this function before return to ROM:
* plugin_download(void **start, size_t *bytes, UINT32 *ivt_offset)
*/
quit_plugin:
pop {r0-r6, lr}
ldr r7, DDR_DEST_ADDR
str r7, [r0]
ldr r7, COPY_SIZE
str r7, [r1]
mov r7, #0x400 /* Point to the second IVT table at offset 0x42C */
add r7, r7, #0x2C
str r7, [r2]
mov r0, #1
bx lr /* return back to ROM code */
DDR_DEST_ADDR: .word TEXT_BASE
COPY_SIZE: .word _end - TEXT_BASE
BOOT_DATA: .word TEXT_BASE
.word _end - TEXT_BASE
.word 0
#endif

View File

@ -0,0 +1,371 @@
/*
* Copyright (C) 2007, Guennadi Liakhovetski <lg@denx.de>
*
* Copyright (C) 2010-2011 Freescale Semiconductor, Inc.
*
* 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.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
*/
#include <config.h>
#include <asm/arch/mx53.h>
/*
* L2CC Cache setup/invalidation/disable
*/
.macro init_l2cc
/* explicitly disable L2 cache */
mrc 15, 0, r0, c1, c0, 1
bic r0, r0, #0x2
mcr 15, 0, r0, c1, c0, 1
/* reconfigure L2 cache aux control reg */
mov r0, #0xC0 /* tag RAM */
add r0, r0, #0x4 /* data RAM */
orr r0, r0, #(1 << 24) /* disable write allocate delay */
orr r0, r0, #(1 << 23) /* disable write allocate combine */
orr r0, r0, #(1 << 22) /* disable write allocate */
mcr 15, 1, r0, c9, c0, 2
.endm /* init_l2cc */
/* AIPS setup - Only setup MPROTx registers.
* The PACR default values are good.*/
.macro init_aips
/*
* Set all MPROTx to be non-bufferable, trusted for R/W,
* not forced to user-mode.
*/
ldr r0, =AIPS1_BASE_ADDR
ldr r1, =0x77777777
str r1, [r0, #0x0]
str r1, [r0, #0x4]
ldr r0, =AIPS2_BASE_ADDR
str r1, [r0, #0x0]
str r1, [r0, #0x4]
.endm /* init_aips */
.macro setup_pll pll, freq
/*
* If freq < 300MHz, we need to set dpdck0_2_en to 0
*/
ldr r0, =\freq
ldr r1, =0x300
cmp r0, r1
ldrcs r1, =0x00001232
ldrcc r1, =0x00000232
ldr r0, =\pll
str r1, [r0, #PLL_DP_CTL]
mov r1, #0x2
str r1, [r0, #PLL_DP_CONFIG]
ldr r1, W_DP_OP_\freq
str r1, [r0, #PLL_DP_OP]
str r1, [r0, #PLL_DP_HFS_OP]
ldr r1, W_DP_MFD_\freq
str r1, [r0, #PLL_DP_MFD]
str r1, [r0, #PLL_DP_HFS_MFD]
ldr r1, W_DP_MFN_\freq
str r1, [r0, #PLL_DP_MFN]
str r1, [r0, #PLL_DP_HFS_MFN]
ldr r1, =0x00001232
str r1, [r0, #PLL_DP_CTL]
1: ldr r1, [r0, #PLL_DP_CTL]
ands r1, r1, #0x1
beq 1b
.endm
.macro init_m4if
/*increase master2 priority for WIFI*/
ldr r0, =M4IF_BASE_ADDR
ldr r1, [r0, #0x40]
orr r1, r1, #(0x33 << 16)
str r1, [r0, #0x40]
/*increase master4 priority for FEC*/
ldr r1, [r0, #0x44]
orr r1, r1, #0x33
str r1, [r0, #0x44]
/*set SDHC-port3 high priority to all AHB MAX Slave port*/
ldr r0, =AHBMAX_BASE_ADDR
#ifdef CONFIG_WIFI_SDHC_PORT3
/*set PARK to SDHC-port3*/
ldr r0, =AHBMAX_BASE_ADDR
ldr r1, [r0, #0x10]
bic r1, r1, #(0x7 << 0)
orr r1, r1, #0x3
bic r1, r1, #(0x3 << 4)
bic r1, r1, #(0x3 << 8)
orr r1, r1, #(0x1 << 30)
bic r1, r1, #(0x1 << 31)
ldr r1, [r0, #0x110]
bic r1, r1, #(0x7 << 0)
orr r1, r1, #0x3
bic r1, r1, #(0x3 << 4)
bic r1, r1, #(0x3 << 8)
orr r1, r1, #(0x1 << 30)
bic r1, r1, #(0x1 << 31)
ldr r1, [r0, #0x210]
bic r1, r1, #(0x7 << 0)
orr r1, r1, #0x3
bic r1, r1, #(0x3 << 4)
bic r1, r1, #(0x3 << 8)
orr r1, r1, #(0x1 << 30)
bic r1, r1, #(0x1 << 31)
ldr r1, [r0, #0x310]
bic r1, r1, #(0x7 << 0)
orr r1, r1, #0x3
bic r1, r1, #(0x3 << 4)
bic r1, r1, #(0x3 << 8)
orr r1, r1, #(0x1 << 30)
bic r1, r1, #(0x1 << 31)
/*set SDHC-port3 arbitration*/
ldr r0, =AHBMAX_BASE_ADDR
ldr r1, [r0, #0xb00]
bic r1, r1, #(0x7 << 0)
orr r1, r1, #0x1
#endif
#ifdef CONFIG_WIFI_SDHC_PORT2
/*set PARK to SDHC-port3*/
ldr r0, =AHBMAX_BASE_ADDR
ldr r1, [r0, #0x10]
bic r1, r1, #(0x7 << 0)
orr r1, r1, #0x2
bic r1, r1, #(0x3 << 4)
bic r1, r1, #(0x3 << 8)
orr r1, r1, #(0x1 << 30)
bic r1, r1, #(0x1 << 31)
ldr r1, [r0, #0x110]
bic r1, r1, #(0x7 << 0)
orr r1, r1, #0x2
bic r1, r1, #(0x3 << 4)
bic r1, r1, #(0x3 << 8)
orr r1, r1, #(0x1 << 30)
bic r1, r1, #(0x1 << 31)
ldr r1, [r0, #0x210]
bic r1, r1, #(0x7 << 0)
orr r1, r1, #0x2
bic r1, r1, #(0x3 << 4)
bic r1, r1, #(0x3 << 8)
orr r1, r1, #(0x1 << 30)
bic r1, r1, #(0x1 << 31)
ldr r1, [r0, #0x310]
bic r1, r1, #(0x7 << 0)
orr r1, r1, #0x2
bic r1, r1, #(0x3 << 4)
bic r1, r1, #(0x3 << 8)
orr r1, r1, #(0x1 << 30)
bic r1, r1, #(0x1 << 31)
/*set SDHC-port2 arbitration*/
ldr r0, =AHBMAX_BASE_ADDR
ldr r1, [r0, #0xA00]
bic r1, r1, #(0x7 << 0)
#endif
/*set JMP step to zero*/
ldr r0, =M4IF_BASE_ADDR
ldr r1, [r0, #0x48]
bic r1, r1, #(0x3 << 8)
str r1, [r0, #0x48]
.endm
.macro init_clock
ldr r0, =ROM_SI_REV
ldr r1, [r0]
cmp r1, #0x20
/* For TO2 only, set LDO to 1.3V */
ldr r0, =0x53fa8000
ldr r1, =0x00194005
streq r1, [r0, #0x04]
ldr r0, CCM_BASE_ADDR_W
/* Gate of clocks to the peripherals first */
ldr r1, =0x3FFFFFFF
str r1, [r0, #CLKCTL_CCGR0]
ldr r1, =0x0
str r1, [r0, #CLKCTL_CCGR1]
str r1, [r0, #CLKCTL_CCGR2]
str r1, [r0, #CLKCTL_CCGR3]
str r1, [r0, #CLKCTL_CCGR7]
ldr r1, =0x00030000
str r1, [r0, #CLKCTL_CCGR4]
ldr r1, =0x00FFF030
str r1, [r0, #CLKCTL_CCGR5]
ldr r1, =0x0F00030F
str r1, [r0, #CLKCTL_CCGR6]
/* Switch ARM to step clock */
mov r1, #0x4
str r1, [r0, #CLKCTL_CCSR]
setup_pll PLL1_BASE_ADDR, 800
setup_pll PLL3_BASE_ADDR, 400
/* Switch peripheral to PLL3 */
ldr r0, CCM_BASE_ADDR_W
ldr r1, CCM_VAL_0x00015154
str r1, [r0, #CLKCTL_CBCMR]
ldr r1, CCM_VAL_0x02888945
orr r1, r1, #(1 << 16)
str r1, [r0, #CLKCTL_CBCDR]
/* make sure change is effective */
1: ldr r1, [r0, #CLKCTL_CDHIPR]
cmp r1, #0x0
bne 1b
setup_pll PLL2_BASE_ADDR, CONFIG_SYS_PLL2_FREQ
/* Switch peripheral to PLL2 */
ldr r0, CCM_BASE_ADDR_W
ldr r1, CCM_VAL_0x00808145
orr r1, r1, #(CONFIG_SYS_AHB_PODF << 10)
orr r1, r1, #(CONFIG_SYS_AXIA_PODF << 16)
orr r1, r1, #(CONFIG_SYS_AXIB_PODF << 19)
str r1, [r0, #CLKCTL_CBCDR]
ldr r1, CCM_VAL_0x00016154
str r1, [r0, #CLKCTL_CBCMR]
/*change uart clk parent to pll2*/
ldr r1, [r0, #CLKCTL_CSCMR1]
and r1, r1, #0xfcffffff
orr r1, r1, #0x01000000
str r1, [r0, #CLKCTL_CSCMR1]
/* make sure change is effective */
1: ldr r1, [r0, #CLKCTL_CDHIPR]
cmp r1, #0x0
bne 1b
setup_pll PLL3_BASE_ADDR, 216
setup_pll PLL4_BASE_ADDR, 455
/* Set the platform clock dividers */
ldr r0, PLATFORM_BASE_ADDR_W
ldr r1, PLATFORM_CLOCK_DIV_W
str r1, [r0, #PLATFORM_ICGC]
ldr r0, CCM_BASE_ADDR_W
mov r1, #0
str r1, [r0, #CLKCTL_CACRR]
/* Switch ARM back to PLL 1. */
mov r1, #0x0
str r1, [r0, #CLKCTL_CCSR]
/* make uart div=6*/
ldr r1, [r0, #CLKCTL_CSCDR1]
and r1, r1, #0xffffffc0
orr r1, r1, #0x0a
str r1, [r0, #CLKCTL_CSCDR1]
/* Restore the default values in the Gate registers */
ldr r1, =0xFFFFFFFF
str r1, [r0, #CLKCTL_CCGR0]
str r1, [r0, #CLKCTL_CCGR1]
str r1, [r0, #CLKCTL_CCGR2]
str r1, [r0, #CLKCTL_CCGR3]
str r1, [r0, #CLKCTL_CCGR4]
str r1, [r0, #CLKCTL_CCGR5]
str r1, [r0, #CLKCTL_CCGR6]
str r1, [r0, #CLKCTL_CCGR7]
mov r1, #0x00000
str r1, [r0, #CLKCTL_CCDR]
/* for cko - for ARM div by 8 */
mov r1, #0x000A0000
add r1, r1, #0x00000F0
str r1, [r0, #CLKCTL_CCOSR]
.endm
.section ".text.init", "x"
.globl lowlevel_init
lowlevel_init:
#ifdef ENABLE_IMPRECISE_ABORT
mrs r1, spsr /* save old spsr */
mrs r0, cpsr /* read out the cpsr */
bic r0, r0, #0x100 /* clear the A bit */
msr spsr, r0 /* update spsr */
add lr, pc, #0x8 /* update lr */
movs pc, lr /* update cpsr */
nop
nop
nop
nop
msr spsr, r1 /* restore old spsr */
#endif
/* ARM errata ID #468414 */
mrc 15, 0, r1, c1, c0, 1
orr r1, r1, #(1 << 5) /* enable L1NEON bit */
mcr 15, 0, r1, c1, c0, 1
init_l2cc
init_aips
#ifdef CONFIG_ADJUST_WIFI_FEC_PERFORMANCE
/*increase WIFI & FEC priority of accessing bus*/
init_m4if
#endif
init_clock
mov pc, lr
/* Board level setting value */
CCM_BASE_ADDR_W: .word CCM_BASE_ADDR
CCM_VAL_0x00016154: .word 0x00016154
CCM_VAL_0x00808145: .word 0x00808145
CCM_VAL_0x00015154: .word 0x00015154
CCM_VAL_0x02888945: .word 0x02888945
W_DP_OP_800: .word DP_OP_800
W_DP_MFD_800: .word DP_MFD_800
W_DP_MFN_800: .word DP_MFN_800
W_DP_OP_600: .word DP_OP_600
W_DP_MFD_600: .word DP_MFD_600
W_DP_MFN_600: .word DP_MFN_600
W_DP_OP_400: .word DP_OP_400
W_DP_MFD_400: .word DP_MFD_400
W_DP_MFN_400: .word DP_MFN_400
W_DP_OP_216: .word DP_OP_216
W_DP_MFD_216: .word DP_MFD_216
W_DP_MFN_216: .word DP_MFN_216
W_DP_OP_455: .word DP_OP_455
W_DP_MFD_455: .word DP_MFD_455
W_DP_MFN_455: .word DP_MFN_455
PLATFORM_BASE_ADDR_W: .word ARM_BASE_ADDR
PLATFORM_CLOCK_DIV_W: .word 0x00000124

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,74 @@
/*
* January 2004 - Changed to support H4 device
* Copyright (c) 2004 Texas Instruments
*
* (C) Copyright 2002
* Gary Jennejohn, DENX Software Engineering, <gj@denx.de>
*
* (C) Copyright 2010 Freescale Semiconductor, Inc.
*
* See file CREDITS for list of people who contributed to this
* project.
*
* 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.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
*/
OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
OUTPUT_ARCH(arm)
ENTRY(_start)
SECTIONS
{
. = 0x00000000;
. = ALIGN(4);
.text :
{
/* WARNING - the following is hand-optimized to fit within */
/* the sector layout of our flash chips! XXX FIXME XXX */
board/freescale/mx53_ard/flash_header.o (.text.flasheader)
cpu/arm_cortexa8/start.o
board/freescale/mx53_ard/libmx53_ard.a (.text)
lib_arm/libarm.a (.text)
net/libnet.a (.text)
drivers/mtd/libmtd.a (.text)
drivers/mmc/libmmc.a (.text)
. = DEFINED(env_offset) ? env_offset : .;
common/env_embedded.o(.text)
*(.text)
}
. = ALIGN(4);
.rodata : { *(.rodata) }
. = ALIGN(4);
.data : { *(.data) }
. = ALIGN(4);
.got : { *(.got) }
. = .;
__u_boot_cmd_start = .;
.u_boot_cmd : { *(.u_boot_cmd) }
__u_boot_cmd_end = .;
. = ALIGN(4);
_end_of_copy = .; /* end_of ROM copy code here */
__bss_start = .;
.bss : { *(.bss) }
_end = .;
}

View File

@ -0,0 +1,49 @@
#
# Copyright (C) 2007, Guennadi Liakhovetski <lg@denx.de>
#
# (C) Copyright 2010 Freescale Semiconductor, Inc.
#
# 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.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
# MA 02111-1307 USA
#
include $(TOPDIR)/config.mk
LIB = $(obj)lib$(BOARD).a
COBJS := mx53_evk.o
SOBJS := lowlevel_init.o flash_header.o
SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c)
OBJS := $(addprefix $(obj),$(COBJS))
SOBJS := $(addprefix $(obj),$(SOBJS))
$(LIB): $(obj).depend $(OBJS) $(SOBJS)
$(AR) $(ARFLAGS) $@ $(OBJS) $(SOBJS)
clean:
rm -f $(SOBJS) $(OBJS)
distclean: clean
rm -f $(LIB) core *.bak .depend
#########################################################################
# defines $(obj).depend target
include $(SRCTREE)/rules.mk
sinclude $(obj).depend
#########################################################################

View File

@ -0,0 +1,3 @@
LDSCRIPT := $(SRCTREE)/board/$(VENDOR)/$(BOARD)/u-boot.lds
TEXT_BASE = 0x77800000

View File

@ -0,0 +1,242 @@
/*
* Copyright (C) 2010-2011 Freescale Semiconductor, Inc.
*
* 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.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
*/
#include <config.h>
#include <asm/arch/mx53.h>
#define REG_LD_AND_STR_INIT(base) \
ldr r0, =base;
#define REG_LD_AND_STR_OP(i, offset, val) \
ldr r1, =val; \
ldr r2, =offset; \
str r1, [r0, r2];
#define REG_LD_AND_STR_END(base)
#ifdef CONFIG_FLASH_HEADER
#ifndef CONFIG_FLASH_HEADER_OFFSET
# error "Must define the offset of flash header"
#endif
.section ".text.flasheader", "x"
b _start
.org CONFIG_FLASH_HEADER_OFFSET
ivt_header: .long 0x402000D1/* Tag=0xD1, Len=0x0020, Ver=0x40 */
app_code_jump_v: .long (0xF8006000 + (plugin_start - TEXT_BASE))
reserv1: .long 0x0
dcd_ptr: .long 0x0
boot_data_ptr: .long (0xF8006000 + (boot_data - TEXT_BASE))
self_ptr: .long (0xF8006000 + (ivt_header - TEXT_BASE))
app_code_csf: .long 0x0
reserv2: .long 0x0
boot_data: .long 0xF8006000
image_len: .long (3 * 1024)
plugin: .long 0x1
/* Second IVT to give entry point into the bootloader copied to DDR */
ivt2_header: .long 0x402000D1/*Tag=0xD1, Len=0x0020, Ver=0x40 */
app2_code_jump_v: .long _start /* Entry point for the bootloader */
reserv3: .long 0x0
dcd2_ptr: .long 0x0
boot_data2_ptr: .long boot_data2
self_ptr2: .long ivt2_header
app_code_csf2: .long 0x0
reserv4: .long 0x0
boot_data2: .long TEXT_BASE
image_len2: .long _end_of_copy - TEXT_BASE + CONFIG_FLASH_HEADER_OFFSET
plugin2: .long 0x0
/* Here starts the plugin code */
plugin_start:
/* Save the return address and the function arguments */
push {r0-r6, lr}
/* We should distinguish USB recovery mode(SDP mode) and internal boot mode.
If ROM runs in SDP mode, then it needn't load boot code from storage media.
If ROM runs in SDP mode, then r0 must be 0x00
If ROM runs in internal boot mode, then r0 should be larger than IRAM base address. */
mov r7, r0
/* IOMUX */
REG_LD_AND_STR_INIT(IOMUXC_BASE_ADDR)
REG_LD_AND_STR_OP(1, 0x554, 0x00200000)
REG_LD_AND_STR_OP(2, 0x560, 0x00200000)
REG_LD_AND_STR_OP(3, 0x594, 0x00200000)
REG_LD_AND_STR_OP(4, 0x584, 0x00200000)
REG_LD_AND_STR_OP(5, 0x558, 0x00200040)
REG_LD_AND_STR_OP(6, 0x568, 0x00200040)
REG_LD_AND_STR_OP(7, 0x590, 0x00200040)
REG_LD_AND_STR_OP(8, 0x57c, 0x00200040)
REG_LD_AND_STR_OP(9, 0x564, 0x00200040)
REG_LD_AND_STR_OP(10, 0x580, 0x00200040)
REG_LD_AND_STR_OP(11, 0x570, 0x00200000)
REG_LD_AND_STR_OP(12, 0x578, 0x00200000)
REG_LD_AND_STR_OP(13, 0x72c, 0x00200000)
REG_LD_AND_STR_OP(14, 0x728, 0x00200000)
REG_LD_AND_STR_OP(15, 0x71c, 0x00200000)
REG_LD_AND_STR_OP(16, 0x718, 0x00200000)
REG_LD_AND_STR_OP(17, 0x574, 0x00280000)
REG_LD_AND_STR_OP(18, 0x588, 0x00280000)
REG_LD_AND_STR_OP(19, 0x6f0, 0x00280000)
REG_LD_AND_STR_OP(20, 0x720, 0x00280000)
REG_LD_AND_STR_OP(21, 0x6fc, 0x00000000)
REG_LD_AND_STR_OP(22, 0x6f4, 0x00000200)
REG_LD_AND_STR_OP(23, 0x714, 0x00000000)
REG_LD_AND_STR_OP(24, 0x724, 0x06000000)
REG_LD_AND_STR_END(IOMUXC_BASE_ADDR)
/* ESDCTL */
REG_LD_AND_STR_INIT(ESDCTL_BASE_ADDR)
REG_LD_AND_STR_OP(25, 0x088, 0x34333936)
REG_LD_AND_STR_OP(26, 0x090, 0x49434942)
REG_LD_AND_STR_OP(27, 0x0f8, 0x00000800)
REG_LD_AND_STR_OP(28, 0x07c, 0x01350138)
REG_LD_AND_STR_OP(29, 0x080, 0x01380139)
REG_LD_AND_STR_OP(30, 0x0f8, 0x00000800)
REG_LD_AND_STR_OP(31, 0x018, 0x00001710)
REG_LD_AND_STR_OP(32, 0x000, 0xc4110000)
REG_LD_AND_STR_OP(33, 0x00c, 0x4d5122d2)
REG_LD_AND_STR_OP(34, 0x010, 0x92d18a22)
REG_LD_AND_STR_OP(35, 0x014, 0x00c70092)
REG_LD_AND_STR_OP(36, 0x02c, 0x000026d2)
REG_LD_AND_STR_OP(37, 0x030, 0x009f000e)
REG_LD_AND_STR_OP(38, 0x008, 0x12272000)
REG_LD_AND_STR_OP(39, 0x004, 0x00030012)
REG_LD_AND_STR_OP(40, 0x01c, 0x04008010)
REG_LD_AND_STR_OP(41, 0x01c, 0x00008032)
REG_LD_AND_STR_OP(42, 0x01c, 0x00008033)
REG_LD_AND_STR_OP(43, 0x01c, 0x00008031)
REG_LD_AND_STR_OP(44, 0x01c, 0x0b5280b0)
REG_LD_AND_STR_OP(45, 0x01c, 0x04008010)
REG_LD_AND_STR_OP(46, 0x01c, 0x00008020)
REG_LD_AND_STR_OP(47, 0x01c, 0x00008020)
REG_LD_AND_STR_OP(48, 0x01c, 0x0a528030)
REG_LD_AND_STR_OP(49, 0x01c, 0x03c68031)
REG_LD_AND_STR_OP(50, 0x01c, 0x00448031)
REG_LD_AND_STR_OP(51, 0x01c, 0x04008018)
REG_LD_AND_STR_OP(52, 0x01c, 0x0000803a)
REG_LD_AND_STR_OP(53, 0x01c, 0x0000803b)
REG_LD_AND_STR_OP(54, 0x01c, 0x00008039)
REG_LD_AND_STR_OP(55, 0x01c, 0x0b528138)
REG_LD_AND_STR_OP(56, 0x01c, 0x04008018)
REG_LD_AND_STR_OP(57, 0x01c, 0x00008028)
REG_LD_AND_STR_OP(58, 0x01c, 0x00008028)
REG_LD_AND_STR_OP(59, 0x01c, 0x0a528038)
REG_LD_AND_STR_OP(60, 0x01c, 0x03c68039)
REG_LD_AND_STR_OP(61, 0x01c, 0x00448039)
REG_LD_AND_STR_OP(62, 0x020, 0x00005800)
REG_LD_AND_STR_OP(63, 0x058, 0x00033335)
REG_LD_AND_STR_OP(64, 0x01c, 0x00000000)
REG_LD_AND_STR_OP(65, 0x040, 0x04b80003)
REG_LD_AND_STR_END(ESDCTL_BASE_ADDR)
/*
* The following is to fill in those arguments for this ROM function
* pu_irom_hwcnfg_setup(void **start, size_t *bytes, const void *boot_data)
*
* This function is used to copy data from the storage media into DDR.
*
* start - Initial (possibly partial) image load address on entry. Final image
* load address on exit.
* bytes - Initial (possibly partial) image size on entry. Final image size on
* exit.
* boot_data - Initial @ref ivt Boot Data load address.
*/
adr r0, DDR_DEST_ADDR
adr r1, COPY_SIZE
adr r2, BOOT_DATA
before_calling_rom___pu_irom_hwcnfg_setup:
/* We should distinguish USB recovery mode(SDP mode) and internal boot mode.
If ROM runs in SDP mode, then it needn't load boot code from storage media.
If ROM runs in SDP mode, then r0 must be 0x00
If ROM runs in internal boot mode, then r0 should be larger than IRAM base address. */
cmp r7, #0xF8000000
bls return_sdp
/* Different ROM address for TO 1.0 & TO 2.0 */
ldr r3, =ROM_SI_REV
ldr r4, [r3]
cmp r4, #0x21
/* TO2.1 */
moveq r6, #0x1800
addeq r6, r6, #0x4d
beq 2f
cmp r4, #0x20
/* TO2 */
moveq r6, #0x1800
addeq r6, r6, #0x4d
beq 2f
/* TO1 */
mov r6, #0x400000
add r6, r6, #0x5000
add r6, r6, #0xc7
2:
blx r6 /* This address might change in future ROM versions */
after_calling_rom___pu_irom_hwcnfg_setup:
return_sdp:
cmp r7, #0xF8000000
bhi quit_plugin
/* Workaround run plug-ins in SDP mode without USB re-enumeration.
how it works:
ROM running in usb download mode.
Host manufacturing application sends SDP command to download plug-in image.
Host manufacturing application sends SDP command to jump to plug-in image and run it.
Plug-in starts execution and after its regular tasks plug-in will then call into ROM
call into pl_parse_and_handle() */
ldr r3, =ROM_SI_REV
ldr r5, [r3]
cmp r5, #0x20 /* check silicon revision to determine the function entry address */
ldrlt r4, =0x00000edd /* function entry in TO1 ROM */
ldrge r4, =0x0040487d /* function entry in TO2 ROM */
blx r4
/* To return to ROM from plugin, we need to fill in these argument.
* Here is what need to do:
* Need to construct the paramters for this function before return to ROM:
* plugin_download(void **start, size_t *bytes, UINT32 *ivt_offset)
*/
quit_plugin:
pop {r0-r6, lr}
ldr r7, DDR_DEST_ADDR
str r7, [r0]
ldr r7, COPY_SIZE
str r7, [r1]
mov r7, #0x400 /* Point to the second IVT table at offset 0x42C */
add r7, r7, #0x2C
str r7, [r2]
mov r0, #1
bx lr /* return back to ROM code */
DDR_DEST_ADDR: .word TEXT_BASE
COPY_SIZE: .word _end - TEXT_BASE
BOOT_DATA: .word TEXT_BASE
.word _end - TEXT_BASE
.word 0
#endif

View File

@ -0,0 +1,371 @@
/*
* Copyright (C) 2007, Guennadi Liakhovetski <lg@denx.de>
*
* Copyright (C) 2010-2011 Freescale Semiconductor, Inc.
*
* 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.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
*/
#include <config.h>
#include <asm/arch/mx53.h>
/*
* L2CC Cache setup/invalidation/disable
*/
.macro init_l2cc
/* explicitly disable L2 cache */
mrc 15, 0, r0, c1, c0, 1
bic r0, r0, #0x2
mcr 15, 0, r0, c1, c0, 1
/* reconfigure L2 cache aux control reg */
mov r0, #0xC0 /* tag RAM */
add r0, r0, #0x4 /* data RAM */
orr r0, r0, #(1 << 24) /* disable write allocate delay */
orr r0, r0, #(1 << 23) /* disable write allocate combine */
orr r0, r0, #(1 << 22) /* disable write allocate */
mcr 15, 1, r0, c9, c0, 2
.endm /* init_l2cc */
/* AIPS setup - Only setup MPROTx registers.
* The PACR default values are good.*/
.macro init_aips
/*
* Set all MPROTx to be non-bufferable, trusted for R/W,
* not forced to user-mode.
*/
ldr r0, =AIPS1_BASE_ADDR
ldr r1, =0x77777777
str r1, [r0, #0x0]
str r1, [r0, #0x4]
ldr r0, =AIPS2_BASE_ADDR
str r1, [r0, #0x0]
str r1, [r0, #0x4]
.endm /* init_aips */
.macro setup_pll pll, freq
/*
* If freq < 300MHz, we need to set dpdck0_2_en to 0
*/
ldr r0, =\freq
ldr r1, =0x300
cmp r0, r1
ldrcs r1, =0x00001232
ldrcc r1, =0x00000232
ldr r0, =\pll
str r1, [r0, #PLL_DP_CTL]
mov r1, #0x2
str r1, [r0, #PLL_DP_CONFIG]
ldr r1, W_DP_OP_\freq
str r1, [r0, #PLL_DP_OP]
str r1, [r0, #PLL_DP_HFS_OP]
ldr r1, W_DP_MFD_\freq
str r1, [r0, #PLL_DP_MFD]
str r1, [r0, #PLL_DP_HFS_MFD]
ldr r1, W_DP_MFN_\freq
str r1, [r0, #PLL_DP_MFN]
str r1, [r0, #PLL_DP_HFS_MFN]
ldr r1, =0x00001232
str r1, [r0, #PLL_DP_CTL]
1: ldr r1, [r0, #PLL_DP_CTL]
ands r1, r1, #0x1
beq 1b
.endm
.macro init_m4if
/*increase master2 priority for WIFI*/
ldr r0, =M4IF_BASE_ADDR
ldr r1, [r0, #0x40]
orr r1, r1, #(0x33 << 16)
str r1, [r0, #0x40]
/*increase master4 priority for FEC*/
ldr r1, [r0, #0x44]
orr r1, r1, #0x33
str r1, [r0, #0x44]
/*set SDHC-port3 high priority to all AHB MAX Slave port*/
ldr r0, =AHBMAX_BASE_ADDR
#ifdef CONFIG_WIFI_SDHC_PORT3
/*set PARK to SDHC-port3*/
ldr r0, =AHBMAX_BASE_ADDR
ldr r1, [r0, #0x10]
bic r1, r1, #(0x7 << 0)
orr r1, r1, #0x3
bic r1, r1, #(0x3 << 4)
bic r1, r1, #(0x3 << 8)
orr r1, r1, #(0x1 << 30)
bic r1, r1, #(0x1 << 31)
ldr r1, [r0, #0x110]
bic r1, r1, #(0x7 << 0)
orr r1, r1, #0x3
bic r1, r1, #(0x3 << 4)
bic r1, r1, #(0x3 << 8)
orr r1, r1, #(0x1 << 30)
bic r1, r1, #(0x1 << 31)
ldr r1, [r0, #0x210]
bic r1, r1, #(0x7 << 0)
orr r1, r1, #0x3
bic r1, r1, #(0x3 << 4)
bic r1, r1, #(0x3 << 8)
orr r1, r1, #(0x1 << 30)
bic r1, r1, #(0x1 << 31)
ldr r1, [r0, #0x310]
bic r1, r1, #(0x7 << 0)
orr r1, r1, #0x3
bic r1, r1, #(0x3 << 4)
bic r1, r1, #(0x3 << 8)
orr r1, r1, #(0x1 << 30)
bic r1, r1, #(0x1 << 31)
/*set SDHC-port3 arbitration*/
ldr r0, =AHBMAX_BASE_ADDR
ldr r1, [r0, #0xb00]
bic r1, r1, #(0x7 << 0)
orr r1, r1, #0x1
#endif
#ifdef CONFIG_WIFI_SDHC_PORT2
/*set PARK to SDHC-port3*/
ldr r0, =AHBMAX_BASE_ADDR
ldr r1, [r0, #0x10]
bic r1, r1, #(0x7 << 0)
orr r1, r1, #0x2
bic r1, r1, #(0x3 << 4)
bic r1, r1, #(0x3 << 8)
orr r1, r1, #(0x1 << 30)
bic r1, r1, #(0x1 << 31)
ldr r1, [r0, #0x110]
bic r1, r1, #(0x7 << 0)
orr r1, r1, #0x2
bic r1, r1, #(0x3 << 4)
bic r1, r1, #(0x3 << 8)
orr r1, r1, #(0x1 << 30)
bic r1, r1, #(0x1 << 31)
ldr r1, [r0, #0x210]
bic r1, r1, #(0x7 << 0)
orr r1, r1, #0x2
bic r1, r1, #(0x3 << 4)
bic r1, r1, #(0x3 << 8)
orr r1, r1, #(0x1 << 30)
bic r1, r1, #(0x1 << 31)
ldr r1, [r0, #0x310]
bic r1, r1, #(0x7 << 0)
orr r1, r1, #0x2
bic r1, r1, #(0x3 << 4)
bic r1, r1, #(0x3 << 8)
orr r1, r1, #(0x1 << 30)
bic r1, r1, #(0x1 << 31)
/*set SDHC-port2 arbitration*/
ldr r0, =AHBMAX_BASE_ADDR
ldr r1, [r0, #0xA00]
bic r1, r1, #(0x7 << 0)
#endif
/*set JMP step to zero*/
ldr r0, =M4IF_BASE_ADDR
ldr r1, [r0, #0x48]
bic r1, r1, #(0x3 << 8)
str r1, [r0, #0x48]
.endm
.macro init_clock
ldr r0, =ROM_SI_REV
ldr r1, [r0]
cmp r1, #0x20
/* For TO2 only, set LDO to 1.3V */
ldr r0, =0x53fa8000
ldr r1, =0x00194005
streq r1, [r0, #0x04]
ldr r0, CCM_BASE_ADDR_W
/* Gate of clocks to the peripherals first */
ldr r1, =0x3FFFFFFF
str r1, [r0, #CLKCTL_CCGR0]
ldr r1, =0x0
str r1, [r0, #CLKCTL_CCGR1]
str r1, [r0, #CLKCTL_CCGR2]
str r1, [r0, #CLKCTL_CCGR3]
str r1, [r0, #CLKCTL_CCGR7]
ldr r1, =0x00030000
str r1, [r0, #CLKCTL_CCGR4]
ldr r1, =0x00FFF030
str r1, [r0, #CLKCTL_CCGR5]
ldr r1, =0x0F00030F
str r1, [r0, #CLKCTL_CCGR6]
/* Switch ARM to step clock */
mov r1, #0x4
str r1, [r0, #CLKCTL_CCSR]
setup_pll PLL1_BASE_ADDR, 800
setup_pll PLL3_BASE_ADDR, 400
/* Switch peripheral to PLL3 */
ldr r0, CCM_BASE_ADDR_W
ldr r1, CCM_VAL_0x00015154
str r1, [r0, #CLKCTL_CBCMR]
ldr r1, CCM_VAL_0x02888945
orr r1, r1, #(1 << 16)
str r1, [r0, #CLKCTL_CBCDR]
/* make sure change is effective */
1: ldr r1, [r0, #CLKCTL_CDHIPR]
cmp r1, #0x0
bne 1b
setup_pll PLL2_BASE_ADDR, CONFIG_SYS_PLL2_FREQ
/* Switch peripheral to PLL2 */
ldr r0, CCM_BASE_ADDR_W
ldr r1, CCM_VAL_0x00808145
orr r1, r1, #(CONFIG_SYS_AHB_PODF << 10)
orr r1, r1, #(CONFIG_SYS_AXIA_PODF << 16)
orr r1, r1, #(CONFIG_SYS_AXIB_PODF << 19)
str r1, [r0, #CLKCTL_CBCDR]
ldr r1, CCM_VAL_0x00016154
str r1, [r0, #CLKCTL_CBCMR]
/*change uart clk parent to pll2*/
ldr r1, [r0, #CLKCTL_CSCMR1]
and r1, r1, #0xfcffffff
orr r1, r1, #0x01000000
str r1, [r0, #CLKCTL_CSCMR1]
/* make sure change is effective */
1: ldr r1, [r0, #CLKCTL_CDHIPR]
cmp r1, #0x0
bne 1b
setup_pll PLL3_BASE_ADDR, 216
setup_pll PLL4_BASE_ADDR, 455
/* Set the platform clock dividers */
ldr r0, PLATFORM_BASE_ADDR_W
ldr r1, PLATFORM_CLOCK_DIV_W
str r1, [r0, #PLATFORM_ICGC]
ldr r0, CCM_BASE_ADDR_W
mov r1, #1
str r1, [r0, #CLKCTL_CACRR]
/* Switch ARM back to PLL 1. */
mov r1, #0x0
str r1, [r0, #CLKCTL_CCSR]
/* make uart div=6*/
ldr r1, [r0, #CLKCTL_CSCDR1]
and r1, r1, #0xffffffc0
orr r1, r1, #0x0a
str r1, [r0, #CLKCTL_CSCDR1]
/* Restore the default values in the Gate registers */
ldr r1, =0xFFFFFFFF
str r1, [r0, #CLKCTL_CCGR0]
str r1, [r0, #CLKCTL_CCGR1]
str r1, [r0, #CLKCTL_CCGR2]
str r1, [r0, #CLKCTL_CCGR3]
str r1, [r0, #CLKCTL_CCGR4]
str r1, [r0, #CLKCTL_CCGR5]
str r1, [r0, #CLKCTL_CCGR6]
str r1, [r0, #CLKCTL_CCGR7]
mov r1, #0x00000
str r1, [r0, #CLKCTL_CCDR]
/* for cko - for ARM div by 8 */
mov r1, #0x000A0000
add r1, r1, #0x00000F0
str r1, [r0, #CLKCTL_CCOSR]
.endm
.section ".text.init", "x"
.globl lowlevel_init
lowlevel_init:
#ifdef ENABLE_IMPRECISE_ABORT
mrs r1, spsr /* save old spsr */
mrs r0, cpsr /* read out the cpsr */
bic r0, r0, #0x100 /* clear the A bit */
msr spsr, r0 /* update spsr */
add lr, pc, #0x8 /* update lr */
movs pc, lr /* update cpsr */
nop
nop
nop
nop
msr spsr, r1 /* restore old spsr */
#endif
/* ARM errata ID #468414 */
mrc 15, 0, r1, c1, c0, 1
orr r1, r1, #(1 << 5) /* enable L1NEON bit */
mcr 15, 0, r1, c1, c0, 1
init_l2cc
init_aips
#ifdef CONFIG_ADJUST_WIFI_FEC_PERFORMANCE
/*increase WIFI & FEC priority of accessing bus*/
init_m4if
#endif
init_clock
mov pc, lr
/* Board level setting value */
CCM_BASE_ADDR_W: .word CCM_BASE_ADDR
CCM_VAL_0x00016154: .word 0x00016154
CCM_VAL_0x00808145: .word 0x00808145
CCM_VAL_0x00015154: .word 0x00015154
CCM_VAL_0x02888945: .word 0x02888945
W_DP_OP_800: .word DP_OP_800
W_DP_MFD_800: .word DP_MFD_800
W_DP_MFN_800: .word DP_MFN_800
W_DP_OP_600: .word DP_OP_600
W_DP_MFD_600: .word DP_MFD_600
W_DP_MFN_600: .word DP_MFN_600
W_DP_OP_400: .word DP_OP_400
W_DP_MFD_400: .word DP_MFD_400
W_DP_MFN_400: .word DP_MFN_400
W_DP_OP_216: .word DP_OP_216
W_DP_MFD_216: .word DP_MFD_216
W_DP_MFN_216: .word DP_MFN_216
W_DP_OP_455: .word DP_OP_455
W_DP_MFD_455: .word DP_MFD_455
W_DP_MFN_455: .word DP_MFN_455
PLATFORM_BASE_ADDR_W: .word ARM_BASE_ADDR
PLATFORM_CLOCK_DIV_W: .word 0x00000124

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,74 @@
/*
* January 2004 - Changed to support H4 device
* Copyright (c) 2004 Texas Instruments
*
* (C) Copyright 2002
* Gary Jennejohn, DENX Software Engineering, <gj@denx.de>
*
* (C) Copyright 2010 Freescale Semiconductor, Inc.
*
* See file CREDITS for list of people who contributed to this
* project.
*
* 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.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
*/
OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
OUTPUT_ARCH(arm)
ENTRY(_start)
SECTIONS
{
. = 0x00000000;
. = ALIGN(4);
.text :
{
/* WARNING - the following is hand-optimized to fit within */
/* the sector layout of our flash chips! XXX FIXME XXX */
board/freescale/mx53_evk/flash_header.o (.text.flasheader)
cpu/arm_cortexa8/start.o
board/freescale/mx53_evk/libmx53_evk.a (.text)
lib_arm/libarm.a (.text)
net/libnet.a (.text)
drivers/mtd/libmtd.a (.text)
drivers/mmc/libmmc.a (.text)
. = DEFINED(env_offset) ? env_offset : .;
common/env_embedded.o(.text)
*(.text)
}
. = ALIGN(4);
.rodata : { *(.rodata) }
. = ALIGN(4);
.data : { *(.data) }
. = ALIGN(4);
.got : { *(.got) }
. = .;
__u_boot_cmd_start = .;
.u_boot_cmd : { *(.u_boot_cmd) }
__u_boot_cmd_end = .;
. = ALIGN(4);
_end_of_copy = .; /* end_of ROM copy code here */
__bss_start = .;
.bss : { *(.bss) }
_end = .;
}

View File

@ -0,0 +1,47 @@
#
# (C) Copyright 2010 Freescale Semiconductor, Inc.
#
# 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.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
# MA 02111-1307 USA
#
include $(TOPDIR)/config.mk
LIB = $(obj)lib$(BOARD).a
COBJS := mx53_loco.o
SOBJS := lowlevel_init.o flash_header.o
SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c)
OBJS := $(addprefix $(obj),$(COBJS))
SOBJS := $(addprefix $(obj),$(SOBJS))
$(LIB): $(obj).depend $(OBJS) $(SOBJS)
$(AR) $(ARFLAGS) $@ $(OBJS) $(SOBJS)
clean:
rm -f $(SOBJS) $(OBJS)
distclean: clean
rm -f $(LIB) core *.bak .depend
#########################################################################
# defines $(obj).depend target
include $(SRCTREE)/rules.mk
sinclude $(obj).depend
#########################################################################

View File

@ -0,0 +1,3 @@
LDSCRIPT := $(SRCTREE)/board/$(VENDOR)/$(BOARD)/u-boot.lds
TEXT_BASE = 0x77800000

View File

@ -0,0 +1,230 @@
/*
* Copyright (C) 2010-2011 Freescale Semiconductor, Inc.
*
* 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.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
*/
#include <config.h>
#include <asm/arch/mx53.h>
#define REG_LD_AND_STR_INIT(base) \
ldr r0, =base;
#define REG_LD_AND_STR_OP(i, offset, val) \
ldr r1, =val; \
ldr r2, =offset; \
str r1, [r0, r2];
#define REG_LD_AND_STR_END(base)
#ifdef CONFIG_FLASH_HEADER
#ifndef CONFIG_FLASH_HEADER_OFFSET
# error "Must define the offset of flash header"
#endif
.section ".text.flasheader", "x"
b _start
.org CONFIG_FLASH_HEADER_OFFSET
ivt_header: .long 0x402000D1/* Tag=0xD1, Len=0x0020, Ver=0x40 */
app_code_jump_v: .long (0xF8006000 + (plugin_start - TEXT_BASE))
reserv1: .long 0x0
dcd_ptr: .long 0x0
boot_data_ptr: .long (0xF8006000 + (boot_data - TEXT_BASE))
self_ptr: .long (0xF8006000 + (ivt_header - TEXT_BASE))
app_code_csf: .long 0x0
reserv2: .long 0x0
boot_data: .long 0xF8006000
image_len: .long (3 * 1024)
plugin: .long 0x1
/* Second IVT to give entry point into the bootloader copied to DDR */
ivt2_header: .long 0x402000D1/*Tag=0xD1, Len=0x0020, Ver=0x40 */
app2_code_jump_v: .long _start /* Entry point for the bootloader */
reserv3: .long 0x0
dcd2_ptr: .long 0x0
boot_data2_ptr: .long boot_data2
self_ptr2: .long ivt2_header
app_code_csf2: .long 0x0
reserv4: .long 0x0
boot_data2: .long TEXT_BASE
image_len2: .long _end_of_copy - TEXT_BASE + CONFIG_FLASH_HEADER_OFFSET
plugin2: .long 0x0
/* Here starts the plugin code */
plugin_start:
/* Save the return address and the function arguments */
push {r0-r6, lr}
/* We should distinguish USB recovery mode(SDP mode) and internal boot mode.
If ROM runs in SDP mode, then it needn't load boot code from storage media.
If ROM runs in SDP mode, then r0 must be 0x00
If ROM runs in internal boot mode, then r0 should be larger than IRAM base address. */
mov r7, r0
/* IOMUX */
REG_LD_AND_STR_INIT(IOMUXC_BASE_ADDR)
REG_LD_AND_STR_OP(1, 0x554, 0x00300000)
REG_LD_AND_STR_OP(2, 0x558, 0x00300040)
REG_LD_AND_STR_OP(3, 0x560, 0x00300000)
REG_LD_AND_STR_OP(4, 0x564, 0x00300040)
REG_LD_AND_STR_OP(5, 0x568, 0x00300040)
REG_LD_AND_STR_OP(6, 0x570, 0x00300000)
REG_LD_AND_STR_OP(7, 0x574, 0x00300000)
REG_LD_AND_STR_OP(8, 0x578, 0x00300000)
REG_LD_AND_STR_OP(9, 0x57c, 0x00300040)
REG_LD_AND_STR_OP(10, 0x580, 0x00300040)
REG_LD_AND_STR_OP(11, 0x584, 0x00300000)
REG_LD_AND_STR_OP(12, 0x588, 0x00300000)
REG_LD_AND_STR_OP(13, 0x590, 0x00300040)
REG_LD_AND_STR_OP(14, 0x594, 0x00300000)
REG_LD_AND_STR_OP(15, 0x6f0, 0x00300000)
REG_LD_AND_STR_OP(16, 0x6f4, 0x00000000)
REG_LD_AND_STR_OP(17, 0x6fc, 0x00000000)
REG_LD_AND_STR_OP(18, 0x714, 0x00000000)
REG_LD_AND_STR_OP(19, 0x718, 0x00300000)
REG_LD_AND_STR_OP(20, 0x71c, 0x00300000)
REG_LD_AND_STR_OP(21, 0x720, 0x00300000)
REG_LD_AND_STR_OP(22, 0x724, 0x04000000)
REG_LD_AND_STR_OP(23, 0x728, 0x00300000)
REG_LD_AND_STR_OP(24, 0x72c, 0x00300000)
REG_LD_AND_STR_END(IOMUXC_BASE_ADDR)
/* ESDCTL */
REG_LD_AND_STR_INIT(ESDCTL_BASE_ADDR)
REG_LD_AND_STR_OP(25, 0x088, 0x35343535)
REG_LD_AND_STR_OP(26, 0x090, 0x4d444c44)
REG_LD_AND_STR_OP(27, 0x07c, 0x01370138)
REG_LD_AND_STR_OP(28, 0x080, 0x013b013c)
REG_LD_AND_STR_OP(29, 0x0f8, 0x00000800)
REG_LD_AND_STR_OP(30, 0x018, 0x00001740)
REG_LD_AND_STR_OP(31, 0x000, 0xc3190000)
REG_LD_AND_STR_OP(32, 0x00c, 0x9f5152e3)
REG_LD_AND_STR_OP(33, 0x010, 0xb68e8a63)
REG_LD_AND_STR_OP(34, 0x014, 0x01ff00db)
REG_LD_AND_STR_OP(35, 0x02c, 0x000026d2)
REG_LD_AND_STR_OP(36, 0x030, 0x009f0e21)
REG_LD_AND_STR_OP(37, 0x008, 0x12273030)
REG_LD_AND_STR_OP(38, 0x004, 0x0002002d)
REG_LD_AND_STR_OP(39, 0x01c, 0x00008032)
REG_LD_AND_STR_OP(40, 0x01c, 0x00008033)
REG_LD_AND_STR_OP(41, 0x01c, 0x00028031)
REG_LD_AND_STR_OP(42, 0x01c, 0x052080b0)
REG_LD_AND_STR_OP(43, 0x01c, 0x04008040)
REG_LD_AND_STR_OP(44, 0x01c, 0x0000803a)
REG_LD_AND_STR_OP(45, 0x01c, 0x0000803b)
REG_LD_AND_STR_OP(46, 0x01c, 0x00028039)
REG_LD_AND_STR_OP(47, 0x01c, 0x05208138)
REG_LD_AND_STR_OP(48, 0x01c, 0x04008048)
REG_LD_AND_STR_OP(49, 0x020, 0x00005800)
REG_LD_AND_STR_OP(50, 0x040, 0x04b80003)
REG_LD_AND_STR_OP(51, 0x058, 0x00022227)
REG_LD_AND_STR_OP(52, 0x01C, 0x00000000)
REG_LD_AND_STR_END(ESDCTL_BASE_ADDR)
/*
* The following is to fill in those arguments for this ROM function
* pu_irom_hwcnfg_setup(void **start, size_t *bytes, const void *boot_data)
*
* This function is used to copy data from the storage media into DDR.
*
* start - Initial (possibly partial) image load address on entry. Final image
* load address on exit.
* bytes - Initial (possibly partial) image size on entry. Final image size on
* exit.
* boot_data - Initial @ref ivt Boot Data load address.
*/
adr r0, DDR_DEST_ADDR
adr r1, COPY_SIZE
adr r2, BOOT_DATA
before_calling_rom___pu_irom_hwcnfg_setup:
/* We should distinguish USB recovery mode(SDP mode) and internal boot mode.
If ROM runs in SDP mode, then it needn't load boot code from storage media.
If ROM runs in SDP mode, then r0 must be 0x00
If ROM runs in internal boot mode, then r0 should be larger than IRAM base address. */
cmp r7, #0xF8000000
bls return_sdp
/* Different ROM address for TO 1.0 & TO 2.0 */
ldr r3, =ROM_SI_REV
ldr r4, [r3]
cmp r4, #0x21
/* TO2.1 */
moveq r6, #0x1800
addeq r6, r6, #0x4d
beq 2f
cmp r4, #0x20
/* TO2 */
moveq r6, #0x1800
addeq r6, r6, #0x4d
beq 2f
/* TO1 */
mov r6, #0x400000
add r6, r6, #0x5000
add r6, r6, #0xc7
2:
blx r6 /* This address might change in future ROM versions */
after_calling_rom___pu_irom_hwcnfg_setup:
return_sdp:
cmp r7, #0xF8000000
bhi quit_plugin
/* Workaround run plug-ins in SDP mode without USB re-enumeration.
how it works:
ROM running in usb download mode.
Host manufacturing application sends SDP command to download plug-in image.
Host manufacturing application sends SDP command to jump to plug-in image and run it.
Plug-in starts execution and after its regular tasks plug-in will then call into ROM
call into pl_parse_and_handle() */
ldr r3, =ROM_SI_REV
ldr r5, [r3]
cmp r5, #0x20 /* check silicon revision to determine the function entry address */
ldrlt r4, =0x00000edd /* function entry in TO1 ROM */
ldrge r4, =0x0040487d /* function entry in TO2 ROM */
blx r4
/* To return to ROM from plugin, we need to fill in these argument.
* Here is what need to do:
* Need to construct the paramters for this function before return to ROM:
* plugin_download(void **start, size_t *bytes, UINT32 *ivt_offset)
*/
quit_plugin:
pop {r0-r6, lr}
ldr r7, DDR_DEST_ADDR
str r7, [r0]
ldr r7, COPY_SIZE
str r7, [r1]
mov r7, #0x400 /* Point to the second IVT table at offset 0x42C */
add r7, r7, #0x2C
str r7, [r2]
mov r0, #1
bx lr /* return back to ROM code */
DDR_DEST_ADDR: .word TEXT_BASE
COPY_SIZE: .word _end - TEXT_BASE
BOOT_DATA: .word TEXT_BASE
.word _end - TEXT_BASE
.word 0
#endif

View File

@ -0,0 +1,372 @@
/*
* Copyright (C) 2010-2011 Freescale Semiconductor, Inc.
*
* 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.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
*/
#include <config.h>
#include <asm/arch/mx53.h>
/*
* L2CC Cache setup/invalidation/disable
*/
.macro init_l2cc
/* explicitly disable L2 cache */
mrc 15, 0, r0, c1, c0, 1
bic r0, r0, #0x2
mcr 15, 0, r0, c1, c0, 1
/* reconfigure L2 cache aux control reg */
mov r0, #0xC0 /* tag RAM */
add r0, r0, #0x4 /* data RAM */
orr r0, r0, #(1 << 24) /* disable write allocate delay */
orr r0, r0, #(1 << 23) /* disable write allocate combine */
orr r0, r0, #(1 << 22) /* disable write allocate */
mcr 15, 1, r0, c9, c0, 2
.endm /* init_l2cc */
/* AIPS setup - Only setup MPROTx registers.
* The PACR default values are good.*/
.macro init_aips
/*
* Set all MPROTx to be non-bufferable, trusted for R/W,
* not forced to user-mode.
*/
ldr r0, =AIPS1_BASE_ADDR
ldr r1, =0x77777777
str r1, [r0, #0x0]
str r1, [r0, #0x4]
ldr r0, =AIPS2_BASE_ADDR
str r1, [r0, #0x0]
str r1, [r0, #0x4]
.endm /* init_aips */
.macro setup_pll pll, freq
/*
* If freq < 300MHz, we need to set dpdck0_2_en to 0
*/
ldr r0, =\freq
ldr r1, =0x300
cmp r0, r1
ldrcs r1, =0x00001232
ldrcc r1, =0x00000232
ldr r0, =\pll
str r1, [r0, #PLL_DP_CTL]
mov r1, #0x2
str r1, [r0, #PLL_DP_CONFIG]
ldr r1, W_DP_OP_\freq
str r1, [r0, #PLL_DP_OP]
str r1, [r0, #PLL_DP_HFS_OP]
ldr r1, W_DP_MFD_\freq
str r1, [r0, #PLL_DP_MFD]
str r1, [r0, #PLL_DP_HFS_MFD]
ldr r1, W_DP_MFN_\freq
str r1, [r0, #PLL_DP_MFN]
str r1, [r0, #PLL_DP_HFS_MFN]
ldr r1, =0x00001232
str r1, [r0, #PLL_DP_CTL]
1: ldr r1, [r0, #PLL_DP_CTL]
ands r1, r1, #0x1
beq 1b
.endm
.macro init_m4if
/*increase master2 priority for WIFI*/
ldr r0, =M4IF_BASE_ADDR
ldr r1, [r0, #0x40]
orr r1, r1, #(0x33 << 16)
str r1, [r0, #0x40]
/*increase master4 priority for FEC*/
ldr r1, [r0, #0x44]
orr r1, r1, #0x33
str r1, [r0, #0x44]
/*set SDHC-port3 high priority to all AHB MAX Slave port*/
ldr r0, =AHBMAX_BASE_ADDR
#ifdef CONFIG_WIFI_SDHC_PORT3
/*set PARK to SDHC-port3*/
ldr r0, =AHBMAX_BASE_ADDR
ldr r1, [r0, #0x10]
bic r1, r1, #(0x7 << 0)
orr r1, r1, #0x3
bic r1, r1, #(0x3 << 4)
bic r1, r1, #(0x3 << 8)
orr r1, r1, #(0x1 << 30)
bic r1, r1, #(0x1 << 31)
ldr r1, [r0, #0x110]
bic r1, r1, #(0x7 << 0)
orr r1, r1, #0x3
bic r1, r1, #(0x3 << 4)
bic r1, r1, #(0x3 << 8)
orr r1, r1, #(0x1 << 30)
bic r1, r1, #(0x1 << 31)
ldr r1, [r0, #0x210]
bic r1, r1, #(0x7 << 0)
orr r1, r1, #0x3
bic r1, r1, #(0x3 << 4)
bic r1, r1, #(0x3 << 8)
orr r1, r1, #(0x1 << 30)
bic r1, r1, #(0x1 << 31)
ldr r1, [r0, #0x310]
bic r1, r1, #(0x7 << 0)
orr r1, r1, #0x3
bic r1, r1, #(0x3 << 4)
bic r1, r1, #(0x3 << 8)
orr r1, r1, #(0x1 << 30)
bic r1, r1, #(0x1 << 31)
/*set SDHC-port3 arbitration*/
ldr r0, =AHBMAX_BASE_ADDR
ldr r1, [r0, #0xb00]
bic r1, r1, #(0x7 << 0)
orr r1, r1, #0x1
#endif
#ifdef CONFIG_WIFI_SDHC_PORT2
/*set PARK to SDHC-port3*/
ldr r0, =AHBMAX_BASE_ADDR
ldr r1, [r0, #0x10]
bic r1, r1, #(0x7 << 0)
orr r1, r1, #0x2
bic r1, r1, #(0x3 << 4)
bic r1, r1, #(0x3 << 8)
orr r1, r1, #(0x1 << 30)
bic r1, r1, #(0x1 << 31)
ldr r1, [r0, #0x110]
bic r1, r1, #(0x7 << 0)
orr r1, r1, #0x2
bic r1, r1, #(0x3 << 4)
bic r1, r1, #(0x3 << 8)
orr r1, r1, #(0x1 << 30)
bic r1, r1, #(0x1 << 31)
ldr r1, [r0, #0x210]
bic r1, r1, #(0x7 << 0)
orr r1, r1, #0x2
bic r1, r1, #(0x3 << 4)
bic r1, r1, #(0x3 << 8)
orr r1, r1, #(0x1 << 30)
bic r1, r1, #(0x1 << 31)
ldr r1, [r0, #0x310]
bic r1, r1, #(0x7 << 0)
orr r1, r1, #0x2
bic r1, r1, #(0x3 << 4)
bic r1, r1, #(0x3 << 8)
orr r1, r1, #(0x1 << 30)
bic r1, r1, #(0x1 << 31)
/*set SDHC-port2 arbitration*/
ldr r0, =AHBMAX_BASE_ADDR
ldr r1, [r0, #0xA00]
bic r1, r1, #(0x7 << 0)
#endif
/*set JMP step to zero*/
ldr r0, =M4IF_BASE_ADDR
ldr r1, [r0, #0x48]
bic r1, r1, #(0x3 << 8)
str r1, [r0, #0x48]
.endm
.macro init_clock
ldr r0, =ROM_SI_REV
ldr r1, [r0]
cmp r1, #0x20
/* For TO2 only, set LDO to 1.3V */
ldr r0, =0x53fa8000
ldr r1, =0x00194005
streq r1, [r0, #0x04]
ldr r0, CCM_BASE_ADDR_W
/* Gate of clocks to the peripherals first */
ldr r1, =0x3FFFFFFF
str r1, [r0, #CLKCTL_CCGR0]
ldr r1, =0x0
str r1, [r0, #CLKCTL_CCGR1]
str r1, [r0, #CLKCTL_CCGR2]
str r1, [r0, #CLKCTL_CCGR3]
str r1, [r0, #CLKCTL_CCGR7]
ldr r1, =0x00030000
str r1, [r0, #CLKCTL_CCGR4]
ldr r1, =0x00FFF030
str r1, [r0, #CLKCTL_CCGR5]
ldr r1, =0x0F00030F
str r1, [r0, #CLKCTL_CCGR6]
/* Switch ARM to step clock */
mov r1, #0x4
str r1, [r0, #CLKCTL_CCSR]
setup_pll PLL1_BASE_ADDR, 800
setup_pll PLL3_BASE_ADDR, 400
/* Switch peripheral to PLL3 */
ldr r0, CCM_BASE_ADDR_W
ldr r1, CCM_VAL_0x00015154
str r1, [r0, #CLKCTL_CBCMR]
ldr r1, CCM_VAL_0x02888945
orr r1, r1, #(1 << 16)
str r1, [r0, #CLKCTL_CBCDR]
/* make sure change is effective */
1: ldr r1, [r0, #CLKCTL_CDHIPR]
cmp r1, #0x0
bne 1b
setup_pll PLL2_BASE_ADDR, CONFIG_SYS_PLL2_FREQ
/* Switch peripheral to PLL2 */
ldr r0, CCM_BASE_ADDR_W
ldr r1, CCM_VAL_0x00808145
orr r1, r1, #(CONFIG_SYS_AHB_PODF << 10)
orr r1, r1, #(CONFIG_SYS_AXIA_PODF << 16)
orr r1, r1, #(CONFIG_SYS_AXIB_PODF << 19)
str r1, [r0, #CLKCTL_CBCDR]
ldr r1, CCM_VAL_0x00016154
str r1, [r0, #CLKCTL_CBCMR]
/*change uart clk parent to pll2*/
ldr r1, [r0, #CLKCTL_CSCMR1]
and r1, r1, #0xfcffffff
orr r1, r1, #0x01000000
str r1, [r0, #CLKCTL_CSCMR1]
/* make sure change is effective */
1: ldr r1, [r0, #CLKCTL_CDHIPR]
cmp r1, #0x0
bne 1b
setup_pll PLL3_BASE_ADDR, 216
setup_pll PLL4_BASE_ADDR, 455
/* Set the platform clock dividers */
ldr r0, PLATFORM_BASE_ADDR_W
ldr r1, PLATFORM_CLOCK_DIV_W
str r1, [r0, #PLATFORM_ICGC]
ldr r0, CCM_BASE_ADDR_W
mov r1, #0
str r1, [r0, #CLKCTL_CACRR]
/* Switch ARM back to PLL 1. */
mov r1, #0x0
str r1, [r0, #CLKCTL_CCSR]
/* make uart div=6*/
ldr r1, [r0, #CLKCTL_CSCDR1]
and r1, r1, #0xffffffc0
orr r1, r1, #0x0a
str r1, [r0, #CLKCTL_CSCDR1]
/* Restore the default values in the Gate registers */
ldr r1, =0xFFFFFFFF
str r1, [r0, #CLKCTL_CCGR0]
str r1, [r0, #CLKCTL_CCGR1]
str r1, [r0, #CLKCTL_CCGR2]
str r1, [r0, #CLKCTL_CCGR3]
str r1, [r0, #CLKCTL_CCGR4]
str r1, [r0, #CLKCTL_CCGR5]
str r1, [r0, #CLKCTL_CCGR6]
str r1, [r0, #CLKCTL_CCGR7]
mov r1, #0x00000
str r1, [r0, #CLKCTL_CCDR]
/* for cko - for ARM div by 8 */
mov r1, #0x000A0000
add r1, r1, #0x00000F0
str r1, [r0, #CLKCTL_CCOSR]
.endm
.section ".text.init", "x"
.globl lowlevel_init
lowlevel_init:
#ifdef ENABLE_IMPRECISE_ABORT
mrs r1, spsr /* save old spsr */
mrs r0, cpsr /* read out the cpsr */
bic r0, r0, #0x100 /* clear the A bit */
msr spsr, r0 /* update spsr */
add lr, pc, #0x8 /* update lr */
movs pc, lr /* update cpsr */
nop
nop
nop
nop
msr spsr, r1 /* restore old spsr */
#endif
/* ARM errata ID #468414 */
mrc 15, 0, r1, c1, c0, 1
orr r1, r1, #(1 << 5) /* enable L1NEON bit */
mcr 15, 0, r1, c1, c0, 1
init_l2cc
init_aips
#ifdef CONFIG_ADJUST_WIFI_FEC_PERFORMANCE
/*increase WIFI & FEC priority of accessing bus*/
init_m4if
#endif
init_clock
mov pc, lr
/* Board level setting value */
CCM_BASE_ADDR_W: .word CCM_BASE_ADDR
CCM_VAL_0x00016154: .word 0x00016154
CCM_VAL_0x00808145: .word 0x00808145
CCM_VAL_0x00015154: .word 0x00015154
CCM_VAL_0x02888945: .word 0x02888945
W_DP_OP_1000: .word DP_OP_1000
W_DP_MFD_1000: .word DP_MFD_1000
W_DP_MFN_1000: .word DP_MFN_1000
W_DP_OP_800: .word DP_OP_800
W_DP_MFD_800: .word DP_MFD_800
W_DP_MFN_800: .word DP_MFN_800
W_DP_OP_600: .word DP_OP_600
W_DP_MFD_600: .word DP_MFD_600
W_DP_MFN_600: .word DP_MFN_600
W_DP_OP_400: .word DP_OP_400
W_DP_MFD_400: .word DP_MFD_400
W_DP_MFN_400: .word DP_MFN_400
W_DP_OP_216: .word DP_OP_216
W_DP_MFD_216: .word DP_MFD_216
W_DP_MFN_216: .word DP_MFN_216
W_DP_OP_455: .word DP_OP_455
W_DP_MFD_455: .word DP_MFD_455
W_DP_MFN_455: .word DP_MFN_455
PLATFORM_BASE_ADDR_W: .word ARM_BASE_ADDR
PLATFORM_CLOCK_DIV_W: .word 0x00000124

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,68 @@
/*
* (C) Copyright 2010 Freescale Semiconductor, Inc.
*
* See file CREDITS for list of people who contributed to this
* project.
*
* 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.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
*/
OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
OUTPUT_ARCH(arm)
ENTRY(_start)
SECTIONS
{
. = 0x00000000;
. = ALIGN(4);
.text :
{
/* WARNING - the following is hand-optimized to fit within */
/* the sector layout of our flash chips! XXX FIXME XXX */
board/freescale/mx53_loco/flash_header.o (.text.flasheader)
cpu/arm_cortexa8/start.o
board/freescale/mx53_loco/libmx53_loco.a (.text)
lib_arm/libarm.a (.text)
net/libnet.a (.text)
drivers/mtd/libmtd.a (.text)
drivers/mmc/libmmc.a (.text)
. = DEFINED(env_offset) ? env_offset : .;
common/env_embedded.o(.text)
*(.text)
}
. = ALIGN(4);
.rodata : { *(.rodata) }
. = ALIGN(4);
.data : { *(.data) }
. = ALIGN(4);
.got : { *(.got) }
. = .;
__u_boot_cmd_start = .;
.u_boot_cmd : { *(.u_boot_cmd) }
__u_boot_cmd_end = .;
. = ALIGN(4);
_end_of_copy = .; /* end_of ROM copy code here */
__bss_start = .;
.bss : { *(.bss) }
_end = .;
}

View File

@ -0,0 +1,47 @@
#
# (C) Copyright 2011 Freescale Semiconductor, Inc.
#
# 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.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
# MA 02111-1307 USA
#
include $(TOPDIR)/config.mk
LIB = $(obj)lib$(BOARD).a
COBJS := mx53_pcba.o
SOBJS := lowlevel_init.o flash_header.o
SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c)
OBJS := $(addprefix $(obj),$(COBJS))
SOBJS := $(addprefix $(obj),$(SOBJS))
$(LIB): $(obj).depend $(OBJS) $(SOBJS)
$(AR) $(ARFLAGS) $@ $(OBJS) $(SOBJS)
clean:
rm -f $(SOBJS) $(OBJS)
distclean: clean
rm -f $(LIB) core *.bak .depend
#########################################################################
# defines $(obj).depend target
include $(SRCTREE)/rules.mk
sinclude $(obj).depend
#########################################################################

View File

@ -0,0 +1,3 @@
LDSCRIPT := $(SRCTREE)/board/$(VENDOR)/$(BOARD)/u-boot.lds
TEXT_BASE = 0x77800000

View File

@ -0,0 +1,674 @@
/*
* Copyright (C) 2010-2011 Freescale Semiconductor, Inc.
*
* 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.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
*/
#include <config.h>
#include <asm/arch/mx53.h>
#ifdef CONFIG_FLASH_HEADER
#ifndef CONFIG_FLASH_HEADER_OFFSET
# error "Must define the offset of flash header"
#endif
.section ".text.flasheader", "x"
b _start
.org CONFIG_FLASH_HEADER_OFFSET
ivt_header: .long 0x402000D1 /* Tag=0xD1, Len=0x0020, Ver=0x40 */
app_code_jump_v: .long (0xF8006000 + (plugin_start - TEXT_BASE))
reserv1: .long 0x0
dcd_ptr: .long 0x0
boot_data_ptr: .long (0xF8006000 + (boot_data - TEXT_BASE))
self_ptr: .long (0xF8006000 + (ivt_header - TEXT_BASE))
app_code_csf: .long 0x0
reserv2: .long 0x0
boot_data: .long 0xF8006000
image_len: .long 4*1024
plugin: .long 0x1
/* Second IVT to give entry point into the bootloader copied to DDR */
ivt2_header: .long 0x402000D1 /*Tag=0xD1, Len=0x0020, Ver=0x40 */
app2_code_jump_v: .long _start /* Entry point for the bootloader */
reserv3: .long 0x0
dcd2_ptr: .long 0x0
boot_data2_ptr: .long boot_data2
self_ptr2: .long ivt2_header
app_code_csf2: .long 0x0
reserv4: .long 0x0
boot_data2: .long TEXT_BASE
image_len2: .long _end - TEXT_BASE
plugin2: .long 0x0
/* Here starts the plugin code */
plugin_start:
/* Save the return address and the function arguments */
push {r0-r6, lr}
/* We should distinguish USB recovery mode(SDP mode) and internal boot mode.
If ROM runs in SDP mode, then it needn't load boot code from storage media.
If ROM runs in SDP mode, then r0 must be 0x00
If ROM runs in internal boot mode, then r0 should be larger than IRAM base address. */
mov r7, r0
/* DDR3 script for SMD and ARM2 CPU3 board */
/* IOMUX Setup */
ldr r0, =0x53fa8500
mov r1, #0x00300000
add r2, r1, #0x40
str r1, [r0, #0x54]
str r2, [r0, #0x58]
str r1, [r0, #0x60]
str r2, [r0, #0x64]
str r2, [r0, #0x68]
str r1, [r0, #0x70]
str r1, [r0, #0x74]
str r1, [r0, #0x78]
str r2, [r0, #0x7c]
str r2, [r0, #0x80]
str r1, [r0, #0x84]
str r1, [r0, #0x88]
str r2, [r0, #0x90]
str r1, [r0, #0x94]
ldr r0, =0x53fa8600
str r1, [r0, #0xf0]
mov r2, #0x00000000
str r2, [r0, #0xf4]
str r2, [r0, #0xfc]
ldr r0, =0x53fa8700
str r2, [r0, #0x14]
str r1, [r0, #0x18]
str r1, [r0, #0x1c]
str r1, [r0, #0x20]
mov r2, #0x04000000
str r2, [r0, #0x24]
str r1, [r0, #0x28]
str r1, [r0, #0x2c]
/* Initialize DDR3 memory for calibration */
ldr r0, =ESDCTL_BASE_ADDR
ldr r1, =0x01340135
str r1, [r0, #0x07c]
ldr r1, =0x01390139
str r1, [r0, #0x080]
ldr r1, =0x35343534
str r1, [r0, #0x088]
ldr r1, =0x4f485146
str r1, [r0, #0x090]
ldr r1, =0x00000800
str r1, [r0, #0xf8]
ldr r1, =0x00011740
str r1, [r0, #0x018]
ldr r1, =0xc3190000
str r1, [r0, #0x00]
ldr r1, =0x9f515333
str r1, [r0, #0x0C]
ldr r1, =0xb68e8a63
str r1, [r0, #0x10]
ldr r1, =0x01ff00db
str r1, [r0, #0x14]
ldr r1, =0x000026d2
str r1, [r0, #0x2C]
ldr r1, =0x009f0e21
str r1, [r0, #0x30]
ldr r1, =0x12373030
str r1, [r0, #0x08]
ldr r1, =0x4402002d
str r1, [r0, #0x04]
ldr r1, =0x00008032
str r1, [r0, #0x1C]
ldr r1, =0x00008033
str r1, [r0, #0x1C]
ldr r1, =0x00028031
str r1, [r0, #0x1C]
ldr r1, =0x092080b0
str r1, [r0, #0x1C]
ldr r1, =0x04008040
str r1, [r0, #0x1C]
ldr r1, =0x0000803a
str r1, [r0, #0x1C]
ldr r1, =0x0000803b
str r1, [r0, #0x1C]
ldr r1, =0x00028039
str r1, [r0, #0x1C]
ldr r1, =0x09208138
str r1, [r0, #0x1C]
ldr r1, =0x04008048
str r1, [r0, #0x1C]
ldr r1, =0x00001800
str r1, [r0, #0x20]
// ldr r1, =0x04b80003
ldr r1, =0x04b90003
str r1, [r0, #0x40]
ldr r1, =0x00022227
str r1, [r0, #0x58]
ldr r1, =0x00000000
str r1, [r0, #0x1C]
ldr r6, =0x0
retry:
add r6, r6, #0x1
//delay
ldr r1, =0x0
100:
nop
add r1, r1, #0x1
cmp r1, #0x200
bne 100b
/* DQS calibration */
ldr r3, =0x55aaaa55
ldr r4, =0x55555555
ldr r5, =0xAAAAAAAA
str r3, [r0, #0x0cc]
ldr r1, =0x0
ldr r2, =0x0
110:
ldr r0, =CSD0_BASE_ADDR
add r0, r0, #0x10000000
add r0, r0, r2
str r4, [r0, #0x000]
str r5, [r0, #0x004]
str r5, [r0, #0x008]
str r4, [r0, #0x00c]
add r2, r2, #0x10
add r1, r1, #0x1
cmp r1, #0x4
bne 110b
ldr r0, =ESDCTL_BASE_ADDR
ldr r1, [r0, #0x07c]
orr r1, r1, #(1 << 30)
str r1, [r0, #0x07c]
ldr r1, [r0, #0x07c]
orr r1, r1, #(1 << 28)
str r1, [r0, #0x07c]
// check for DQS calibration complete
120:
ldr r1, [r0, #0x07c]
mov r2, #0x00000000
orr r2, r2, #(1 << 28)
and r2, r1, r2
cmp r2, #0x0
bne 120b
// check for calibration error
mov r2, #0x00000000
orr r2, r2, #(1 << 12)
and r2, r1, r2
cmp r2, #0x0
beq 130f
ldr r0, =WDOG1_BASE_ADDR
ldr r1, =0x0033
strh r1, [r0, #0x00]
ldr r1, =0x0037
strh r1, [r0, #0x00]
ldr r1, =0x5555
strh r1, [r0, #0x02]
ldr r1, =0xaaaa
strh r1, [r0, #0x02]
// bne retry
130:
/* Reset */
ldr r1, [r0, #0x07c]
orr r1, r1, #(1 << 31)
str r1, [r0, #0x07c]
140:
ldr r1, [r0, #0x07c]
mov r2, #0x00000000
orr r2, r2, #(1 << 31)
and r1, r1, r2
cmp r1, #0x0
bne 140b
ldr r2, =CSD0_BASE_ADDR
add r2, r2, #0x1100000
ldr r3, =0xf0f0f0f0
ldr r4, =0xc3c3c3c3
str r3, [r2, #0x000]
str r4, [r2, #0x004]
ldr r3, [r2, #0x000]
ldr r4, [r2, #0x004]
/* RD calibration */
ldr r4, =0x55555555
ldr r5, =0xAAAAAAAA
ldr r1, =0x0
ldr r2, =0x0
150:
ldr r0, =CSD0_BASE_ADDR
add r0, r0, #0x10000000
add r0, r0, r2
str r4, [r0, #0x000]
str r5, [r0, #0x004]
str r5, [r0, #0x008]
str r4, [r0, #0x00c]
add r2, r2, #0x10
add r1, r1, #0x1
cmp r1, #0x4
bne 150b
ldr r0, =ESDCTL_BASE_ADDR
ldr r1, =0x04000050
str r1, [r0, #0x01c]
ldr r1, =0x00000030
str r1, [r0, #0x0a0]
// check for RD calibration complete
160:
ldr r1, [r0, #0x0a0]
and r2, r1, #0x10
cmp r2, #0x0
bne 160b
// check for calibration error
and r2, r1, #0xf
cmp r2, #0x0
beq 170f
ldr r0, =WDOG1_BASE_ADDR
ldr r1, =0x0033
strh r1, [r0, #0x00]
ldr r1, =0x0037
strh r1, [r0, #0x00]
ldr r1, =0x5555
strh r1, [r0, #0x02]
ldr r1, =0xaaaa
strh r1, [r0, #0x02]
// bne retry
170:
/* Reset */
ldr r1, [r0, #0x07c]
orr r1, r1, #(1 << 31)
str r1, [r0, #0x07c]
180:
ldr r1, [r0, #0x07c]
mov r2, #0x00000000
orr r2, r2, #(1 << 31)
and r1, r1, r2
cmp r1, #0x0
bne 180b
ldr r2, =CSD0_BASE_ADDR
add r2, r2, #0x1000000
ldr r3, =0x01234567
ldr r4, =0x89abcdef
str r3, [r2, #0x000]
str r4, [r2, #0x004]
ldr r3, [r2, #0x000]
ldr r4, [r2, #0x004]
//delay
ldr r1, =0x0
181:
nop
add r1, r1, #0x1
cmp r1, #0x200
bne 181b
/* WR calibration */
ldr r4, =0x55555555
ldr r5, =0xAAAAAAAA
ldr r1, =0x0
ldr r2, =0x0
190:
ldr r0, =CSD0_BASE_ADDR
add r0, r0, #0x10000000
add r0, r0, r2
str r4, [r0, #0x000]
str r5, [r0, #0x004]
str r5, [r0, #0x008]
str r4, [r0, #0x00c]
add r2, r2, #0x10
add r1, r1, #0x1
cmp r1, #0x4
bne 190b
ldr r0, =ESDCTL_BASE_ADDR
ldr r1, =0x04000050
str r1, [r0, #0x01c]
ldr r1, =0x00000030
str r1, [r0, #0x0a4]
// check for WR calibration complete
200:
ldr r1, [r0, #0x0a4]
and r2, r1, #0x10
cmp r2, #0x0
bne 200b
// check for calibration error
and r2, r1, #0xf
cmp r2, #0x0
beq 210f
ldr r0, =WDOG1_BASE_ADDR
ldr r1, =0x0033
strh r1, [r0, #0x00]
ldr r1, =0x0037
strh r1, [r0, #0x00]
ldr r1, =0x5555
strh r1, [r0, #0x02]
ldr r1, =0xaaaa
strh r1, [r0, #0x02]
// bne retry
210:
/* Reset */
ldr r1, [r0, #0x07c]
orr r1, r1, #(1 << 31)
str r1, [r0, #0x07c]
220:
ldr r1, [r0, #0x07c]
mov r2, #0x00000000
orr r2, r2, #(1 << 31)
and r1, r1, r2
cmp r1, #0x0
bne 220b
ldr r2, =CSD0_BASE_ADDR
add r2, r2, #0x1000000
ldr r3, =0x01234567
ldr r4, =0x89abcdef
str r3, [r2, #0x000]
str r4, [r2, #0x004]
ldr r3, [r2, #0x000]
ldr r4, [r2, #0x004]
/* Reset */
ldr r1, [r0, #0x07c]
orr r1, r1, #(1 << 31)
str r1, [r0, #0x07c]
230:
ldr r1, [r0, #0x07c]
mov r2, #0x00000000
orr r2, r2, #(1 << 31)
and r1, r1, r2
cmp r1, #0x0
bne 230b
// cmp r6, #0xff // for test only
// bls retry // for test only
ldr r5, [r0, #0x07c]
bic r5, r5, #(1 << 30) // clear bit 30
ldr r6, [r0, #0x080]
ldr r3, [r0, #0x088]
ldr r4, [r0, #0x090]
// Disable the ESDCTL
ldr r0, =ESDCTL_BASE_ADDR
ldr r1, =0x00000000
str r1, [r0, #0x00]
//delay
ldr r1, =0x0
260:
nop
nop
nop
nop
add r1, r1, #0x1
cmp r1, #0x100
bne 260b
#if 0
/* Reset the DDR controller */
ldr r1, [r0, #0x01c]
orr r1, r1, #(1 << 15)
str r1, [r0, #0x01c]
240:
ldr r1, [r0, #0x01c]
mov r2, #0x00000000
orr r2, r2, #(1 << 14)
and r1, r1, r2
cmp r1, #0x0
beq 240b
ldr r1, [r0, #0x018]
orr r1, r1, #(1 << 1)
str r1, [r0, #0x018]
250:
ldr r1, [r0, #0x018]
mov r2, #0x00000000
orr r2, r2, #(1 << 1)
and r1, r1, r2
cmp r1, #0x0
bne 250b
ldr r1, =0x00000000
str r1, [r0, #0x01c]
#endif
nop
nop
nop
nop
/* Re-initialize DDR3 memory with calibrated data */
ldr r0, =ESDCTL_BASE_ADDR
str r5, [r0, #0x07c]
str r6, [r0, #0x080]
str r3, [r0, #0x088]
str r4, [r0, #0x090]
ldr r1, =0x00011740
str r1, [r0, #0x018]
ldr r1, =0xc3190000
str r1, [r0, #0x00]
ldr r1, =0x9f515333
str r1, [r0, #0x0C]
ldr r1, =0xb68e8a63
str r1, [r0, #0x10]
ldr r1, =0x01ff00db
str r1, [r0, #0x14]
ldr r1, =0x000026d2
str r1, [r0, #0x2C]
ldr r1, =0x009f0e21
str r1, [r0, #0x30]
ldr r1, =0x12373030
str r1, [r0, #0x08]
ldr r1, =0x4402002d
str r1, [r0, #0x04]
ldr r1, =0x00008032
str r1, [r0, #0x1C]
ldr r1, =0x00008033
str r1, [r0, #0x1C]
ldr r1, =0x00028031
str r1, [r0, #0x1C]
ldr r1, =0x092080b0
str r1, [r0, #0x1C]
ldr r1, =0x04008040
str r1, [r0, #0x1C]
ldr r1, =0x0000803a
str r1, [r0, #0x1C]
ldr r1, =0x0000803b
str r1, [r0, #0x1C]
ldr r1, =0x00028039
str r1, [r0, #0x1C]
ldr r1, =0x09208138
str r1, [r0, #0x1C]
ldr r1, =0x04008048
str r1, [r0, #0x1C]
ldr r1, =0x00001800
str r1, [r0, #0x20]
ldr r1, =0x04b80003
str r1, [r0, #0x40]
ldr r1, =0x00022227
str r1, [r0, #0x58]
ldr r1, =0x00000000
str r1, [r0, #0x1C]
/*
* The following is to fill in those arguments for this ROM function
* pu_irom_hwcnfg_setup(void **start, size_t *bytes, const void *boot_data)
*
* This function is used to copy data from the storage media into DDR.
*
* start - Initial (possibly partial) image load address on entry. Final image
* load address on exit.
* bytes - Initial (possibly partial) image size on entry. Final image size on
* exit.
* boot_data - Initial @ref ivt Boot Data load address.
*/
adr r0, DDR_DEST_ADDR
adr r1, COPY_SIZE
adr r2, BOOT_DATA
before_calling_rom___pu_irom_hwcnfg_setup:
/* We should distinguish USB recovery mode(SDP mode) and internal boot mode.
If ROM runs in SDP mode, then it needn't load boot code from storage media.
If ROM runs in SDP mode, then r0 must be 0x00
If ROM runs in internal boot mode, then r0 should be larger than IRAM base address. */
cmp r7, #0xF8000000
bls return_sdp
/* Different ROM address for TO 1.0 & TO 2.x */
ldr r3, =ROM_SI_REV
ldr r4, [r3]
cmp r4, #0x21
/* TO2.1 */
moveq r6, #0x1800
addeq r6, r6, #0x4d
beq 2f
cmp r4, #0x20
/* TO2 */
moveq r6, #0x1800
addeq r6, r6, #0x4d
beq 2f
/* TO1 */
mov r6, #0x400000
add r6, r6, #0x5000
add r6, r6, #0xc7
2: blx r6 /* This address might change in future ROM versions */
after_calling_rom___pu_irom_hwcnfg_setup:
return_sdp:
cmp r7, #0xF8000000
bhi quit_plugin
/* Workaround run plug-ins in SDP mode without USB re-enumeration.
how it works:
ROM running in usb download mode.
Host manufacturing application sends SDP command to download plug-in image.
Host manufacturing application sends SDP command to jump to plug-in image and run it.
Plug-in starts execution and after its regular tasks plug-in will then call into ROM
call into pl_parse_and_handle() */
ldr r3, =ROM_SI_REV
ldr r5, [r3]
cmp r5, #0x20 /* check silicon revision to determine the function entry address */
ldrlt r4, =0x00000edd /* function entry in TO1 ROM */
ldrge r4, =0x0040487d /* function entry in TO2 ROM */
blx r4
/* To return to ROM from plugin, we need to fill in these argument.
* Here is what need to do:
* Need to construct the paramters for this function before return to ROM:
* plugin_download(void **start, size_t *bytes, UINT32 *ivt_offset)
*/
quit_plugin:
pop {r0-r6, lr}
ldr r7, DDR_DEST_ADDR
str r7, [r0]
ldr r7, COPY_SIZE
str r7, [r1]
mov r7, #0x400 /* Point to the second IVT table at offset 0x42C */
add r7, r7, #0x2C
str r7, [r2]
mov r0, #1
bx lr /* return back to ROM code */
DDR_DEST_ADDR: .word TEXT_BASE
COPY_SIZE: .word _end - TEXT_BASE
BOOT_DATA: .word TEXT_BASE
.word _end - TEXT_BASE
.word 0
#endif

View File

@ -0,0 +1,372 @@
/*
* Copyright (C) 2011 Freescale Semiconductor, Inc.
*
* 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.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
*/
#include <config.h>
#include <asm/arch/mx53.h>
/*
* L2CC Cache setup/invalidation/disable
*/
.macro init_l2cc
/* explicitly disable L2 cache */
mrc 15, 0, r0, c1, c0, 1
bic r0, r0, #0x2
mcr 15, 0, r0, c1, c0, 1
/* reconfigure L2 cache aux control reg */
mov r0, #0xC0 /* tag RAM */
add r0, r0, #0x4 /* data RAM */
orr r0, r0, #(1 << 24) /* disable write allocate delay */
orr r0, r0, #(1 << 23) /* disable write allocate combine */
orr r0, r0, #(1 << 22) /* disable write allocate */
mcr 15, 1, r0, c9, c0, 2
.endm /* init_l2cc */
/* AIPS setup - Only setup MPROTx registers.
* The PACR default values are good.*/
.macro init_aips
/*
* Set all MPROTx to be non-bufferable, trusted for R/W,
* not forced to user-mode.
*/
ldr r0, =AIPS1_BASE_ADDR
ldr r1, =0x77777777
str r1, [r0, #0x0]
str r1, [r0, #0x4]
ldr r0, =AIPS2_BASE_ADDR
str r1, [r0, #0x0]
str r1, [r0, #0x4]
.endm /* init_aips */
.macro setup_pll pll, freq
/*
* If freq < 300MHz, we need to set dpdck0_2_en to 0
*/
ldr r0, =\freq
ldr r1, =0x300
cmp r0, r1
ldrcs r1, =0x00001232
ldrcc r1, =0x00000232
ldr r0, =\pll
str r1, [r0, #PLL_DP_CTL]
mov r1, #0x2
str r1, [r0, #PLL_DP_CONFIG]
ldr r1, W_DP_OP_\freq
str r1, [r0, #PLL_DP_OP]
str r1, [r0, #PLL_DP_HFS_OP]
ldr r1, W_DP_MFD_\freq
str r1, [r0, #PLL_DP_MFD]
str r1, [r0, #PLL_DP_HFS_MFD]
ldr r1, W_DP_MFN_\freq
str r1, [r0, #PLL_DP_MFN]
str r1, [r0, #PLL_DP_HFS_MFN]
ldr r1, =0x00001232
str r1, [r0, #PLL_DP_CTL]
1: ldr r1, [r0, #PLL_DP_CTL]
ands r1, r1, #0x1
beq 1b
.endm
.macro init_m4if
/*increase master2 priority for WIFI*/
ldr r0, =M4IF_BASE_ADDR
ldr r1, [r0, #0x40]
orr r1, r1, #(0x33 << 16)
str r1, [r0, #0x40]
/*increase master4 priority for FEC*/
ldr r1, [r0, #0x44]
orr r1, r1, #0x33
str r1, [r0, #0x44]
/*set SDHC-port3 high priority to all AHB MAX Slave port*/
ldr r0, =AHBMAX_BASE_ADDR
#ifdef CONFIG_WIFI_SDHC_PORT3
/*set PARK to SDHC-port3*/
ldr r0, =AHBMAX_BASE_ADDR
ldr r1, [r0, #0x10]
bic r1, r1, #(0x7 << 0)
orr r1, r1, #0x3
bic r1, r1, #(0x3 << 4)
bic r1, r1, #(0x3 << 8)
orr r1, r1, #(0x1 << 30)
bic r1, r1, #(0x1 << 31)
ldr r1, [r0, #0x110]
bic r1, r1, #(0x7 << 0)
orr r1, r1, #0x3
bic r1, r1, #(0x3 << 4)
bic r1, r1, #(0x3 << 8)
orr r1, r1, #(0x1 << 30)
bic r1, r1, #(0x1 << 31)
ldr r1, [r0, #0x210]
bic r1, r1, #(0x7 << 0)
orr r1, r1, #0x3
bic r1, r1, #(0x3 << 4)
bic r1, r1, #(0x3 << 8)
orr r1, r1, #(0x1 << 30)
bic r1, r1, #(0x1 << 31)
ldr r1, [r0, #0x310]
bic r1, r1, #(0x7 << 0)
orr r1, r1, #0x3
bic r1, r1, #(0x3 << 4)
bic r1, r1, #(0x3 << 8)
orr r1, r1, #(0x1 << 30)
bic r1, r1, #(0x1 << 31)
/*set SDHC-port3 arbitration*/
ldr r0, =AHBMAX_BASE_ADDR
ldr r1, [r0, #0xb00]
bic r1, r1, #(0x7 << 0)
orr r1, r1, #0x1
#endif
#ifdef CONFIG_WIFI_SDHC_PORT2
/*set PARK to SDHC-port3*/
ldr r0, =AHBMAX_BASE_ADDR
ldr r1, [r0, #0x10]
bic r1, r1, #(0x7 << 0)
orr r1, r1, #0x2
bic r1, r1, #(0x3 << 4)
bic r1, r1, #(0x3 << 8)
orr r1, r1, #(0x1 << 30)
bic r1, r1, #(0x1 << 31)
ldr r1, [r0, #0x110]
bic r1, r1, #(0x7 << 0)
orr r1, r1, #0x2
bic r1, r1, #(0x3 << 4)
bic r1, r1, #(0x3 << 8)
orr r1, r1, #(0x1 << 30)
bic r1, r1, #(0x1 << 31)
ldr r1, [r0, #0x210]
bic r1, r1, #(0x7 << 0)
orr r1, r1, #0x2
bic r1, r1, #(0x3 << 4)
bic r1, r1, #(0x3 << 8)
orr r1, r1, #(0x1 << 30)
bic r1, r1, #(0x1 << 31)
ldr r1, [r0, #0x310]
bic r1, r1, #(0x7 << 0)
orr r1, r1, #0x2
bic r1, r1, #(0x3 << 4)
bic r1, r1, #(0x3 << 8)
orr r1, r1, #(0x1 << 30)
bic r1, r1, #(0x1 << 31)
/*set SDHC-port2 arbitration*/
ldr r0, =AHBMAX_BASE_ADDR
ldr r1, [r0, #0xA00]
bic r1, r1, #(0x7 << 0)
#endif
/*set JMP step to zero*/
ldr r0, =M4IF_BASE_ADDR
ldr r1, [r0, #0x48]
bic r1, r1, #(0x3 << 8)
str r1, [r0, #0x48]
.endm
.macro init_clock
ldr r0, =ROM_SI_REV
ldr r1, [r0]
cmp r1, #0x20
/* For TO2 only, set LDO to 1.3V */
ldr r0, =0x53fa8000
ldr r1, =0x00194005
streq r1, [r0, #0x04]
ldr r0, CCM_BASE_ADDR_W
/* Gate of clocks to the peripherals first */
ldr r1, =0x3FFFFFFF
str r1, [r0, #CLKCTL_CCGR0]
ldr r1, =0x0
str r1, [r0, #CLKCTL_CCGR1]
str r1, [r0, #CLKCTL_CCGR2]
str r1, [r0, #CLKCTL_CCGR3]
str r1, [r0, #CLKCTL_CCGR7]
ldr r1, =0x00030000
str r1, [r0, #CLKCTL_CCGR4]
ldr r1, =0x00FFF030
str r1, [r0, #CLKCTL_CCGR5]
ldr r1, =0x0F00030F
str r1, [r0, #CLKCTL_CCGR6]
/* Switch ARM to step clock */
mov r1, #0x4
str r1, [r0, #CLKCTL_CCSR]
setup_pll PLL1_BASE_ADDR, 800
setup_pll PLL3_BASE_ADDR, 400
/* Switch peripheral to PLL3 */
ldr r0, CCM_BASE_ADDR_W
ldr r1, CCM_VAL_0x00015154
str r1, [r0, #CLKCTL_CBCMR]
ldr r1, CCM_VAL_0x02888945
orr r1, r1, #(1 << 16)
str r1, [r0, #CLKCTL_CBCDR]
/* make sure change is effective */
1: ldr r1, [r0, #CLKCTL_CDHIPR]
cmp r1, #0x0
bne 1b
setup_pll PLL2_BASE_ADDR, CONFIG_SYS_PLL2_FREQ
/* Switch peripheral to PLL2 */
ldr r0, CCM_BASE_ADDR_W
ldr r1, CCM_VAL_0x00808145
orr r1, r1, #(CONFIG_SYS_AHB_PODF << 10)
orr r1, r1, #(CONFIG_SYS_AXIA_PODF << 16)
orr r1, r1, #(CONFIG_SYS_AXIB_PODF << 19)
str r1, [r0, #CLKCTL_CBCDR]
ldr r1, CCM_VAL_0x00016154
str r1, [r0, #CLKCTL_CBCMR]
/*change uart clk parent to pll2*/
ldr r1, [r0, #CLKCTL_CSCMR1]
and r1, r1, #0xfcffffff
orr r1, r1, #0x01000000
str r1, [r0, #CLKCTL_CSCMR1]
/* make sure change is effective */
1: ldr r1, [r0, #CLKCTL_CDHIPR]
cmp r1, #0x0
bne 1b
setup_pll PLL3_BASE_ADDR, 216
setup_pll PLL4_BASE_ADDR, 455
/* Set the platform clock dividers */
ldr r0, PLATFORM_BASE_ADDR_W
ldr r1, PLATFORM_CLOCK_DIV_W
str r1, [r0, #PLATFORM_ICGC]
ldr r0, CCM_BASE_ADDR_W
mov r1, #0
str r1, [r0, #CLKCTL_CACRR]
/* Switch ARM back to PLL 1. */
mov r1, #0x0
str r1, [r0, #CLKCTL_CCSR]
/* make uart div=6*/
ldr r1, [r0, #CLKCTL_CSCDR1]
and r1, r1, #0xffffffc0
orr r1, r1, #0x0a
str r1, [r0, #CLKCTL_CSCDR1]
/* Restore the default values in the Gate registers */
ldr r1, =0xFFFFFFFF
str r1, [r0, #CLKCTL_CCGR0]
str r1, [r0, #CLKCTL_CCGR1]
str r1, [r0, #CLKCTL_CCGR2]
str r1, [r0, #CLKCTL_CCGR3]
str r1, [r0, #CLKCTL_CCGR4]
str r1, [r0, #CLKCTL_CCGR5]
str r1, [r0, #CLKCTL_CCGR6]
str r1, [r0, #CLKCTL_CCGR7]
mov r1, #0x00000
str r1, [r0, #CLKCTL_CCDR]
/* for cko - for ARM div by 8 */
mov r1, #0x000A0000
add r1, r1, #0x00000F0
str r1, [r0, #CLKCTL_CCOSR]
.endm
.section ".text.init", "x"
.globl lowlevel_init
lowlevel_init:
#ifdef ENABLE_IMPRECISE_ABORT
mrs r1, spsr /* save old spsr */
mrs r0, cpsr /* read out the cpsr */
bic r0, r0, #0x100 /* clear the A bit */
msr spsr, r0 /* update spsr */
add lr, pc, #0x8 /* update lr */
movs pc, lr /* update cpsr */
nop
nop
nop
nop
msr spsr, r1 /* restore old spsr */
#endif
/* ARM errata ID #468414 */
mrc 15, 0, r1, c1, c0, 1
orr r1, r1, #(1 << 5) /* enable L1NEON bit */
mcr 15, 0, r1, c1, c0, 1
init_l2cc
init_aips
#ifdef CONFIG_ADJUST_WIFI_FEC_PERFORMANCE
/*increase WIFI & FEC priority of accessing bus*/
init_m4if
#endif
init_clock
mov pc, lr
/* Board level setting value */
CCM_BASE_ADDR_W: .word CCM_BASE_ADDR
CCM_VAL_0x00016154: .word 0x00016154
CCM_VAL_0x00808145: .word 0x00808145
CCM_VAL_0x00015154: .word 0x00015154
CCM_VAL_0x02888945: .word 0x02888945
W_DP_OP_1000: .word DP_OP_1000
W_DP_MFD_1000: .word DP_MFD_1000
W_DP_MFN_1000: .word DP_MFN_1000
W_DP_OP_800: .word DP_OP_800
W_DP_MFD_800: .word DP_MFD_800
W_DP_MFN_800: .word DP_MFN_800
W_DP_OP_600: .word DP_OP_600
W_DP_MFD_600: .word DP_MFD_600
W_DP_MFN_600: .word DP_MFN_600
W_DP_OP_400: .word DP_OP_400
W_DP_MFD_400: .word DP_MFD_400
W_DP_MFN_400: .word DP_MFN_400
W_DP_OP_216: .word DP_OP_216
W_DP_MFD_216: .word DP_MFD_216
W_DP_MFN_216: .word DP_MFN_216
W_DP_OP_455: .word DP_OP_455
W_DP_MFD_455: .word DP_MFD_455
W_DP_MFN_455: .word DP_MFN_455
PLATFORM_BASE_ADDR_W: .word ARM_BASE_ADDR
PLATFORM_CLOCK_DIV_W: .word 0x00000124

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,74 @@
/*
* January 2004 - Changed to support H4 device
* Copyright (c) 2004 Texas Instruments
*
* (C) Copyright 2002
* Gary Jennejohn, DENX Software Engineering, <gj@denx.de>
*
* (C) Copyright 2011 Freescale Semiconductor, Inc.
*
* See file CREDITS for list of people who contributed to this
* project.
*
* 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.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
*/
OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
OUTPUT_ARCH(arm)
ENTRY(_start)
SECTIONS
{
. = 0x00000000;
. = ALIGN(4);
.text :
{
/* WARNING - the following is hand-optimized to fit within */
/* the sector layout of our flash chips! XXX FIXME XXX */
board/freescale/mx53_pcba/flash_header.o (.text.flasheader)
cpu/arm_cortexa8/start.o
board/freescale/mx53_pcba/libmx53_pcba.a (.text)
lib_arm/libarm.a (.text)
net/libnet.a (.text)
drivers/mtd/libmtd.a (.text)
drivers/mmc/libmmc.a (.text)
. = DEFINED(env_offset) ? env_offset : .;
common/env_embedded.o(.text)
*(.text)
}
. = ALIGN(4);
.rodata : { *(.rodata) }
. = ALIGN(4);
.data : { *(.data) }
. = ALIGN(4);
.got : { *(.got) }
. = .;
__u_boot_cmd_start = .;
.u_boot_cmd : { *(.u_boot_cmd) }
__u_boot_cmd_end = .;
. = ALIGN(4);
_end_of_copy = .; /* end_of ROM copy code here */
__bss_start = .;
.bss : { *(.bss) }
_end = .;
}

View File

@ -0,0 +1,47 @@
#
# (C) Copyright 2010 Freescale Semiconductor, Inc.
#
# 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.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
# MA 02111-1307 USA
#
include $(TOPDIR)/config.mk
LIB = $(obj)lib$(BOARD).a
COBJS := mx53_smd.o
SOBJS := lowlevel_init.o flash_header.o
SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c)
OBJS := $(addprefix $(obj),$(COBJS))
SOBJS := $(addprefix $(obj),$(SOBJS))
$(LIB): $(obj).depend $(OBJS) $(SOBJS)
$(AR) $(ARFLAGS) $@ $(OBJS) $(SOBJS)
clean:
rm -f $(SOBJS) $(OBJS)
distclean: clean
rm -f $(LIB) core *.bak .depend
#########################################################################
# defines $(obj).depend target
include $(SRCTREE)/rules.mk
sinclude $(obj).depend
#########################################################################

View File

@ -0,0 +1,3 @@
LDSCRIPT := $(SRCTREE)/board/$(VENDOR)/$(BOARD)/u-boot.lds
TEXT_BASE = 0x77800000

View File

@ -0,0 +1,227 @@
/*
* Copyright (C) 2010-2011 Freescale Semiconductor, Inc.
*
* 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.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
*/
#include <config.h>
#include <asm/arch/mx53.h>
#define REG_LD_AND_STR_INIT(base) \
ldr r0, =base;
#define REG_LD_AND_STR_OP(i, offset, val) \
ldr r1, =val; \
ldr r2, =offset; \
str r1, [r0, r2];
#define REG_LD_AND_STR_END(base)
#ifdef CONFIG_FLASH_HEADER
#ifndef CONFIG_FLASH_HEADER_OFFSET
# error "Must define the offset of flash header"
#endif
.section ".text.flasheader", "x"
b _start
.org CONFIG_FLASH_HEADER_OFFSET
ivt_header: .long 0x402000D1/* Tag=0xD1, Len=0x0020, Ver=0x40 */
app_code_jump_v: .long (0xF8006000 + (plugin_start - TEXT_BASE))
reserv1: .long 0x0
dcd_ptr: .long 0x0
boot_data_ptr: .long (0xF8006000 + (boot_data - TEXT_BASE))
self_ptr: .long (0xF8006000 + (ivt_header - TEXT_BASE))
app_code_csf: .long 0x0
reserv2: .long 0x0
boot_data: .long 0xF8006000
image_len: .long (3 * 1024)
plugin: .long 0x1
/* Second IVT to give entry point into the bootloader copied to DDR */
ivt2_header: .long 0x402000D1/*Tag=0xD1, Len=0x0020, Ver=0x40 */
app2_code_jump_v: .long _start /* Entry point for the bootloader */
reserv3: .long 0x0
dcd2_ptr: .long 0x0
boot_data2_ptr: .long boot_data2
self_ptr2: .long ivt2_header
app_code_csf2: .long 0x0
reserv4: .long 0x0
boot_data2: .long TEXT_BASE
image_len2: .long _end_of_copy - TEXT_BASE + CONFIG_FLASH_HEADER_OFFSET
plugin2: .long 0x0
/* Here starts the plugin code */
plugin_start:
/* Save the return address and the function arguments */
push {r0-r6, lr}
/* We should distinguish USB recovery mode(SDP mode) and internal boot mode.
If ROM runs in SDP mode, then it needn't load boot code from storage media.
If ROM runs in SDP mode, then r0 must be 0x00
If ROM runs in internal boot mode, then r0 should be larger than IRAM base address. */
mov r7, r0
/* IOMUX */
REG_LD_AND_STR_INIT(IOMUXC_BASE_ADDR)
REG_LD_AND_STR_OP(1, 0x554, 0x00300000)
REG_LD_AND_STR_OP(2, 0x558, 0x00300040)
REG_LD_AND_STR_OP(3, 0x560, 0x00300000)
REG_LD_AND_STR_OP(4, 0x564, 0x00300040)
REG_LD_AND_STR_OP(5, 0x568, 0x00300040)
REG_LD_AND_STR_OP(6, 0x570, 0x00300000)
REG_LD_AND_STR_OP(7, 0x574, 0x00300000)
REG_LD_AND_STR_OP(8, 0x578, 0x00300000)
REG_LD_AND_STR_OP(9, 0x57c, 0x00300040)
REG_LD_AND_STR_OP(10, 0x580, 0x00300040)
REG_LD_AND_STR_OP(11, 0x584, 0x00300000)
REG_LD_AND_STR_OP(12, 0x588, 0x00300000)
REG_LD_AND_STR_OP(13, 0x590, 0x00300040)
REG_LD_AND_STR_OP(14, 0x594, 0x00300000)
REG_LD_AND_STR_OP(15, 0x6f0, 0x00300000)
REG_LD_AND_STR_OP(16, 0x6f4, 0x00000000)
REG_LD_AND_STR_OP(17, 0x6fc, 0x00000000)
REG_LD_AND_STR_OP(18, 0x714, 0x00000000)
REG_LD_AND_STR_OP(19, 0x718, 0x00300000)
REG_LD_AND_STR_OP(20, 0x71c, 0x00300000)
REG_LD_AND_STR_OP(21, 0x720, 0x00300000)
REG_LD_AND_STR_OP(22, 0x724, 0x04000000)
REG_LD_AND_STR_OP(23, 0x728, 0x00300000)
REG_LD_AND_STR_OP(24, 0x72c, 0x00300000)
REG_LD_AND_STR_END(IOMUXC_BASE_ADDR)
/* ESDCTL */
REG_LD_AND_STR_INIT(ESDCTL_BASE_ADDR)
REG_LD_AND_STR_OP(25, 0x088, 0x35343535)
REG_LD_AND_STR_OP(26, 0x090, 0x4d444c44)
REG_LD_AND_STR_OP(27, 0x07c, 0x01370138)
REG_LD_AND_STR_OP(28, 0x080, 0x013b013c)
REG_LD_AND_STR_OP(29, 0x0f8, 0x00000800)
REG_LD_AND_STR_OP(30, 0x018, 0x00001740)
REG_LD_AND_STR_OP(31, 0x000, 0xc3190000)
REG_LD_AND_STR_OP(32, 0x00c, 0x9f5152e3)
REG_LD_AND_STR_OP(33, 0x010, 0xb68e8a63)
REG_LD_AND_STR_OP(34, 0x014, 0x01ff00db)
REG_LD_AND_STR_OP(35, 0x02c, 0x000026d2)
REG_LD_AND_STR_OP(36, 0x030, 0x009f0e21)
REG_LD_AND_STR_OP(37, 0x008, 0x12273030)
REG_LD_AND_STR_OP(38, 0x004, 0x0002002d)
REG_LD_AND_STR_OP(39, 0x01c, 0x00008032)
REG_LD_AND_STR_OP(40, 0x01c, 0x00008033)
REG_LD_AND_STR_OP(41, 0x01c, 0x00028031)
REG_LD_AND_STR_OP(42, 0x01c, 0x052080b0)
REG_LD_AND_STR_OP(43, 0x01c, 0x04008040)
REG_LD_AND_STR_OP(44, 0x01c, 0x0000803a)
REG_LD_AND_STR_OP(45, 0x01c, 0x0000803b)
REG_LD_AND_STR_OP(46, 0x01c, 0x00028039)
REG_LD_AND_STR_OP(47, 0x01c, 0x05208138)
REG_LD_AND_STR_OP(48, 0x01c, 0x04008048)
REG_LD_AND_STR_OP(49, 0x020, 0x00005800)
REG_LD_AND_STR_OP(50, 0x040, 0x04b80003)
REG_LD_AND_STR_OP(51, 0x058, 0x00022227)
REG_LD_AND_STR_OP(52, 0x01C, 0x00000000)
REG_LD_AND_STR_END(ESDCTL_BASE_ADDR)
/*
* The following is to fill in those arguments for this ROM function
* pu_irom_hwcnfg_setup(void **start, size_t *bytes, const void *boot_data)
*
* This function is used to copy data from the storage media into DDR.
*
* start - Initial (possibly partial) image load address on entry. Final image
* load address on exit.
* bytes - Initial (possibly partial) image size on entry. Final image size on
* exit.
* boot_data - Initial @ref ivt Boot Data load address.
*/
adr r0, DDR_DEST_ADDR
adr r1, COPY_SIZE
adr r2, BOOT_DATA
before_calling_rom___pu_irom_hwcnfg_setup:
/* We should distinguish USB recovery mode(SDP mode) and internal boot mode.
If ROM runs in SDP mode, then it needn't load boot code from storage media.
If ROM runs in SDP mode, then r0 must be 0x00
If ROM runs in internal boot mode, then r0 should be larger than IRAM base address. */
cmp r7, #0xF8000000
bls return_sdp
/* Different ROM address for TO 1.0 & TO 2.0 */
ldr r3, =ROM_SI_REV
ldr r4, [r3]
cmp r4, #0x21
/* TO2.1 */
moveq r6, #0x1800
addeq r6, r6, #0x4d
beq 2f
cmp r4, #0x20
/* TO2 */
moveq r6, #0x1800
addeq r6, r6, #0x4d
beq 2f
/* TO1 */
mov r6, #0x400000
add r6, r6, #0x5000
add r6, r6, #0xc7
2:
blx r6 /* This address might change in future ROM versions */
after_calling_rom___pu_irom_hwcnfg_setup:
return_sdp:
cmp r7, #0xF8000000
bhi quit_plugin
/* Workaround run plug-ins in SDP mode without USB re-enumeration.
how it works:
ROM running in usb download mode.
Host manufacturing application sends SDP command to download plug-in image.
Host manufacturing application sends SDP command to jump to plug-in image and run it.
Plug-in starts execution and after its regular tasks plug-in will then call into ROM
call into pl_parse_and_handle() */
ldr r3, =ROM_SI_REV
ldr r5, [r3]
cmp r5, #0x20 /* check silicon revision to determine the function entry address */
ldrlt r4, =0x00000edd /* function entry in TO1 ROM */
ldrge r4, =0x0040487d /* function entry in TO2 ROM */
blx r4
/* To return to ROM from plugin, we need to fill in these argument.
* Here is what need to do:
* Need to construct the paramters for this function before return to ROM:
* plugin_download(void **start, size_t *bytes, UINT32 *ivt_offset)
*/
quit_plugin:
pop {r0-r6, lr}
ldr r7, DDR_DEST_ADDR
str r7, [r0]
ldr r7, COPY_SIZE
str r7, [r1]
mov r7, #0x400 /* Point to the second IVT table at offset 0x42C */
add r7, r7, #0x2C
str r7, [r2]
mov r0, #1
bx lr /* return back to ROM code */
DDR_DEST_ADDR: .word TEXT_BASE
COPY_SIZE: .word _end - TEXT_BASE
BOOT_DATA: .word TEXT_BASE
.word _end - TEXT_BASE
.word 0
#endif

View File

@ -0,0 +1,384 @@
/*
* Copyright (C) 2010-2011 Freescale Semiconductor, Inc.
*
* 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.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
*/
#include <config.h>
#include <asm/arch/mx53.h>
/*
* L2CC Cache setup/invalidation/disable
*/
.macro init_l2cc
/* explicitly disable L2 cache */
mrc 15, 0, r0, c1, c0, 1
bic r0, r0, #0x2
mcr 15, 0, r0, c1, c0, 1
/* reconfigure L2 cache aux control reg */
mov r0, #0xC0 /* tag RAM */
add r0, r0, #0x4 /* data RAM */
orr r0, r0, #(1 << 24) /* disable write allocate delay */
orr r0, r0, #(1 << 23) /* disable write allocate combine */
orr r0, r0, #(1 << 22) /* disable write allocate */
mcr 15, 1, r0, c9, c0, 2
.endm /* init_l2cc */
/* AIPS setup - Only setup MPROTx registers.
* The PACR default values are good.*/
.macro init_aips
/*
* Set all MPROTx to be non-bufferable, trusted for R/W,
* not forced to user-mode.
*/
ldr r0, =AIPS1_BASE_ADDR
ldr r1, =0x77777777
str r1, [r0, #0x0]
str r1, [r0, #0x4]
ldr r0, =AIPS2_BASE_ADDR
str r1, [r0, #0x0]
str r1, [r0, #0x4]
.endm /* init_aips */
.macro setup_pll pll, freq
/*
* If freq < 300MHz, we need to set dpdck0_2_en to 0
*/
ldr r0, =\freq
ldr r1, =0x12c
cmp r0, r1
ldrcs r1, =0x00001232
ldrcc r1, =0x00000232
ldr r0, =\pll
str r1, [r0, #PLL_DP_CTL]
mov r1, #0x2
str r1, [r0, #PLL_DP_CONFIG]
ldr r1, W_DP_OP_\freq
str r1, [r0, #PLL_DP_OP]
str r1, [r0, #PLL_DP_HFS_OP]
ldr r1, W_DP_MFD_\freq
str r1, [r0, #PLL_DP_MFD]
str r1, [r0, #PLL_DP_HFS_MFD]
ldr r1, W_DP_MFN_\freq
str r1, [r0, #PLL_DP_MFN]
str r1, [r0, #PLL_DP_HFS_MFN]
ldrcs r1, =0x00001232
ldrcc r1, =0x00000232
str r1, [r0, #PLL_DP_CTL]
1: ldr r1, [r0, #PLL_DP_CTL]
ands r1, r1, #0x1
beq 1b
.endm
.macro init_m4if
/*increase master2 priority for WIFI*/
ldr r0, =M4IF_BASE_ADDR
ldr r1, [r0, #0x40]
orr r1, r1, #(0x33 << 16)
str r1, [r0, #0x40]
/*increase master4 priority for FEC*/
ldr r1, [r0, #0x44]
orr r1, r1, #0x33
str r1, [r0, #0x44]
/*set SDHC-port3 high priority to all AHB MAX Slave port*/
ldr r0, =AHBMAX_BASE_ADDR
#ifdef CONFIG_WIFI_SDHC_PORT3
/*set PARK to SDHC-port3*/
ldr r0, =AHBMAX_BASE_ADDR
ldr r1, [r0, #0x10]
bic r1, r1, #(0x7 << 0)
orr r1, r1, #0x3
bic r1, r1, #(0x3 << 4)
bic r1, r1, #(0x3 << 8)
orr r1, r1, #(0x1 << 30)
bic r1, r1, #(0x1 << 31)
ldr r1, [r0, #0x110]
bic r1, r1, #(0x7 << 0)
orr r1, r1, #0x3
bic r1, r1, #(0x3 << 4)
bic r1, r1, #(0x3 << 8)
orr r1, r1, #(0x1 << 30)
bic r1, r1, #(0x1 << 31)
ldr r1, [r0, #0x210]
bic r1, r1, #(0x7 << 0)
orr r1, r1, #0x3
bic r1, r1, #(0x3 << 4)
bic r1, r1, #(0x3 << 8)
orr r1, r1, #(0x1 << 30)
bic r1, r1, #(0x1 << 31)
ldr r1, [r0, #0x310]
bic r1, r1, #(0x7 << 0)
orr r1, r1, #0x3
bic r1, r1, #(0x3 << 4)
bic r1, r1, #(0x3 << 8)
orr r1, r1, #(0x1 << 30)
bic r1, r1, #(0x1 << 31)
/*set SDHC-port3 arbitration*/
ldr r0, =AHBMAX_BASE_ADDR
ldr r1, [r0, #0xb00]
bic r1, r1, #(0x7 << 0)
orr r1, r1, #0x1
#endif
#ifdef CONFIG_WIFI_SDHC_PORT2
/*set PARK to SDHC-port3*/
ldr r0, =AHBMAX_BASE_ADDR
ldr r1, [r0, #0x10]
bic r1, r1, #(0x7 << 0)
orr r1, r1, #0x2
bic r1, r1, #(0x3 << 4)
bic r1, r1, #(0x3 << 8)
orr r1, r1, #(0x1 << 30)
bic r1, r1, #(0x1 << 31)
ldr r1, [r0, #0x110]
bic r1, r1, #(0x7 << 0)
orr r1, r1, #0x2
bic r1, r1, #(0x3 << 4)
bic r1, r1, #(0x3 << 8)
orr r1, r1, #(0x1 << 30)
bic r1, r1, #(0x1 << 31)
ldr r1, [r0, #0x210]
bic r1, r1, #(0x7 << 0)
orr r1, r1, #0x2
bic r1, r1, #(0x3 << 4)
bic r1, r1, #(0x3 << 8)
orr r1, r1, #(0x1 << 30)
bic r1, r1, #(0x1 << 31)
ldr r1, [r0, #0x310]
bic r1, r1, #(0x7 << 0)
orr r1, r1, #0x2
bic r1, r1, #(0x3 << 4)
bic r1, r1, #(0x3 << 8)
orr r1, r1, #(0x1 << 30)
bic r1, r1, #(0x1 << 31)
/*set SDHC-port2 arbitration*/
ldr r0, =AHBMAX_BASE_ADDR
ldr r1, [r0, #0xA00]
bic r1, r1, #(0x7 << 0)
#endif
/*set JMP step to zero*/
ldr r0, =M4IF_BASE_ADDR
ldr r1, [r0, #0x48]
bic r1, r1, #(0x3 << 8)
str r1, [r0, #0x48]
.endm
.macro init_clock
ldr r0, =ROM_SI_REV
ldr r1, [r0]
cmp r1, #0x20
/* For TO2 only, set LDO to 1.3V */
ldr r0, =0x53fa8000
ldr r1, =0x00194005
streq r1, [r0, #0x04]
ldr r0, CCM_BASE_ADDR_W
/* Gate of clocks to the peripherals first */
ldr r1, =0x3FFFFFFF
str r1, [r0, #CLKCTL_CCGR0]
ldr r1, =0x0
str r1, [r0, #CLKCTL_CCGR1]
str r1, [r0, #CLKCTL_CCGR2]
str r1, [r0, #CLKCTL_CCGR3]
str r1, [r0, #CLKCTL_CCGR7]
ldr r1, =0x00030000
str r1, [r0, #CLKCTL_CCGR4]
ldr r1, =0x00FFF030
str r1, [r0, #CLKCTL_CCGR5]
ldr r1, =0x0F00030F
str r1, [r0, #CLKCTL_CCGR6]
/* Switch ARM to step clock */
mov r1, #0x4
str r1, [r0, #CLKCTL_CCSR]
setup_pll PLL1_BASE_ADDR, 800
setup_pll PLL3_BASE_ADDR, 400
/* Switch peripheral to PLL3 */
ldr r0, CCM_BASE_ADDR_W
ldr r1, CCM_VAL_0x00015154
str r1, [r0, #CLKCTL_CBCMR]
ldr r1, CCM_VAL_0x02888945
orr r1, r1, #(1 << 16)
str r1, [r0, #CLKCTL_CBCDR]
/* make sure change is effective */
1: ldr r1, [r0, #CLKCTL_CDHIPR]
cmp r1, #0x0
bne 1b
setup_pll PLL2_BASE_ADDR, CONFIG_SYS_PLL2_FREQ
/* Switch peripheral to PLL2 */
ldr r0, CCM_BASE_ADDR_W
ldr r1, CCM_VAL_0x00808145
orr r1, r1, #(CONFIG_SYS_AHB_PODF << 10)
orr r1, r1, #(CONFIG_SYS_AXIA_PODF << 16)
orr r1, r1, #(CONFIG_SYS_AXIB_PODF << 19)
str r1, [r0, #CLKCTL_CBCDR]
ldr r1, CCM_VAL_0x00016154
str r1, [r0, #CLKCTL_CBCMR]
/*change uart clk parent to pll2*/
ldr r1, [r0, #CLKCTL_CSCMR1]
and r1, r1, #0xfcffffff
orr r1, r1, #0x01000000
str r1, [r0, #CLKCTL_CSCMR1]
/* make sure change is effective */
1: ldr r1, [r0, #CLKCTL_CDHIPR]
cmp r1, #0x0
bne 1b
setup_pll PLL3_BASE_ADDR, 216
setup_pll PLL4_BASE_ADDR, 455
/* Set the platform clock dividers */
ldr r0, PLATFORM_BASE_ADDR_W
ldr r1, PLATFORM_CLOCK_DIV_W
str r1, [r0, #PLATFORM_ICGC]
ldr r0, CCM_BASE_ADDR_W
mov r1, #0
str r1, [r0, #CLKCTL_CACRR]
/* Switch ARM back to PLL 1. */
mov r1, #0x0
str r1, [r0, #CLKCTL_CCSR]
/* make uart div=6*/
ldr r1, [r0, #CLKCTL_CSCDR1]
and r1, r1, #0xffffffc0
orr r1, r1, #0x0a
str r1, [r0, #CLKCTL_CSCDR1]
/* Restore the default values in the Gate registers */
ldr r1, =0xFFFFFFFF
str r1, [r0, #CLKCTL_CCGR0]
str r1, [r0, #CLKCTL_CCGR1]
str r1, [r0, #CLKCTL_CCGR2]
str r1, [r0, #CLKCTL_CCGR3]
str r1, [r0, #CLKCTL_CCGR4]
str r1, [r0, #CLKCTL_CCGR5]
str r1, [r0, #CLKCTL_CCGR6]
str r1, [r0, #CLKCTL_CCGR7]
mov r1, #0x00000
str r1, [r0, #CLKCTL_CCDR]
/* for cko - for ARM div by 8 */
mov r1, #0x000A0000
add r1, r1, #0x00000F0
str r1, [r0, #CLKCTL_CCOSR]
.endm
.section ".text.init", "x"
.globl lowlevel_init
lowlevel_init:
#ifdef ENABLE_IMPRECISE_ABORT
mrs r1, spsr /* save old spsr */
mrs r0, cpsr /* read out the cpsr */
bic r0, r0, #0x100 /* clear the A bit */
msr spsr, r0 /* update spsr */
add lr, pc, #0x8 /* update lr */
movs pc, lr /* update cpsr */
nop
nop
nop
nop
msr spsr, r1 /* restore old spsr */
#endif
/* SYS_ON_OFF_CTL (GPIO7) must be set to HIGH as the
* first action in the BOOT sequence.
*/
ldr r0, =GPIO1_BASE_ADDR
ldr r1, [r0, #0x0]
orr r1, r1, #(1 << 7)
str r1, [r0, #0x0]
ldr r1, [r0, #0x4]
orr r1, r1, #(1 << 7)
str r1, [r0, #0x4]
/* ARM errata ID #468414 */
mrc 15, 0, r1, c1, c0, 1
orr r1, r1, #(1 << 5) /* enable L1NEON bit */
mcr 15, 0, r1, c1, c0, 1
init_l2cc
init_aips
#ifdef CONFIG_ADJUST_WIFI_FEC_PERFORMANCE
/*increase WIFI & FEC priority of accessing bus*/
init_m4if
#endif
init_clock
mov pc, lr
/* Board level setting value */
CCM_BASE_ADDR_W: .word CCM_BASE_ADDR
CCM_VAL_0x00016154: .word 0x00016154
CCM_VAL_0x00808145: .word 0x00808145
CCM_VAL_0x00015154: .word 0x00015154
CCM_VAL_0x02888945: .word 0x02888945
W_DP_OP_1000: .word DP_OP_1000
W_DP_MFD_1000: .word DP_MFD_1000
W_DP_MFN_1000: .word DP_MFN_1000
W_DP_OP_800: .word DP_OP_800
W_DP_MFD_800: .word DP_MFD_800
W_DP_MFN_800: .word DP_MFN_800
W_DP_OP_600: .word DP_OP_600
W_DP_MFD_600: .word DP_MFD_600
W_DP_MFN_600: .word DP_MFN_600
W_DP_OP_400: .word DP_OP_400
W_DP_MFD_400: .word DP_MFD_400
W_DP_MFN_400: .word DP_MFN_400
W_DP_OP_216: .word DP_OP_216
W_DP_MFD_216: .word DP_MFD_216
W_DP_MFN_216: .word DP_MFN_216
W_DP_OP_455: .word DP_OP_455
W_DP_MFD_455: .word DP_MFD_455
W_DP_MFN_455: .word DP_MFN_455
PLATFORM_BASE_ADDR_W: .word ARM_BASE_ADDR
PLATFORM_CLOCK_DIV_W: .word 0x00000124

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,74 @@
/*
* January 2004 - Changed to support H4 device
* Copyright (c) 2004 Texas Instruments
*
* (C) Copyright 2002
* Gary Jennejohn, DENX Software Engineering, <gj@denx.de>
*
* (C) Copyright 2010 Freescale Semiconductor, Inc.
*
* See file CREDITS for list of people who contributed to this
* project.
*
* 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.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
*/
OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
OUTPUT_ARCH(arm)
ENTRY(_start)
SECTIONS
{
. = 0x00000000;
. = ALIGN(4);
.text :
{
/* WARNING - the following is hand-optimized to fit within */
/* the sector layout of our flash chips! XXX FIXME XXX */
board/freescale/mx53_smd/flash_header.o (.text.flasheader)
cpu/arm_cortexa8/start.o
board/freescale/mx53_smd/libmx53_smd.a (.text)
lib_arm/libarm.a (.text)
net/libnet.a (.text)
drivers/mtd/libmtd.a (.text)
drivers/mmc/libmmc.a (.text)
. = DEFINED(env_offset) ? env_offset : .;
common/env_embedded.o(.text)
*(.text)
}
. = ALIGN(4);
.rodata : { *(.rodata) }
. = ALIGN(4);
.data : { *(.data) }
. = ALIGN(4);
.got : { *(.got) }
. = .;
__u_boot_cmd_start = .;
.u_boot_cmd : { *(.u_boot_cmd) }
__u_boot_cmd_end = .;
. = ALIGN(4);
_end_of_copy = .; /* end_of ROM copy code here */
__bss_start = .;
.bss : { *(.bss) }
_end = .;
}

View File

@ -0,0 +1,47 @@
#
# (C) Copyright 2010-2011 Freescale Semiconductor, Inc.
#
# 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.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
# MA 02111-1307 USA
#
include $(TOPDIR)/config.mk
LIB = $(obj)lib$(BOARD).a
COBJS := $(BOARD).o
SOBJS := lowlevel_init.o flash_header.o
SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c)
OBJS := $(addprefix $(obj),$(COBJS))
SOBJS := $(addprefix $(obj),$(SOBJS))
$(LIB): $(obj).depend $(OBJS) $(SOBJS)
$(AR) $(ARFLAGS) $@ $(OBJS) $(SOBJS)
clean:
rm -f $(SOBJS) $(OBJS)
distclean: clean
rm -f $(LIB) core *.bak .depend
#########################################################################
# defines $(obj).depend target
include $(SRCTREE)/rules.mk
sinclude $(obj).depend
#########################################################################

View File

@ -0,0 +1,11 @@
LDSCRIPT := $(SRCTREE)/board/$(VENDOR)/$(BOARD)/u-boot.lds
sinclude $(OBJTREE)/board/$(VENDOR)/$(BOARD)/config.tmp
ifndef TEXT_BASE
TEXT_BASE = 0x27800000
endif
ifdef CONFIG_MX6Q_ARM2_LPDDR2POP
TEXT_BASE = 0x10800000
endif

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,167 @@
/*
* Copyright (C) 2010-2011 Freescale Semiconductor, Inc.
*
* 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.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
*/
#include <config.h>
#include <asm/arch/mx6.h>
/*
Disable L2Cache because ROM turn it on when uboot use plug-in.
If L2Cache is on default, there are cache coherence problem if kernel have
not config L2Cache.
*/
.macro init_l2cc
ldr r1, =0xa02000
ldr r0, =0x0
str r0, [r1, #0x100]
.endm /* init_l2cc */
/* invalidate the D-CACHE */
.macro inv_dcache
mov r0,#0
mcr p15,2,r0,c0,c0,0 /* cache size selection register, select dcache */
mrc p15,1,r0,c0,c0,0 /* cache size ID register */
mov r0,r0,ASR #13
ldr r3,=0xfff
and r0,r0,r3
cmp r0,#0x7f
moveq r6,#0x1000
beq size_done
cmp r0,#0xff
moveq r6,#0x2000
movne r6,#0x4000
size_done:
mov r2,#0
mov r3,#0x40000000
mov r4,#0x80000000
mov r5,#0xc0000000
d_inv_loop:
mcr p15,0,r2,c7,c6,2 /* invalidate dcache by set / way */
mcr p15,0,r3,c7,c6,2 /* invalidate dcache by set / way */
mcr p15,0,r4,c7,c6,2 /* invalidate dcache by set / way */
mcr p15,0,r5,c7,c6,2 /* invalidate dcache by set / way */
add r2,r2,#0x20
add r3,r3,#0x20
add r4,r4,#0x20
add r5,r5,#0x20
cmp r2,r6
bne d_inv_loop
.endm
/* AIPS setup - Only setup MPROTx registers.
* The PACR default values are good.*/
.macro init_aips
/*
* Set all MPROTx to be non-bufferable, trusted for R/W,
* not forced to user-mode.
*/
ldr r0, =AIPS1_ON_BASE_ADDR
ldr r1, =0x77777777
str r1, [r0, #0x0]
str r1, [r0, #0x4]
ldr r1, =0x0
str r1, [r0, #0x40]
str r1, [r0, #0x44]
str r1, [r0, #0x48]
str r1, [r0, #0x4C]
str r1, [r0, #0x50]
ldr r0, =AIPS2_ON_BASE_ADDR
ldr r1, =0x77777777
str r1, [r0, #0x0]
str r1, [r0, #0x4]
ldr r1, =0x0
str r1, [r0, #0x40]
str r1, [r0, #0x44]
str r1, [r0, #0x48]
str r1, [r0, #0x4C]
str r1, [r0, #0x50]
.endm /* init_aips */
.macro setup_pll pll, freq
.endm
.macro init_clock
/* PLL1, PLL2, and PLL3 are enabled by ROM */
#ifdef CONFIG_PLL3
/* enable PLL3 for UART */
ldr r0, ANATOP_BASE_ADDR_W
/* power up PLL */
ldr r1, [r0, #ANATOP_USB1]
orr r1, r1, #0x1000
str r1, [r0, #ANATOP_USB1]
/* enable PLL */
ldr r1, [r0, #ANATOP_USB1]
orr r1, r1, #0x2000
str r1, [r0, #ANATOP_USB1]
/* wait PLL lock */
100:
ldr r1, [r0, #ANATOP_USB1]
mov r1, r1, lsr #31
cmp r1, #0x1
bne 100b
/* clear bypass bit */
ldr r1, [r0, #ANATOP_USB1]
and r1, r1, #0xfffeffff
str r1, [r0, #ANATOP_USB1]
#endif
/* Restore the default values in the Gate registers */
ldr r0, CCM_BASE_ADDR_W
ldr r1, =0xC0003F
str r1, [r0, #CLKCTL_CCGR0]
ldr r1, =0x30FC00
str r1, [r0, #CLKCTL_CCGR1]
ldr r1, =0xFFFC000
str r1, [r0, #CLKCTL_CCGR2]
ldr r1, =0x3FF00000
str r1, [r0, #CLKCTL_CCGR3]
ldr r1, =0xFFF300
str r1, [r0, #CLKCTL_CCGR4]
ldr r1, =0xF0000C3
str r1, [r0, #CLKCTL_CCGR5]
ldr r1, =0x3FC
str r1, [r0, #CLKCTL_CCGR6]
.endm
.section ".text.init", "x"
.globl lowlevel_init
lowlevel_init:
inv_dcache
init_l2cc
init_aips
init_clock
mov pc, lr
/* Board level setting value */
ANATOP_BASE_ADDR_W: .word ANATOP_BASE_ADDR
CCM_BASE_ADDR_W: .word CCM_BASE_ADDR

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,74 @@
/*
* January 2004 - Changed to support H4 device
* Copyright (c) 2004 Texas Instruments
*
* (C) Copyright 2002
* Gary Jennejohn, DENX Software Engineering, <gj@denx.de>
*
* (C) Copyright 2011 Freescale Semiconductor, Inc.
*
* See file CREDITS for list of people who contributed to this
* project.
*
* 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.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
*/
OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
OUTPUT_ARCH(arm)
ENTRY(_start)
SECTIONS
{
. = 0x00000000;
. = ALIGN(4);
.text :
{
/* WARNING - the following is hand-optimized to fit within */
/* the sector layout of our flash chips! XXX FIXME XXX */
board/freescale/mx6q_arm2/flash_header.o (.text.flasheader)
cpu/arm_cortexa8/start.o
board/freescale/mx6q_arm2/libmx6q_arm2.a (.text)
lib_arm/libarm.a (.text)
net/libnet.a (.text)
drivers/mtd/libmtd.a (.text)
drivers/mmc/libmmc.a (.text)
. = DEFINED(env_offset) ? env_offset : .;
common/env_embedded.o(.text)
*(.text)
}
. = ALIGN(4);
.rodata : { *(.rodata) }
. = ALIGN(4);
.data : { *(.data) }
. = ALIGN(4);
.got : { *(.got) }
. = .;
__u_boot_cmd_start = .;
.u_boot_cmd : { *(.u_boot_cmd) }
__u_boot_cmd_end = .;
. = ALIGN(4);
_end_of_copy = .; /* end_of ROM copy code here */
__bss_start = .;
.bss : { *(.bss) }
_end = .;
}

View File

@ -0,0 +1,47 @@
#
# (C) Copyright 2010-2011 Freescale Semiconductor, Inc.
#
# 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.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
# MA 02111-1307 USA
#
include $(TOPDIR)/config.mk
LIB = $(obj)lib$(BOARD).a
COBJS := $(BOARD).o
SOBJS := lowlevel_init.o flash_header.o
SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c)
OBJS := $(addprefix $(obj),$(COBJS))
SOBJS := $(addprefix $(obj),$(SOBJS))
$(LIB): $(obj).depend $(OBJS) $(SOBJS)
$(AR) $(ARFLAGS) $@ $(OBJS) $(SOBJS)
clean:
rm -f $(SOBJS) $(OBJS)
distclean: clean
rm -f $(LIB) core *.bak .depend
#########################################################################
# defines $(obj).depend target
include $(SRCTREE)/rules.mk
sinclude $(obj).depend
#########################################################################

View File

@ -0,0 +1,7 @@
LDSCRIPT := $(SRCTREE)/board/$(VENDOR)/$(BOARD)/u-boot.lds
sinclude $(OBJTREE)/board/$(VENDOR)/$(BOARD)/config.tmp
ifndef TEXT_BASE
TEXT_BASE = 0x27800000
endif

View File

@ -0,0 +1,355 @@
/*
* Copyright (C) 2010-2011 Freescale Semiconductor, Inc.
*
* 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.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
*/
#include <config.h>
#include <asm/arch/mx6.h>
#ifdef CONFIG_FLASH_HEADER
#ifndef CONFIG_FLASH_HEADER_OFFSET
# error "Must define the offset of flash header"
#endif
#define CPU_2_BE_32(l) \
((((l) & 0x000000FF) << 24) | \
(((l) & 0x0000FF00) << 8) | \
(((l) & 0x00FF0000) >> 8) | \
(((l) & 0xFF000000) >> 24))
#define MXC_DCD_ITEM(i, addr, val) \
dcd_node_##i: \
.word CPU_2_BE_32(addr) ; \
.word CPU_2_BE_32(val) ; \
.section ".text.flasheader", "x"
b _start
.org CONFIG_FLASH_HEADER_OFFSET
ivt_header: .word 0x402000D1 /* Tag=0xD1, Len=0x0020, Ver=0x40 */
app_code_jump_v: .word _start
reserv1: .word 0x0
dcd_ptr: .word dcd_hdr
boot_data_ptr: .word boot_data
self_ptr: .word ivt_header
app_code_csf: .word 0x0
reserv2: .word 0x0
boot_data: .word TEXT_BASE
image_len: .word _end_of_copy - TEXT_BASE + CONFIG_FLASH_HEADER_OFFSET
plugin: .word 0x0
#ifdef CONFIG_LPDDR2
dcd_hdr: .word 0x400804D2 /* Tag=0xD2, Len=128*8 + 4 + 4, Ver=0x40 */
write_dcd_cmd: .word 0x040404CC /* Tag=0xCC, Len=128*8 + 4, Param=0x04 */
/* DCD */
MXC_DCD_ITEM(1, CCM_BASE_ADDR + 0x18, 0x60324)
MXC_DCD_ITEM(2, IOMUXC_BASE_ADDR + 0x5a8, 0x00003038)
MXC_DCD_ITEM(3, IOMUXC_BASE_ADDR + 0x5b0, 0x00003038)
MXC_DCD_ITEM(4, IOMUXC_BASE_ADDR + 0x524, 0x00003038)
MXC_DCD_ITEM(5, IOMUXC_BASE_ADDR + 0x51c, 0x00003038)
MXC_DCD_ITEM(6, IOMUXC_BASE_ADDR + 0x518, 0x00003038)
MXC_DCD_ITEM(7, IOMUXC_BASE_ADDR + 0x50c, 0x00003038)
MXC_DCD_ITEM(8, IOMUXC_BASE_ADDR + 0x5b8, 0x00003038)
MXC_DCD_ITEM(9, IOMUXC_BASE_ADDR + 0x5c0, 0x00003038)
MXC_DCD_ITEM(10, IOMUXC_BASE_ADDR + 0x5ac, 0x00000038)
MXC_DCD_ITEM(11, IOMUXC_BASE_ADDR + 0x5b4, 0x00000038)
MXC_DCD_ITEM(12, IOMUXC_BASE_ADDR + 0x528, 0x00000038)
MXC_DCD_ITEM(13, IOMUXC_BASE_ADDR + 0x520, 0x00000038)
MXC_DCD_ITEM(14, IOMUXC_BASE_ADDR + 0x514, 0x00000038)
MXC_DCD_ITEM(15, IOMUXC_BASE_ADDR + 0x510, 0x00000038)
MXC_DCD_ITEM(16, IOMUXC_BASE_ADDR + 0x5bc, 0x00000038)
MXC_DCD_ITEM(17, IOMUXC_BASE_ADDR + 0x5c4, 0x00000038)
MXC_DCD_ITEM(18, IOMUXC_BASE_ADDR + 0x56c, 0x00000038)
MXC_DCD_ITEM(19, IOMUXC_BASE_ADDR + 0x578, 0x00000038)
MXC_DCD_ITEM(20, IOMUXC_BASE_ADDR + 0x588, 0x00000038)
MXC_DCD_ITEM(21, IOMUXC_BASE_ADDR + 0x594, 0x00000038)
MXC_DCD_ITEM(22, IOMUXC_BASE_ADDR + 0x57c, 0x00000038)
MXC_DCD_ITEM(23, IOMUXC_BASE_ADDR + 0x590, 0x00000038)
MXC_DCD_ITEM(24, IOMUXC_BASE_ADDR + 0x598, 0x00000038)
MXC_DCD_ITEM(25, IOMUXC_BASE_ADDR + 0x58c, 0x00000000)
MXC_DCD_ITEM(26, IOMUXC_BASE_ADDR + 0x59c, 0x00000038)
MXC_DCD_ITEM(27, IOMUXC_BASE_ADDR + 0x5a0, 0x00000038)
MXC_DCD_ITEM(28, IOMUXC_BASE_ADDR + 0x784, 0x00000038)
MXC_DCD_ITEM(29, IOMUXC_BASE_ADDR + 0x788, 0x00000038)
MXC_DCD_ITEM(30, IOMUXC_BASE_ADDR + 0x794, 0x00000038)
MXC_DCD_ITEM(31, IOMUXC_BASE_ADDR + 0x79c, 0x00000038)
MXC_DCD_ITEM(32, IOMUXC_BASE_ADDR + 0x7a0, 0x00000038)
MXC_DCD_ITEM(33, IOMUXC_BASE_ADDR + 0x7a4, 0x00000038)
MXC_DCD_ITEM(34, IOMUXC_BASE_ADDR + 0x7a8, 0x00000038)
MXC_DCD_ITEM(35, IOMUXC_BASE_ADDR + 0x748, 0x00000038)
MXC_DCD_ITEM(36, IOMUXC_BASE_ADDR + 0x74c, 0x00000038)
MXC_DCD_ITEM(37, IOMUXC_BASE_ADDR + 0x750, 0x00020000)
MXC_DCD_ITEM(38, IOMUXC_BASE_ADDR + 0x758, 0x00000000)
MXC_DCD_ITEM(39, IOMUXC_BASE_ADDR + 0x774, 0x00020000)
MXC_DCD_ITEM(40, IOMUXC_BASE_ADDR + 0x78c, 0x00000038)
MXC_DCD_ITEM(41, IOMUXC_BASE_ADDR + 0x798, 0x00080000)
MXC_DCD_ITEM(42, MMDC_P0_BASE_ADDR + 0x01c, 0x00008000)
MXC_DCD_ITEM(43, MMDC_P1_BASE_ADDR + 0x01c, 0x00008000)
MXC_DCD_ITEM(44, MMDC_P0_BASE_ADDR + 0x85c, 0x1b5f01ff)
MXC_DCD_ITEM(45, MMDC_P1_BASE_ADDR + 0x85c, 0x1b5f01ff)
MXC_DCD_ITEM(46, MMDC_P0_BASE_ADDR + 0x800, 0xa1390000)
MXC_DCD_ITEM(47, MMDC_P1_BASE_ADDR + 0x800, 0xa1390000)
MXC_DCD_ITEM(48, MMDC_P0_BASE_ADDR + 0x890, 0x00400000)
MXC_DCD_ITEM(49, MMDC_P1_BASE_ADDR + 0x890, 0x00400000)
MXC_DCD_ITEM(50, MMDC_P1_BASE_ADDR + 0x8bc, 0x00055555)
MXC_DCD_ITEM(51, MMDC_P0_BASE_ADDR + 0x8b8, 0x00000800)
MXC_DCD_ITEM(52, MMDC_P1_BASE_ADDR + 0x8b8, 0x00000800)
MXC_DCD_ITEM(53, MMDC_P0_BASE_ADDR + 0x81c, 0x33333333)
MXC_DCD_ITEM(54, MMDC_P0_BASE_ADDR + 0x820, 0x33333333)
MXC_DCD_ITEM(55, MMDC_P0_BASE_ADDR + 0x824, 0x33333333)
MXC_DCD_ITEM(56, MMDC_P0_BASE_ADDR + 0x828, 0x33333333)
MXC_DCD_ITEM(57, MMDC_P1_BASE_ADDR + 0x81c, 0x33333333)
MXC_DCD_ITEM(58, MMDC_P1_BASE_ADDR + 0x820, 0x33333333)
MXC_DCD_ITEM(59, MMDC_P1_BASE_ADDR + 0x824, 0x33333333)
MXC_DCD_ITEM(60, MMDC_P1_BASE_ADDR + 0x828, 0x33333333)
MXC_DCD_ITEM(61, MMDC_P0_BASE_ADDR + 0x82c, 0xf3333333)
MXC_DCD_ITEM(62, MMDC_P0_BASE_ADDR + 0x830, 0xf3333333)
MXC_DCD_ITEM(63, MMDC_P0_BASE_ADDR + 0x834, 0xf3333333)
MXC_DCD_ITEM(64, MMDC_P0_BASE_ADDR + 0x838, 0xf3333333)
MXC_DCD_ITEM(65, MMDC_P1_BASE_ADDR + 0x82c, 0xf3333333)
MXC_DCD_ITEM(66, MMDC_P1_BASE_ADDR + 0x830, 0xf3333333)
MXC_DCD_ITEM(67, MMDC_P1_BASE_ADDR + 0x834, 0xf3333333)
MXC_DCD_ITEM(68, MMDC_P1_BASE_ADDR + 0x838, 0xf3333333)
MXC_DCD_ITEM(69, MMDC_P0_BASE_ADDR + 0x848, 0x49383b39)
MXC_DCD_ITEM(70, MMDC_P0_BASE_ADDR + 0x850, 0x30364738)
MXC_DCD_ITEM(71, MMDC_P1_BASE_ADDR + 0x848, 0x3e3c3846)
MXC_DCD_ITEM(72, MMDC_P1_BASE_ADDR + 0x850, 0x4c294b35)
MXC_DCD_ITEM(73, MMDC_P0_BASE_ADDR + 0x83c, 0x20000000)
MXC_DCD_ITEM(74, MMDC_P0_BASE_ADDR + 0x840, 0x0)
MXC_DCD_ITEM(75, MMDC_P1_BASE_ADDR + 0x83c, 0x20000000)
MXC_DCD_ITEM(76, MMDC_P1_BASE_ADDR + 0x840, 0x0)
MXC_DCD_ITEM(77, MMDC_P0_BASE_ADDR + 0x858, 0xf00)
MXC_DCD_ITEM(78, MMDC_P1_BASE_ADDR + 0x858, 0xf00)
MXC_DCD_ITEM(79, MMDC_P0_BASE_ADDR + 0x8b8, 0x800)
MXC_DCD_ITEM(80, MMDC_P1_BASE_ADDR + 0x8b8, 0x800)
MXC_DCD_ITEM(81, MMDC_P0_BASE_ADDR + 0xc, 0x555a61a5)
MXC_DCD_ITEM(82, MMDC_P0_BASE_ADDR + 0x4, 0x20036)
MXC_DCD_ITEM(83, MMDC_P0_BASE_ADDR + 0x10, 0x160e83)
MXC_DCD_ITEM(84, MMDC_P0_BASE_ADDR + 0x14, 0xdd)
MXC_DCD_ITEM(85, MMDC_P0_BASE_ADDR + 0x18, 0x8174c)
MXC_DCD_ITEM(86, MMDC_P0_BASE_ADDR + 0x2c, 0xf9f26d2)
MXC_DCD_ITEM(87, MMDC_P0_BASE_ADDR + 0x30, 0x20e)
MXC_DCD_ITEM(88, MMDC_P0_BASE_ADDR + 0x38, 0x200aac)
MXC_DCD_ITEM(89, MMDC_P0_BASE_ADDR + 0x8, 0x0)
MXC_DCD_ITEM(90, MMDC_P0_BASE_ADDR + 0x40, 0x5f)
MXC_DCD_ITEM(91, MMDC_P0_BASE_ADDR + 0x0, 0xc3010000)
MXC_DCD_ITEM(92, MMDC_P1_BASE_ADDR + 0xc, 0x555a61a5)
MXC_DCD_ITEM(93, MMDC_P1_BASE_ADDR + 0x4, 0x20036)
MXC_DCD_ITEM(94, MMDC_P1_BASE_ADDR + 0x10, 0x160e83)
MXC_DCD_ITEM(95, MMDC_P1_BASE_ADDR + 0x14, 0xdd)
MXC_DCD_ITEM(96, MMDC_P1_BASE_ADDR + 0x18, 0x8174c)
MXC_DCD_ITEM(97, MMDC_P1_BASE_ADDR + 0x2c, 0xf9f26d2)
MXC_DCD_ITEM(98, MMDC_P1_BASE_ADDR + 0x30, 0x20e)
MXC_DCD_ITEM(99, MMDC_P1_BASE_ADDR + 0x38, 0x200aac)
MXC_DCD_ITEM(100, MMDC_P1_BASE_ADDR + 0x8, 0x0)
MXC_DCD_ITEM(101, MMDC_P1_BASE_ADDR + 0x40, 0x3f)
MXC_DCD_ITEM(102, MMDC_P1_BASE_ADDR + 0x0, 0xc3010000)
MXC_DCD_ITEM(103, MMDC_P0_BASE_ADDR + 0x1c, 0x3f8030)
MXC_DCD_ITEM(104, MMDC_P0_BASE_ADDR + 0x1c, 0xff0a8030)
MXC_DCD_ITEM(105, MMDC_P0_BASE_ADDR + 0x1c, 0xc2018030)
MXC_DCD_ITEM(106, MMDC_P0_BASE_ADDR + 0x1c, 0x6028030)
MXC_DCD_ITEM(107, MMDC_P0_BASE_ADDR + 0x1c, 0x2038030)
MXC_DCD_ITEM(108, MMDC_P1_BASE_ADDR + 0x1c, 0x3f8030)
MXC_DCD_ITEM(109, MMDC_P1_BASE_ADDR + 0x1c, 0xff0a8030)
MXC_DCD_ITEM(110, MMDC_P1_BASE_ADDR + 0x1c, 0xc2018030)
MXC_DCD_ITEM(111, MMDC_P1_BASE_ADDR + 0x1c, 0x6028030)
MXC_DCD_ITEM(112, MMDC_P1_BASE_ADDR + 0x1c, 0x2038030)
MXC_DCD_ITEM(113, MMDC_P0_BASE_ADDR + 0x800, 0xa1390003)
MXC_DCD_ITEM(114, MMDC_P1_BASE_ADDR + 0x800, 0xa1390003)
MXC_DCD_ITEM(115, MMDC_P0_BASE_ADDR + 0x20, 0x7800)
MXC_DCD_ITEM(116, MMDC_P1_BASE_ADDR + 0x20, 0x7800)
MXC_DCD_ITEM(117, MMDC_P0_BASE_ADDR + 0x818, 0x0)
MXC_DCD_ITEM(118, MMDC_P1_BASE_ADDR + 0x818, 0x0)
MXC_DCD_ITEM(119, MMDC_P0_BASE_ADDR + 0x800, 0xa1390003)
MXC_DCD_ITEM(120, MMDC_P1_BASE_ADDR + 0x800, 0xa1390003)
MXC_DCD_ITEM(121, MMDC_P0_BASE_ADDR + 0x8b8, 0x800)
MXC_DCD_ITEM(122, MMDC_P1_BASE_ADDR + 0x8b8, 0x800)
MXC_DCD_ITEM(123, MMDC_P0_BASE_ADDR + 0x1c, 0x0)
MXC_DCD_ITEM(124, MMDC_P1_BASE_ADDR + 0x1c, 0x0)
MXC_DCD_ITEM(125, MMDC_P0_BASE_ADDR + 0x404, 0x00011006)
/* enable AXI cache for VDOA/VPU/IPU */
MXC_DCD_ITEM(126, IOMUXC_BASE_ADDR + 0x010, 0xf00000ff)
/* set IPU Qos=0x7 */
MXC_DCD_ITEM(127, IOMUXC_BASE_ADDR + 0x018, 0x00070007)
MXC_DCD_ITEM(128, IOMUXC_BASE_ADDR + 0x01c, 0x00070007)
#else
dcd_hdr: .word 0x40C802D2 /* Tag=0xD2, Len=88*8 + 4 + 4, Ver=0x40 */
write_dcd_cmd: .word 0x04C402CC /* Tag=0xCC, Len=88*8 + 4, Param=0x04 */
/* DCD */
/* DDR3 initialization based on the MX6Q Auto Reference Design (ARD) */
MXC_DCD_ITEM(1, IOMUXC_BASE_ADDR + 0x5a8, 0x00000028)
MXC_DCD_ITEM(2, IOMUXC_BASE_ADDR + 0x5b0, 0x00000028)
MXC_DCD_ITEM(3, IOMUXC_BASE_ADDR + 0x524, 0x00000028)
MXC_DCD_ITEM(4, IOMUXC_BASE_ADDR + 0x51c, 0x00000028)
MXC_DCD_ITEM(5, IOMUXC_BASE_ADDR + 0x518, 0x00000028)
MXC_DCD_ITEM(6, IOMUXC_BASE_ADDR + 0x50c, 0x00000028)
MXC_DCD_ITEM(7, IOMUXC_BASE_ADDR + 0x5b8, 0x00000028)
MXC_DCD_ITEM(8, IOMUXC_BASE_ADDR + 0x5c0, 0x00000028)
MXC_DCD_ITEM(9, IOMUXC_BASE_ADDR + 0x5ac, 0x00000028)
MXC_DCD_ITEM(10, IOMUXC_BASE_ADDR + 0x5b4, 0x00000028)
MXC_DCD_ITEM(11, IOMUXC_BASE_ADDR + 0x528, 0x00000028)
MXC_DCD_ITEM(12, IOMUXC_BASE_ADDR + 0x520, 0x00000028)
MXC_DCD_ITEM(13, IOMUXC_BASE_ADDR + 0x514, 0x00000028)
MXC_DCD_ITEM(14, IOMUXC_BASE_ADDR + 0x510, 0x00000028)
MXC_DCD_ITEM(15, IOMUXC_BASE_ADDR + 0x5bc, 0x00000028)
MXC_DCD_ITEM(16, IOMUXC_BASE_ADDR + 0x5c4, 0x00000028)
MXC_DCD_ITEM(17, IOMUXC_BASE_ADDR + 0x56c, 0x00000030)
MXC_DCD_ITEM(18, IOMUXC_BASE_ADDR + 0x578, 0x00000030)
MXC_DCD_ITEM(19, IOMUXC_BASE_ADDR + 0x588, 0x00000030)
MXC_DCD_ITEM(20, IOMUXC_BASE_ADDR + 0x594, 0x00000030)
MXC_DCD_ITEM(21, IOMUXC_BASE_ADDR + 0x57c, 0x00000030)
MXC_DCD_ITEM(22, IOMUXC_BASE_ADDR + 0x590, 0x00000030)
MXC_DCD_ITEM(23, IOMUXC_BASE_ADDR + 0x598, 0x00000030)
MXC_DCD_ITEM(24, IOMUXC_BASE_ADDR + 0x58c, 0x00000000)
MXC_DCD_ITEM(25, IOMUXC_BASE_ADDR + 0x59c, 0x00003030)
MXC_DCD_ITEM(26, IOMUXC_BASE_ADDR + 0x5a0, 0x00003030)
MXC_DCD_ITEM(27, IOMUXC_BASE_ADDR + 0x784, 0x00000028)
MXC_DCD_ITEM(28, IOMUXC_BASE_ADDR + 0x788, 0x00000028)
MXC_DCD_ITEM(29, IOMUXC_BASE_ADDR + 0x794, 0x00000028)
MXC_DCD_ITEM(30, IOMUXC_BASE_ADDR + 0x79c, 0x00000028)
MXC_DCD_ITEM(31, IOMUXC_BASE_ADDR + 0x7a0, 0x00000028)
MXC_DCD_ITEM(32, IOMUXC_BASE_ADDR + 0x7a4, 0x00000028)
MXC_DCD_ITEM(33, IOMUXC_BASE_ADDR + 0x7a8, 0x00000028)
MXC_DCD_ITEM(34, IOMUXC_BASE_ADDR + 0x748, 0x00000028)
MXC_DCD_ITEM(35, IOMUXC_BASE_ADDR + 0x74c, 0x00000030)
MXC_DCD_ITEM(36, IOMUXC_BASE_ADDR + 0x750, 0x00020000)
MXC_DCD_ITEM(37, IOMUXC_BASE_ADDR + 0x758, 0x00000000)
MXC_DCD_ITEM(38, IOMUXC_BASE_ADDR + 0x774, 0x00020000)
MXC_DCD_ITEM(39, IOMUXC_BASE_ADDR + 0x78c, 0x00000030)
MXC_DCD_ITEM(40, IOMUXC_BASE_ADDR + 0x798, 0x000C0000)
MXC_DCD_ITEM(41, MMDC_P0_BASE_ADDR + 0x81c, 0x33333333)
MXC_DCD_ITEM(42, MMDC_P0_BASE_ADDR + 0x820, 0x33333333)
MXC_DCD_ITEM(43, MMDC_P0_BASE_ADDR + 0x824, 0x33333333)
MXC_DCD_ITEM(44, MMDC_P0_BASE_ADDR + 0x828, 0x33333333)
MXC_DCD_ITEM(45, MMDC_P1_BASE_ADDR + 0x81c, 0x33333333)
MXC_DCD_ITEM(46, MMDC_P1_BASE_ADDR + 0x820, 0x33333333)
MXC_DCD_ITEM(47, MMDC_P1_BASE_ADDR + 0x824, 0x33333333)
MXC_DCD_ITEM(48, MMDC_P1_BASE_ADDR + 0x828, 0x33333333)
MXC_DCD_ITEM(49, MMDC_P0_BASE_ADDR + 0x018, 0x00001740)
MXC_DCD_ITEM(50, MMDC_P0_BASE_ADDR + 0x01c, 0x00008000)
MXC_DCD_ITEM(51, MMDC_P0_BASE_ADDR + 0x00c, 0x8A8F7975)
MXC_DCD_ITEM(52, MMDC_P0_BASE_ADDR + 0x010, 0xFF538E64)
MXC_DCD_ITEM(53, MMDC_P0_BASE_ADDR + 0x014, 0x01FF00DB)
MXC_DCD_ITEM(54, MMDC_P0_BASE_ADDR + 0x02c, 0x000026D2)
MXC_DCD_ITEM(55, MMDC_P0_BASE_ADDR + 0x030, 0x008F0E21)
MXC_DCD_ITEM(56, MMDC_P0_BASE_ADDR + 0x008, 0x09444040)
MXC_DCD_ITEM(57, MMDC_P0_BASE_ADDR + 0x004, 0x00020036)
MXC_DCD_ITEM(58, MMDC_P0_BASE_ADDR + 0x040, 0x00000047)
MXC_DCD_ITEM(59, MMDC_P0_BASE_ADDR + 0x000, 0x841A0000)
MXC_DCD_ITEM(60, MMDC_P0_BASE_ADDR + 0x01c, 0x04088032)
MXC_DCD_ITEM(61, MMDC_P0_BASE_ADDR + 0x01c, 0x00008033)
MXC_DCD_ITEM(62, MMDC_P0_BASE_ADDR + 0x01c, 0x00428031)
MXC_DCD_ITEM(63, MMDC_P0_BASE_ADDR + 0x01c, 0x09408030)
MXC_DCD_ITEM(64, MMDC_P0_BASE_ADDR + 0x01c, 0x04008040)
MXC_DCD_ITEM(65, MMDC_P0_BASE_ADDR + 0x800, 0xA1380003)
MXC_DCD_ITEM(66, MMDC_P0_BASE_ADDR + 0x020, 0x00005800)
MXC_DCD_ITEM(67, MMDC_P0_BASE_ADDR + 0x818, 0x00022227)
MXC_DCD_ITEM(68, MMDC_P1_BASE_ADDR + 0x818, 0x00022227)
/* Calibration values based on ARD and 528MHz */
MXC_DCD_ITEM(69, MMDC_P0_BASE_ADDR + 0x83c, 0x434B0358)
MXC_DCD_ITEM(70, MMDC_P0_BASE_ADDR + 0x840, 0x033D033C)
MXC_DCD_ITEM(71, MMDC_P1_BASE_ADDR + 0x83c, 0x03520362)
MXC_DCD_ITEM(72, MMDC_P1_BASE_ADDR + 0x840, 0x03480318)
MXC_DCD_ITEM(73, MMDC_P0_BASE_ADDR + 0x848, 0x41383A3C)
MXC_DCD_ITEM(74, MMDC_P1_BASE_ADDR + 0x848, 0x3F3C374A)
MXC_DCD_ITEM(75, MMDC_P0_BASE_ADDR + 0x850, 0x42434444)
MXC_DCD_ITEM(76, MMDC_P1_BASE_ADDR + 0x850, 0x4932473A)
MXC_DCD_ITEM(77, MMDC_P0_BASE_ADDR + 0x80c, 0x001F001F)
MXC_DCD_ITEM(78, MMDC_P0_BASE_ADDR + 0x810, 0x001F001F)
MXC_DCD_ITEM(79, MMDC_P1_BASE_ADDR + 0x80c, 0x001F001F)
MXC_DCD_ITEM(80, MMDC_P1_BASE_ADDR + 0x810, 0x001F001F)
MXC_DCD_ITEM(81, MMDC_P0_BASE_ADDR + 0x8b8, 0x00000800)
MXC_DCD_ITEM(82, MMDC_P1_BASE_ADDR + 0x8b8, 0x00000800)
MXC_DCD_ITEM(83, MMDC_P0_BASE_ADDR + 0x404, 0x00011006)
MXC_DCD_ITEM(84, MMDC_P0_BASE_ADDR + 0x004, 0x00025576)
MXC_DCD_ITEM(85, MMDC_P0_BASE_ADDR + 0x01c, 0x00000000)
/* enable AXI cache for VDOA/VPU/IPU */
MXC_DCD_ITEM(86, IOMUXC_BASE_ADDR + 0x010, 0xf00000ff)
/* set IPU Qos=0x7 */
MXC_DCD_ITEM(87, IOMUXC_BASE_ADDR + 0x018, 0x00070007)
MXC_DCD_ITEM(88, IOMUXC_BASE_ADDR + 0x01c, 0x00070007)
#endif
#endif

View File

@ -0,0 +1,167 @@
/*
* Copyright (C) 2010-2011 Freescale Semiconductor, Inc.
*
* 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.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
*/
#include <config.h>
#include <asm/arch/mx6.h>
/*
Disable L2Cache because ROM turn it on when uboot use plug-in.
If L2Cache is on default, there are cache coherence problem if kernel have
not config L2Cache.
*/
.macro init_l2cc
ldr r1, =0xa02000
ldr r0, =0x0
str r0, [r1, #0x100]
.endm /* init_l2cc */
/* invalidate the D-CACHE */
.macro inv_dcache
mov r0,#0
mcr p15,2,r0,c0,c0,0 /* cache size selection register, select dcache */
mrc p15,1,r0,c0,c0,0 /* cache size ID register */
mov r0,r0,ASR #13
ldr r3,=0xfff
and r0,r0,r3
cmp r0,#0x7f
moveq r6,#0x1000
beq size_done
cmp r0,#0xff
moveq r6,#0x2000
movne r6,#0x4000
size_done:
mov r2,#0
mov r3,#0x40000000
mov r4,#0x80000000
mov r5,#0xc0000000
d_inv_loop:
mcr p15,0,r2,c7,c6,2 /* invalidate dcache by set / way */
mcr p15,0,r3,c7,c6,2 /* invalidate dcache by set / way */
mcr p15,0,r4,c7,c6,2 /* invalidate dcache by set / way */
mcr p15,0,r5,c7,c6,2 /* invalidate dcache by set / way */
add r2,r2,#0x20
add r3,r3,#0x20
add r4,r4,#0x20
add r5,r5,#0x20
cmp r2,r6
bne d_inv_loop
.endm
/* AIPS setup - Only setup MPROTx registers.
* The PACR default values are good.*/
.macro init_aips
/*
* Set all MPROTx to be non-bufferable, trusted for R/W,
* not forced to user-mode.
*/
ldr r0, =AIPS1_ON_BASE_ADDR
ldr r1, =0x77777777
str r1, [r0, #0x0]
str r1, [r0, #0x4]
ldr r1, =0x0
str r1, [r0, #0x40]
str r1, [r0, #0x44]
str r1, [r0, #0x48]
str r1, [r0, #0x4C]
str r1, [r0, #0x50]
ldr r0, =AIPS2_ON_BASE_ADDR
ldr r1, =0x77777777
str r1, [r0, #0x0]
str r1, [r0, #0x4]
ldr r1, =0x0
str r1, [r0, #0x40]
str r1, [r0, #0x44]
str r1, [r0, #0x48]
str r1, [r0, #0x4C]
str r1, [r0, #0x50]
.endm /* init_aips */
.macro setup_pll pll, freq
.endm
.macro init_clock
/* PLL1, PLL2, and PLL3 are enabled by ROM */
#ifdef CONFIG_PLL3
/* enable PLL3 for UART */
ldr r0, ANATOP_BASE_ADDR_W
/* power up PLL */
ldr r1, [r0, #ANATOP_USB1]
orr r1, r1, #0x1000
str r1, [r0, #ANATOP_USB1]
/* enable PLL */
ldr r1, [r0, #ANATOP_USB1]
orr r1, r1, #0x2000
str r1, [r0, #ANATOP_USB1]
/* wait PLL lock */
100:
ldr r1, [r0, #ANATOP_USB1]
mov r1, r1, lsr #31
cmp r1, #0x1
bne 100b
/* clear bypass bit */
ldr r1, [r0, #ANATOP_USB1]
and r1, r1, #0xfffeffff
str r1, [r0, #ANATOP_USB1]
#endif
/* Restore the default values in the Gate registers */
ldr r0, CCM_BASE_ADDR_W
ldr r1, =0xC0003F
str r1, [r0, #CLKCTL_CCGR0]
ldr r1, =0x30FC00
str r1, [r0, #CLKCTL_CCGR1]
ldr r1, =0xFFFC000
str r1, [r0, #CLKCTL_CCGR2]
ldr r1, =0x3FF00000
str r1, [r0, #CLKCTL_CCGR3]
ldr r1, =0xFFF300
str r1, [r0, #CLKCTL_CCGR4]
ldr r1, =0xF0000C3
str r1, [r0, #CLKCTL_CCGR5]
ldr r1, =0x3FC
str r1, [r0, #CLKCTL_CCGR6]
.endm
.section ".text.init", "x"
.globl lowlevel_init
lowlevel_init:
inv_dcache
init_l2cc
init_aips
init_clock
mov pc, lr
/* Board level setting value */
ANATOP_BASE_ADDR_W: .word ANATOP_BASE_ADDR
CCM_BASE_ADDR_W: .word CCM_BASE_ADDR

View File

@ -0,0 +1,876 @@
/*
* Copyright (C) 2010-2012 Freescale Semiconductor, Inc.
*
* See file CREDITS for list of people who contributed to this
* project.
*
* 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.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
*/
#include <common.h>
#include <asm/io.h>
#include <asm/arch/mx6.h>
#include <asm/arch/mx6_pins.h>
#include <asm/arch/iomux-v3.h>
#include <asm/errno.h>
#include <miiphy.h>
#if defined(CONFIG_VIDEO_MX5)
#include <linux/list.h>
#include <linux/fb.h>
#include <linux/mxcfb.h>
#include <ipu.h>
#include <lcd.h>
#endif
#ifdef CONFIG_IMX_ECSPI
#include <imx_spi.h>
#endif
#if CONFIG_I2C_MXC
#include <i2c.h>
#endif
#ifdef CONFIG_CMD_MMC
#include <mmc.h>
#include <fsl_esdhc.h>
#endif
#ifdef CONFIG_ARCH_MMU
#include <asm/mmu.h>
#include <asm/arch/mmu.h>
#endif
#ifdef CONFIG_CMD_CLOCK
#include <asm/clock.h>
#endif
DECLARE_GLOBAL_DATA_PTR;
static u32 system_rev;
static enum boot_device boot_dev;
#ifdef CONFIG_VIDEO_MX5
extern unsigned char fsl_bmp_600x400[];
extern int fsl_bmp_600x400_size;
extern int g_ipu_hw_rev;
#if defined(CONFIG_BMP_8BPP)
unsigned short colormap[256];
#elif defined(CONFIG_BMP_16BPP)
unsigned short colormap[65536];
#else
unsigned short colormap[16777216];
#endif
static int di = 1;
extern int ipuv3_fb_init(struct fb_videomode *mode, int di,
int interface_pix_fmt,
ipu_di_clk_parent_t di_clk_parent,
int di_clk_val);
static struct fb_videomode lvds_xga = {
"XGA", 60, 1024, 768, 15385, 220, 40, 21, 7, 60, 10,
FB_SYNC_EXT,
FB_VMODE_NONINTERLACED,
0,
};
vidinfo_t panel_info;
#endif
static void set_gpio_output_val(unsigned base, unsigned mask, unsigned val)
{
unsigned reg = readl(base + GPIO_DR);
if (val & 1)
reg |= mask; /* set high */
else
reg &= ~mask; /* clear low */
writel(reg, base + GPIO_DR);
reg = readl(base + GPIO_GDIR);
reg |= mask; /* configure GPIO line as output */
writel(reg, base + GPIO_GDIR);
}
static inline void setup_boot_device(void)
{
uint soc_sbmr = readl(SRC_BASE_ADDR + 0x4);
uint bt_mem_ctl = (soc_sbmr & 0x000000FF) >> 4 ;
uint bt_mem_type = (soc_sbmr & 0x00000008) >> 3;
switch (bt_mem_ctl) {
case 0x0:
if (bt_mem_type)
boot_dev = ONE_NAND_BOOT;
else
boot_dev = WEIM_NOR_BOOT;
break;
case 0x2:
boot_dev = SATA_BOOT;
break;
case 0x3:
if (bt_mem_type)
boot_dev = I2C_BOOT;
else
boot_dev = SPI_NOR_BOOT;
break;
case 0x4:
case 0x5:
boot_dev = SD_BOOT;
break;
case 0x6:
case 0x7:
boot_dev = MMC_BOOT;
break;
case 0x8 ... 0xf:
boot_dev = NAND_BOOT;
break;
default:
boot_dev = UNKNOWN_BOOT;
break;
}
}
enum boot_device get_boot_device(void)
{
return boot_dev;
}
u32 get_board_rev(void)
{
system_rev = 0x63000;
return system_rev;
}
#ifdef CONFIG_ARCH_MMU
void board_mmu_init(void)
{
unsigned long ttb_base = PHYS_SDRAM_1 + 0x4000;
unsigned long i;
/*
* Set the TTB register
*/
asm volatile ("mcr p15,0,%0,c2,c0,0" : : "r"(ttb_base) /*:*/);
/*
* Set the Domain Access Control Register
*/
i = ARM_ACCESS_DACR_DEFAULT;
asm volatile ("mcr p15,0,%0,c3,c0,0" : : "r"(i) /*:*/);
/*
* First clear all TT entries - ie Set them to Faulting
*/
memset((void *)ttb_base, 0, ARM_FIRST_LEVEL_PAGE_TABLE_SIZE);
/* Actual Virtual Size Attributes Function */
/* Base Base MB cached? buffered? access permissions */
/* xxx00000 xxx00000 */
X_ARM_MMU_SECTION(0x000, 0x000, 0x001,
ARM_UNCACHEABLE, ARM_UNBUFFERABLE,
ARM_ACCESS_PERM_RW_RW); /* ROM, 1M */
X_ARM_MMU_SECTION(0x001, 0x001, 0x008,
ARM_UNCACHEABLE, ARM_UNBUFFERABLE,
ARM_ACCESS_PERM_RW_RW); /* 8M */
X_ARM_MMU_SECTION(0x009, 0x009, 0x001,
ARM_UNCACHEABLE, ARM_UNBUFFERABLE,
ARM_ACCESS_PERM_RW_RW); /* IRAM */
X_ARM_MMU_SECTION(0x00A, 0x00A, 0x0F6,
ARM_UNCACHEABLE, ARM_UNBUFFERABLE,
ARM_ACCESS_PERM_RW_RW); /* 246M */
/* 2 GB memory starting at 0x10000000, only map 1.875 GB */
X_ARM_MMU_SECTION(0x100, 0x100, 0x780,
ARM_CACHEABLE, ARM_BUFFERABLE,
ARM_ACCESS_PERM_RW_RW);
/* uncached alias of the same 1.875 GB memory */
X_ARM_MMU_SECTION(0x100, 0x880, 0x780,
ARM_UNCACHEABLE, ARM_UNBUFFERABLE,
ARM_ACCESS_PERM_RW_RW);
/* Enable MMU */
MMU_ON();
}
#endif
#ifdef CONFIG_DWC_AHSATA
#define ANATOP_PLL_LOCK 0x80000000
#define ANATOP_PLL_ENABLE_MASK 0x00002000
#define ANATOP_PLL_BYPASS_MASK 0x00010000
#define ANATOP_PLL_LOCK 0x80000000
#define ANATOP_PLL_PWDN_MASK 0x00001000
#define ANATOP_PLL_HOLD_RING_OFF_MASK 0x00000800
#define ANATOP_SATA_CLK_ENABLE_MASK 0x00100000
int setup_sata(void)
{
u32 reg = 0;
s32 timeout = 100000;
/* Enable sata clock */
reg = readl(CCM_BASE_ADDR + 0x7c); /* CCGR5 */
reg |= 0x30;
writel(reg, CCM_BASE_ADDR + 0x7c);
/* Enable PLLs */
reg = readl(ANATOP_BASE_ADDR + 0xe0); /* ENET PLL */
reg &= ~ANATOP_PLL_PWDN_MASK;
writel(reg, ANATOP_BASE_ADDR + 0xe0);
reg |= ANATOP_PLL_ENABLE_MASK;
while (timeout--) {
if (readl(ANATOP_BASE_ADDR + 0xe0) & ANATOP_PLL_LOCK)
break;
}
if (timeout <= 0)
return -1;
reg &= ~ANATOP_PLL_BYPASS_MASK;
writel(reg, ANATOP_BASE_ADDR + 0xe0);
reg |= ANATOP_SATA_CLK_ENABLE_MASK;
writel(reg, ANATOP_BASE_ADDR + 0xe0);
/* Enable sata phy */
reg = readl(IOMUXC_BASE_ADDR + 0x34); /* GPR13 */
reg &= ~0x07ffffff;
/*
* rx_eq_val_0 = 5 [26:24]
* los_lvl = 0x12 [23:19]
* rx_dpll_mode_0 = 0x3 [18:16]
* mpll_ss_en = 0x0 [14]
* tx_atten_0 = 0x4 [13:11]
* tx_boost_0 = 0x0 [10:7]
* tx_lvl = 0x11 [6:2]
* mpll_ck_off_b = 0x1 [1]
* tx_edgerate_0 = 0x0 [0]
* */
reg |= 0x59124c6;
writel(reg, IOMUXC_BASE_ADDR + 0x34);
return 0;
}
#endif
int dram_init(void)
{
gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
return 0;
}
static void setup_uart(void)
{
/* UART4 TXD */
mxc_iomux_v3_setup_pad(MX6Q_PAD_KEY_COL0__UART4_TXD);
/* UART4 RXD */
mxc_iomux_v3_setup_pad(MX6Q_PAD_KEY_ROW0__UART4_RXD);
}
#ifdef CONFIG_VIDEO_MX5
#ifdef CONFIG_I2C_MXC
static void setup_i2c(unsigned int module_base)
{
unsigned int reg;
switch (module_base) {
case I2C1_BASE_ADDR:
/* i2c1 SDA */
mxc_iomux_v3_setup_pad(MX6Q_PAD_CSI0_DAT8__I2C1_SDA);
/* i2c1 SCL */
mxc_iomux_v3_setup_pad(MX6Q_PAD_CSI0_DAT9__I2C1_SCL);
/* Enable i2c clock */
reg = readl(CCM_BASE_ADDR + CLKCTL_CCGR2);
reg |= 0xC0;
writel(reg, CCM_BASE_ADDR + CLKCTL_CCGR2);
break;
case I2C2_BASE_ADDR:
/* i2c2 SDA */
mxc_iomux_v3_setup_pad(MX6Q_PAD_KEY_ROW3__I2C2_SDA);
/* i2c2 SCL */
mxc_iomux_v3_setup_pad(MX6Q_PAD_KEY_COL3__I2C2_SCL);
/* Enable i2c clock */
reg = readl(CCM_BASE_ADDR + CLKCTL_CCGR2);
reg |= 0x300;
writel(reg, CCM_BASE_ADDR + CLKCTL_CCGR2);
break;
case I2C3_BASE_ADDR:
/* GPIO_3 for I2C3_SCL */
mxc_iomux_v3_setup_pad(MX6Q_PAD_GPIO_3__I2C3_SCL);
/* GPIO_16 for I2C3_SDA */
mxc_iomux_v3_setup_pad(MX6Q_PAD_GPIO_16__I2C3_SDA);
/* Enable i2c clock */
reg = readl(CCM_BASE_ADDR + CLKCTL_CCGR2);
reg |= 0xC00;
writel(reg, CCM_BASE_ADDR + CLKCTL_CCGR2);
break;
default:
printf("Invalid I2C base: 0x%x\n", module_base);
break;
}
}
void setup_lvds_poweron(void)
{
uchar value;
i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE);
i2c_read(0x30, 3, 1, &value, 1);
value &= ~0x2;
i2c_write(0x30, 3, 1, &value, 1);
i2c_read(0x30, 1, 1, &value, 1);
value |= 0x2;
i2c_write(0x30, 1, 1, &value, 1);
}
#endif
#endif
#ifdef CONFIG_IMX_ECSPI
s32 spi_get_cfg(struct imx_spi_dev_t *dev)
{
switch (dev->slave.cs) {
case 0:
/* SPI-NOR */
dev->base = ECSPI1_BASE_ADDR;
dev->freq = 25000000;
dev->ss_pol = IMX_SPI_ACTIVE_LOW;
dev->ss = 0;
dev->fifo_sz = 64 * 4;
dev->us_delay = 0;
break;
case 1:
/* SPI-NOR */
dev->base = ECSPI1_BASE_ADDR;
dev->freq = 25000000;
dev->ss_pol = IMX_SPI_ACTIVE_LOW;
dev->ss = 1;
dev->fifo_sz = 64 * 4;
dev->us_delay = 0;
break;
default:
printf("Invalid Bus ID!\n");
}
return 0;
}
void spi_io_init(struct imx_spi_dev_t *dev)
{
u32 reg;
switch (dev->base) {
case ECSPI1_BASE_ADDR:
/* Enable clock */
reg = readl(CCM_BASE_ADDR + CLKCTL_CCGR1);
reg |= 0x3;
writel(reg, CCM_BASE_ADDR + CLKCTL_CCGR1);
/* SCLK */
mxc_iomux_v3_setup_pad(MX6Q_PAD_EIM_D16__ECSPI1_SCLK);
/* MISO */
mxc_iomux_v3_setup_pad(MX6Q_PAD_EIM_D17__ECSPI1_MISO);
/* MOSI */
mxc_iomux_v3_setup_pad(MX6Q_PAD_EIM_D18__ECSPI1_MOSI);
if (dev->ss == 0)
mxc_iomux_v3_setup_pad(MX6Q_PAD_EIM_EB2__ECSPI1_SS0);
else if (dev->ss == 1)
mxc_iomux_v3_setup_pad(MX6Q_PAD_EIM_D19__ECSPI1_SS1);
break;
case ECSPI2_BASE_ADDR:
case ECSPI3_BASE_ADDR:
/* ecspi2-3 fall through */
break;
default:
break;
}
}
#endif
#ifdef CONFIG_NAND_GPMI
iomux_v3_cfg_t nfc_pads[] = {
MX6Q_PAD_NANDF_CLE__RAWNAND_CLE,
MX6Q_PAD_NANDF_ALE__RAWNAND_ALE,
MX6Q_PAD_NANDF_WP_B__RAWNAND_RESETN,
MX6Q_PAD_NANDF_RB0__RAWNAND_READY0,
MX6Q_PAD_NANDF_CS0__RAWNAND_CE0N,
MX6Q_PAD_NANDF_CS1__RAWNAND_CE1N,
MX6Q_PAD_NANDF_CS2__RAWNAND_CE2N,
MX6Q_PAD_NANDF_CS3__RAWNAND_CE3N,
MX6Q_PAD_SD4_CMD__RAWNAND_RDN,
MX6Q_PAD_SD4_CLK__RAWNAND_WRN,
MX6Q_PAD_NANDF_D0__RAWNAND_D0,
MX6Q_PAD_NANDF_D1__RAWNAND_D1,
MX6Q_PAD_NANDF_D2__RAWNAND_D2,
MX6Q_PAD_NANDF_D3__RAWNAND_D3,
MX6Q_PAD_NANDF_D4__RAWNAND_D4,
MX6Q_PAD_NANDF_D5__RAWNAND_D5,
MX6Q_PAD_NANDF_D6__RAWNAND_D6,
MX6Q_PAD_NANDF_D7__RAWNAND_D7,
MX6Q_PAD_SD4_DAT0__RAWNAND_DQS,
};
int setup_gpmi_nand(void)
{
unsigned int reg;
/* config gpmi nand iomux */
mxc_iomux_v3_setup_multiple_pads(nfc_pads,
ARRAY_SIZE(nfc_pads));
/* config gpmi and bch clock to 11Mhz*/
reg = readl(CCM_BASE_ADDR + CLKCTL_CS2CDR);
reg &= 0xF800FFFF;
reg |= 0x01E40000;
writel(reg, CCM_BASE_ADDR + CLKCTL_CS2CDR);
/* enable gpmi and bch clock gating */
reg = readl(CCM_BASE_ADDR + CLKCTL_CCGR4);
reg |= 0xFF003000;
writel(reg, CCM_BASE_ADDR + CLKCTL_CCGR4);
/* enable apbh clock gating */
reg = readl(CCM_BASE_ADDR + CLKCTL_CCGR0);
reg |= 0x0030;
writel(reg, CCM_BASE_ADDR + CLKCTL_CCGR0);
}
#endif
#ifdef CONFIG_NET_MULTI
int board_eth_init(bd_t *bis)
{
int rc = -ENODEV;
return rc;
}
#endif
#ifdef CONFIG_CMD_MMC
/* On this board, only SD3 can support 1.8V signalling
* that is required for UHS-I mode of operation.
* Last element in struct is used to indicate 1.8V support.
*/
struct fsl_esdhc_cfg usdhc_cfg[4] = {
{USDHC1_BASE_ADDR, 1, 1, 1, 0},
{USDHC2_BASE_ADDR, 1, 1, 1, 0},
{USDHC3_BASE_ADDR, 1, 1, 1, 1},
{USDHC4_BASE_ADDR, 1, 1, 1, 0},
};
#ifdef CONFIG_DYNAMIC_MMC_DEVNO
int get_mmc_env_devno(void)
{
uint soc_sbmr = readl(SRC_BASE_ADDR + 0x4);
if (SD_BOOT == boot_dev || MMC_BOOT == boot_dev) {
/* BOOT_CFG2[3] and BOOT_CFG2[4] */
return (soc_sbmr & 0x00001800) >> 11;
} else
return -1;
}
#endif
iomux_v3_cfg_t mx6q_usdhc1_pads[] = {
MX6Q_PAD_SD1_CLK__USDHC1_CLK,
MX6Q_PAD_SD1_CMD__USDHC1_CMD,
MX6Q_PAD_SD1_DAT0__USDHC1_DAT0,
MX6Q_PAD_SD1_DAT1__USDHC1_DAT1,
MX6Q_PAD_SD1_DAT2__USDHC1_DAT2,
MX6Q_PAD_SD1_DAT3__USDHC1_DAT3,
};
iomux_v3_cfg_t mx6q_usdhc2_pads[] = {
MX6Q_PAD_SD2_CLK__USDHC2_CLK,
MX6Q_PAD_SD2_CMD__USDHC2_CMD,
MX6Q_PAD_SD2_DAT0__USDHC2_DAT0,
MX6Q_PAD_SD2_DAT1__USDHC2_DAT1,
MX6Q_PAD_SD2_DAT2__USDHC2_DAT2,
MX6Q_PAD_SD2_DAT3__USDHC2_DAT3,
};
iomux_v3_cfg_t mx6q_usdhc3_pads[] = {
MX6Q_PAD_SD3_CLK__USDHC3_CLK,
MX6Q_PAD_SD3_CMD__USDHC3_CMD,
MX6Q_PAD_SD3_DAT0__USDHC3_DAT0,
MX6Q_PAD_SD3_DAT1__USDHC3_DAT1,
MX6Q_PAD_SD3_DAT2__USDHC3_DAT2,
MX6Q_PAD_SD3_DAT3__USDHC3_DAT3,
MX6Q_PAD_SD3_DAT4__USDHC3_DAT4,
MX6Q_PAD_SD3_DAT5__USDHC3_DAT5,
MX6Q_PAD_SD3_DAT6__USDHC3_DAT6,
MX6Q_PAD_SD3_DAT7__USDHC3_DAT7,
};
iomux_v3_cfg_t mx6q_usdhc4_pads[] = {
MX6Q_PAD_SD4_CLK__USDHC4_CLK,
MX6Q_PAD_SD4_CMD__USDHC4_CMD,
MX6Q_PAD_SD4_DAT0__USDHC4_DAT0,
MX6Q_PAD_SD4_DAT1__USDHC4_DAT1,
MX6Q_PAD_SD4_DAT2__USDHC4_DAT2,
MX6Q_PAD_SD4_DAT3__USDHC4_DAT3,
MX6Q_PAD_SD4_DAT4__USDHC4_DAT4,
MX6Q_PAD_SD4_DAT5__USDHC4_DAT5,
MX6Q_PAD_SD4_DAT6__USDHC4_DAT6,
MX6Q_PAD_SD4_DAT7__USDHC4_DAT7,
};
int usdhc_gpio_init(bd_t *bis)
{
s32 status = 0;
u32 index = 0;
for (index = 0; index < CONFIG_SYS_FSL_USDHC_NUM;
++index) {
switch (index) {
case 0:
mxc_iomux_v3_setup_multiple_pads(mx6q_usdhc1_pads,
sizeof(mx6q_usdhc1_pads) /
sizeof(mx6q_usdhc1_pads[0]));
break;
case 1:
mxc_iomux_v3_setup_multiple_pads(mx6q_usdhc2_pads,
sizeof(mx6q_usdhc2_pads) /
sizeof(mx6q_usdhc2_pads[0]));
break;
case 2:
mxc_iomux_v3_setup_multiple_pads(mx6q_usdhc3_pads,
sizeof(mx6q_usdhc3_pads) /
sizeof(mx6q_usdhc3_pads[0]));
break;
case 3:
mxc_iomux_v3_setup_multiple_pads(mx6q_usdhc4_pads,
sizeof(mx6q_usdhc4_pads) /
sizeof(mx6q_usdhc4_pads[0]));
break;
default:
printf("Warning: you configured more USDHC controllers"
"(%d) then supported by the board (%d)\n",
index+1, CONFIG_SYS_FSL_USDHC_NUM);
return status;
}
status |= fsl_esdhc_initialize(bis, &usdhc_cfg[index]);
}
return status;
}
int board_mmc_init(bd_t *bis)
{
if (!usdhc_gpio_init(bis))
return 0;
else
return -1;
}
/* For DDR mode operation, provide target delay parameter for each SD port.
* Use cfg->esdhc_base to distinguish the SD port #. The delay for each port
* is dependent on signal layout for that particular port. If the following
* CONFIG is not defined, then the default target delay value will be used.
*/
#ifdef CONFIG_GET_DDR_TARGET_DELAY
u32 get_ddr_delay(struct fsl_esdhc_cfg *cfg)
{
/* No delay required on SABRE Auto board SD ports */
return 0;
}
#endif
#endif
#ifdef CONFIG_LCD
void lcd_enable(void)
{
char *s;
int ret;
unsigned int reg;
s = getenv("lvds_num");
di = simple_strtol(s, NULL, 10);
/*
* hw_rev 2: IPUV3DEX
* hw_rev 3: IPUV3M
* hw_rev 4: IPUV3H
*/
g_ipu_hw_rev = IPUV3_HW_REV_IPUV3H;
/* set GPIO_9 to high so that backlight control could be high */
mxc_iomux_v3_setup_pad(MX6Q_PAD_GPIO_9__GPIO_1_9);
reg = readl(GPIO1_BASE_ADDR + GPIO_GDIR);
reg |= (1 << 9);
writel(reg, GPIO1_BASE_ADDR + GPIO_GDIR);
reg = readl(GPIO1_BASE_ADDR + GPIO_DR);
reg |= (1 << 9);
writel(reg, GPIO1_BASE_ADDR + GPIO_DR);
/* Enable IPU clock */
if (di == 1) {
reg = readl(CCM_BASE_ADDR + CLKCTL_CCGR3);
reg |= 0xC033;
writel(reg, CCM_BASE_ADDR + CLKCTL_CCGR3);
} else {
reg = readl(CCM_BASE_ADDR + CLKCTL_CCGR3);
reg |= 0x300F;
writel(reg, CCM_BASE_ADDR + CLKCTL_CCGR3);
}
ret = ipuv3_fb_init(&lvds_xga, di, IPU_PIX_FMT_RGB666,
DI_PCLK_LDB, 65000000);
if (ret)
puts("LCD cannot be configured\n");
reg = readl(ANATOP_BASE_ADDR + 0xF0);
reg &= ~0x00003F00;
reg |= 0x00001300;
writel(reg, ANATOP_BASE_ADDR + 0xF4);
reg = readl(CCM_BASE_ADDR + CLKCTL_CS2CDR);
reg &= ~0x00007E00;
reg |= 0x00003600;
writel(reg, CCM_BASE_ADDR + CLKCTL_CS2CDR);
reg = readl(CCM_BASE_ADDR + CLKCTL_CSCMR2);
reg |= 0x00000C00;
writel(reg, CCM_BASE_ADDR + CLKCTL_CSCMR2);
reg = 0x0002A953;
writel(reg, CCM_BASE_ADDR + CLKCTL_CHSCCDR);
if (di == 1)
writel(0x40C, IOMUXC_BASE_ADDR + 0x8);
else
writel(0x201, IOMUXC_BASE_ADDR + 0x8);
}
#endif
#ifdef CONFIG_VIDEO_MX5
void panel_info_init(void)
{
panel_info.vl_bpix = LCD_BPP;
panel_info.vl_col = lvds_xga.xres;
panel_info.vl_row = lvds_xga.yres;
panel_info.cmap = colormap;
}
#endif
#ifdef CONFIG_SPLASH_SCREEN
void setup_splash_image(void)
{
char *s;
ulong addr;
s = getenv("splashimage");
if (s != NULL) {
addr = simple_strtoul(s, NULL, 16);
#if defined(CONFIG_ARCH_MMU)
addr = ioremap_nocache(iomem_to_phys(addr),
fsl_bmp_600x400_size);
#endif
memcpy((char *)addr, (char *)fsl_bmp_600x400,
fsl_bmp_600x400_size);
}
}
#endif
int board_init(void)
{
mxc_iomux_v3_init((void *)IOMUXC_BASE_ADDR);
setup_boot_device();
/* board id for linux */
gd->bd->bi_arch_number = MACH_TYPE_MX6Q_SABREAUTO;
/* address of boot parameters */
gd->bd->bi_boot_params = PHYS_SDRAM_1 + 0x100;
setup_uart();
#ifdef CONFIG_DWC_AHSATA
setup_sata();
#endif
#ifdef CONFIG_VIDEO_MX5
#ifdef CONFIG_I2C_MXC
setup_i2c(CONFIG_SYS_I2C_PORT);
/* Enable lvds power */
setup_lvds_poweron();
#endif
panel_info_init();
gd->fb_base = CONFIG_FB_BASE;
#ifdef CONFIG_ARCH_MMU
gd->fb_base = ioremap_nocache(iomem_to_phys(gd->fb_base), 0);
#endif
#endif
#ifdef CONFIG_NAND_GPMI
setup_gpmi_nand();
#endif
return 0;
}
int board_late_init(void)
{
return 0;
}
static int phy_read(char *devname, unsigned char addr, unsigned char reg,
unsigned short *pdata)
{
int ret = miiphy_read(devname, addr, reg, pdata);
if (ret)
printf("Error reading from %s PHY addr=%02x reg=%02x\n",
devname, addr, reg);
return ret;
}
static int phy_write(char *devname, unsigned char addr, unsigned char reg,
unsigned short value)
{
int ret = miiphy_write(devname, addr, reg, value);
if (ret)
printf("Error writing to %s PHY addr=%02x reg=%02x\n", devname,
addr, reg);
return ret;
}
int mx6_rgmii_rework(char *devname, int phy_addr)
{
/* enable master mode, 1000 Base-T capable */
phy_write(devname, phy_addr, 0x9, 0x1f00);
/* min rx data delay */
phy_write(devname, phy_addr, 0x0b, 0x8105);
phy_write(devname, phy_addr, 0x0c, 0x0000);
/* max rx/tx clock delay, min rx/tx control delay */
phy_write(devname, phy_addr, 0x0b, 0x8104);
phy_write(devname, phy_addr, 0x0c, 0xf0f0);
phy_write(devname, phy_addr, 0x0b, 0x104);
return 0;
}
iomux_v3_cfg_t enet_pads[] = {
MX6Q_PAD_KEY_COL1__ENET_MDIO,
MX6Q_PAD_KEY_COL2__ENET_MDC,
MX6Q_PAD_RGMII_TXC__ENET_RGMII_TXC,
MX6Q_PAD_RGMII_TD0__ENET_RGMII_TD0,
MX6Q_PAD_RGMII_TD1__ENET_RGMII_TD1,
MX6Q_PAD_RGMII_TD2__ENET_RGMII_TD2,
MX6Q_PAD_RGMII_TD3__ENET_RGMII_TD3,
MX6Q_PAD_RGMII_TX_CTL__ENET_RGMII_TX_CTL,
MX6Q_PAD_ENET_REF_CLK__ENET_TX_CLK,
MX6Q_PAD_RGMII_RXC__ENET_RGMII_RXC,
MX6Q_PAD_RGMII_RD0__ENET_RGMII_RD0,
MX6Q_PAD_RGMII_RD1__ENET_RGMII_RD1,
MX6Q_PAD_RGMII_RD2__ENET_RGMII_RD2,
MX6Q_PAD_RGMII_RD3__ENET_RGMII_RD3,
MX6Q_PAD_RGMII_RX_CTL__ENET_RGMII_RX_CTL,
};
void enet_board_init(void)
{
unsigned int reg;
mxc_iomux_v3_setup_multiple_pads(enet_pads,
ARRAY_SIZE(enet_pads));
set_gpio_output_val(GPIO6_BASE_ADDR, (1 << 24), 1);
}
int checkboard(void)
{
printf("Board: MX6Q-SABREAUTO:[ ");
switch (__REG(SRC_BASE_ADDR + 0x8)) {
case 0x0001:
printf("POR");
break;
case 0x0009:
printf("RST");
break;
case 0x0010:
case 0x0011:
printf("WDOG");
break;
default:
printf("unknown");
}
printf(" ]\n");
printf("Boot Device: ");
switch (get_boot_device()) {
case WEIM_NOR_BOOT:
printf("NOR\n");
break;
case ONE_NAND_BOOT:
printf("ONE NAND\n");
break;
case PATA_BOOT:
printf("PATA\n");
break;
case SATA_BOOT:
printf("SATA\n");
break;
case I2C_BOOT:
printf("I2C\n");
break;
case SPI_NOR_BOOT:
printf("SPI NOR\n");
break;
case SD_BOOT:
printf("SD\n");
break;
case MMC_BOOT:
printf("MMC\n");
break;
case NAND_BOOT:
printf("NAND\n");
break;
case UNKNOWN_BOOT:
default:
printf("UNKNOWN\n");
break;
}
return 0;
}

View File

@ -0,0 +1,74 @@
/*
* January 2004 - Changed to support H4 device
* Copyright (c) 2004 Texas Instruments
*
* (C) Copyright 2002
* Gary Jennejohn, DENX Software Engineering, <gj@denx.de>
*
* (C) Copyright 2011 Freescale Semiconductor, Inc.
*
* See file CREDITS for list of people who contributed to this
* project.
*
* 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.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
*/
OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
OUTPUT_ARCH(arm)
ENTRY(_start)
SECTIONS
{
. = 0x00000000;
. = ALIGN(4);
.text :
{
/* WARNING - the following is hand-optimized to fit within */
/* the sector layout of our flash chips! XXX FIXME XXX */
board/freescale/mx6q_sabreauto/flash_header.o (.text.flasheader)
cpu/arm_cortexa8/start.o
board/freescale/mx6q_sabreauto/libmx6q_sabreauto.a (.text)
lib_arm/libarm.a (.text)
net/libnet.a (.text)
drivers/mtd/libmtd.a (.text)
drivers/mmc/libmmc.a (.text)
. = DEFINED(env_offset) ? env_offset : .;
common/env_embedded.o(.text)
*(.text)
}
. = ALIGN(4);
.rodata : { *(.rodata) }
. = ALIGN(4);
.data : { *(.data) }
. = ALIGN(4);
.got : { *(.got) }
. = .;
__u_boot_cmd_start = .;
.u_boot_cmd : { *(.u_boot_cmd) }
__u_boot_cmd_end = .;
. = ALIGN(4);
_end_of_copy = .; /* end_of ROM copy code here */
__bss_start = .;
.bss : { *(.bss) }
_end = .;
}

View File

@ -0,0 +1,47 @@
#
# (C) Copyright 2011 Freescale Semiconductor, Inc.
#
# 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.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
# MA 02111-1307 USA
#
include $(TOPDIR)/config.mk
LIB = $(obj)lib$(BOARD).a
COBJS := $(BOARD).o
SOBJS := lowlevel_init.o flash_header.o
SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c)
OBJS := $(addprefix $(obj),$(COBJS))
SOBJS := $(addprefix $(obj),$(SOBJS))
$(LIB): $(obj).depend $(OBJS) $(SOBJS)
$(AR) $(ARFLAGS) $@ $(OBJS) $(SOBJS)
clean:
rm -f $(SOBJS) $(OBJS)
distclean: clean
rm -f $(LIB) core *.bak .depend
#########################################################################
# defines $(obj).depend target
include $(SRCTREE)/rules.mk
sinclude $(obj).depend
#########################################################################

View File

@ -0,0 +1,7 @@
LDSCRIPT := $(SRCTREE)/board/$(VENDOR)/$(BOARD)/u-boot.lds
sinclude $(OBJTREE)/board/$(VENDOR)/$(BOARD)/config.tmp
ifndef TEXT_BASE
TEXT_BASE = 0x27800000
endif

View File

@ -0,0 +1,179 @@
/*
* Copyright (C) 2011 Freescale Semiconductor, Inc.
*
* 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.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
*/
#include <config.h>
#include <asm/arch/mx6.h>
#ifdef CONFIG_FLASH_HEADER
#ifndef CONFIG_FLASH_HEADER_OFFSET
# error "Must define the offset of flash header"
#endif
#define CPU_2_BE_32(l) \
((((l) & 0x000000FF) << 24) | \
(((l) & 0x0000FF00) << 8) | \
(((l) & 0x00FF0000) >> 8) | \
(((l) & 0xFF000000) >> 24))
#define MXC_DCD_ITEM(i, addr, val) \
dcd_node_##i: \
.word CPU_2_BE_32(addr) ; \
.word CPU_2_BE_32(val) ; \
.section ".text.flasheader", "x"
b _start
.org CONFIG_FLASH_HEADER_OFFSET
ivt_header: .word 0x402000D1 /* Tag=0xD1, Len=0x0020, Ver=0x40 */
app_code_jump_v: .word _start
reserv1: .word 0x0
dcd_ptr: .word dcd_hdr
boot_data_ptr: .word boot_data
self_ptr: .word ivt_header
app_code_csf: .word 0x0
reserv2: .word 0x0
boot_data: .word TEXT_BASE
image_len: .word _end_of_copy - TEXT_BASE + CONFIG_FLASH_HEADER_OFFSET
plugin: .word 0x0
dcd_hdr: .word 0x40F002D2 /* Tag=0xD2, Len=93*8 + 4 + 4, Ver=0x40 */
write_dcd_cmd: .word 0x04EC02CC /* Tag=0xCC, Len=93*8 + 4, Param=0x04 */
/* DCD */
MXC_DCD_ITEM(1, IOMUXC_BASE_ADDR + 0x5a8, 0x00000030)
MXC_DCD_ITEM(2, IOMUXC_BASE_ADDR + 0x5b0, 0x00000030)
MXC_DCD_ITEM(3, IOMUXC_BASE_ADDR + 0x524, 0x00000030)
MXC_DCD_ITEM(4, IOMUXC_BASE_ADDR + 0x51c, 0x00000030)
MXC_DCD_ITEM(5, IOMUXC_BASE_ADDR + 0x518, 0x00000030)
MXC_DCD_ITEM(6, IOMUXC_BASE_ADDR + 0x50c, 0x00000030)
MXC_DCD_ITEM(7, IOMUXC_BASE_ADDR + 0x5b8, 0x00000030)
MXC_DCD_ITEM(8, IOMUXC_BASE_ADDR + 0x5c0, 0x00000030)
MXC_DCD_ITEM(9, IOMUXC_BASE_ADDR + 0x5ac, 0x00020030)
MXC_DCD_ITEM(10, IOMUXC_BASE_ADDR + 0x5b4, 0x00020030)
MXC_DCD_ITEM(11, IOMUXC_BASE_ADDR + 0x528, 0x00020030)
MXC_DCD_ITEM(12, IOMUXC_BASE_ADDR + 0x520, 0x00020030)
MXC_DCD_ITEM(13, IOMUXC_BASE_ADDR + 0x514, 0x00020030)
MXC_DCD_ITEM(14, IOMUXC_BASE_ADDR + 0x510, 0x00020030)
MXC_DCD_ITEM(15, IOMUXC_BASE_ADDR + 0x5bc, 0x00020030)
MXC_DCD_ITEM(16, IOMUXC_BASE_ADDR + 0x5c4, 0x00020030)
MXC_DCD_ITEM(17, IOMUXC_BASE_ADDR + 0x56c, 0x00020030)
MXC_DCD_ITEM(18, IOMUXC_BASE_ADDR + 0x578, 0x00020030)
MXC_DCD_ITEM(19, IOMUXC_BASE_ADDR + 0x588, 0x00020030)
MXC_DCD_ITEM(20, IOMUXC_BASE_ADDR + 0x594, 0x00020030)
MXC_DCD_ITEM(21, IOMUXC_BASE_ADDR + 0x57c, 0x00020030)
MXC_DCD_ITEM(22, IOMUXC_BASE_ADDR + 0x590, 0x00003000)
MXC_DCD_ITEM(23, IOMUXC_BASE_ADDR + 0x598, 0x00003000)
MXC_DCD_ITEM(24, IOMUXC_BASE_ADDR + 0x58c, 0x00000000)
MXC_DCD_ITEM(25, IOMUXC_BASE_ADDR + 0x59c, 0x00003030)
MXC_DCD_ITEM(26, IOMUXC_BASE_ADDR + 0x5a0, 0x00003030)
MXC_DCD_ITEM(27, IOMUXC_BASE_ADDR + 0x784, 0x00000030)
MXC_DCD_ITEM(28, IOMUXC_BASE_ADDR + 0x788, 0x00000030)
MXC_DCD_ITEM(29, IOMUXC_BASE_ADDR + 0x794, 0x00000030)
MXC_DCD_ITEM(30, IOMUXC_BASE_ADDR + 0x79c, 0x00000030)
MXC_DCD_ITEM(31, IOMUXC_BASE_ADDR + 0x7a0, 0x00000030)
MXC_DCD_ITEM(32, IOMUXC_BASE_ADDR + 0x7a4, 0x00000030)
MXC_DCD_ITEM(33, IOMUXC_BASE_ADDR + 0x7a8, 0x00000030)
MXC_DCD_ITEM(34, IOMUXC_BASE_ADDR + 0x748, 0x00000030)
MXC_DCD_ITEM(35, IOMUXC_BASE_ADDR + 0x74c, 0x00000030)
MXC_DCD_ITEM(36, IOMUXC_BASE_ADDR + 0x750, 0x00020000)
MXC_DCD_ITEM(37, IOMUXC_BASE_ADDR + 0x758, 0x00000000)
MXC_DCD_ITEM(38, IOMUXC_BASE_ADDR + 0x774, 0x00020000)
MXC_DCD_ITEM(39, IOMUXC_BASE_ADDR + 0x78c, 0x00000030)
MXC_DCD_ITEM(40, IOMUXC_BASE_ADDR + 0x798, 0x000C0000)
MXC_DCD_ITEM(41, MMDC_P0_BASE_ADDR + 0x81c, 0x33333333)
MXC_DCD_ITEM(42, MMDC_P0_BASE_ADDR + 0x820, 0x33333333)
MXC_DCD_ITEM(43, MMDC_P0_BASE_ADDR + 0x824, 0x33333333)
MXC_DCD_ITEM(44, MMDC_P0_BASE_ADDR + 0x828, 0x33333333)
MXC_DCD_ITEM(45, MMDC_P1_BASE_ADDR + 0x81c, 0x33333333)
MXC_DCD_ITEM(46, MMDC_P1_BASE_ADDR + 0x820, 0x33333333)
MXC_DCD_ITEM(47, MMDC_P1_BASE_ADDR + 0x824, 0x33333333)
MXC_DCD_ITEM(48, MMDC_P1_BASE_ADDR + 0x828, 0x33333333)
MXC_DCD_ITEM(49, MMDC_P0_BASE_ADDR + 0x018, 0x00081740)
MXC_DCD_ITEM(50, MMDC_P0_BASE_ADDR + 0x01c, 0x00008000)
MXC_DCD_ITEM(51, MMDC_P0_BASE_ADDR + 0x00c, 0x555A7975)
MXC_DCD_ITEM(52, MMDC_P0_BASE_ADDR + 0x010, 0xFF538E64)
MXC_DCD_ITEM(53, MMDC_P0_BASE_ADDR + 0x014, 0x01FF00DB)
MXC_DCD_ITEM(54, MMDC_P0_BASE_ADDR + 0x02c, 0x000026D2)
MXC_DCD_ITEM(55, MMDC_P0_BASE_ADDR + 0x030, 0x005B0E21)
MXC_DCD_ITEM(56, MMDC_P0_BASE_ADDR + 0x008, 0x09444040)
MXC_DCD_ITEM(57, MMDC_P0_BASE_ADDR + 0x004, 0x00025576)
MXC_DCD_ITEM(58, MMDC_P0_BASE_ADDR + 0x040, 0x00000027)
MXC_DCD_ITEM(59, MMDC_P0_BASE_ADDR + 0x000, 0x831A0000)
MXC_DCD_ITEM(60, MMDC_P0_BASE_ADDR + 0x01c, 0x04088032)
MXC_DCD_ITEM(61, MMDC_P0_BASE_ADDR + 0x01c, 0x0408803A)
MXC_DCD_ITEM(62, MMDC_P0_BASE_ADDR + 0x01c, 0x00008033)
MXC_DCD_ITEM(63, MMDC_P0_BASE_ADDR + 0x01c, 0x0000803B)
MXC_DCD_ITEM(64, MMDC_P0_BASE_ADDR + 0x01c, 0x00428031)
MXC_DCD_ITEM(65, MMDC_P0_BASE_ADDR + 0x01c, 0x00428039)
MXC_DCD_ITEM(66, MMDC_P0_BASE_ADDR + 0x01c, 0x09408030)
MXC_DCD_ITEM(67, MMDC_P0_BASE_ADDR + 0x01c, 0x09408038)
MXC_DCD_ITEM(68, MMDC_P0_BASE_ADDR + 0x01c, 0x04008040)
MXC_DCD_ITEM(69, MMDC_P0_BASE_ADDR + 0x01c, 0x04008048)
MXC_DCD_ITEM(70, MMDC_P0_BASE_ADDR + 0x800, 0xA1380003)
MXC_DCD_ITEM(71, MMDC_P1_BASE_ADDR + 0x800, 0xA1380003)
MXC_DCD_ITEM(72, MMDC_P0_BASE_ADDR + 0x020, 0x00005800)
MXC_DCD_ITEM(73, MMDC_P0_BASE_ADDR + 0x818, 0x00022227)
MXC_DCD_ITEM(74, MMDC_P1_BASE_ADDR + 0x818, 0x00022227)
MXC_DCD_ITEM(75, MMDC_P0_BASE_ADDR + 0x83c, 0x434B0350)
MXC_DCD_ITEM(76, MMDC_P0_BASE_ADDR + 0x840, 0x034C0359)
MXC_DCD_ITEM(77, MMDC_P1_BASE_ADDR + 0x83c, 0x434B0350)
MXC_DCD_ITEM(78, MMDC_P1_BASE_ADDR + 0x840, 0x03650348)
MXC_DCD_ITEM(79, MMDC_P0_BASE_ADDR + 0x848, 0x4436383B)
MXC_DCD_ITEM(80, MMDC_P1_BASE_ADDR + 0x848, 0x39393341)
MXC_DCD_ITEM(81, MMDC_P0_BASE_ADDR + 0x850, 0x35373933)
MXC_DCD_ITEM(82, MMDC_P1_BASE_ADDR + 0x850, 0x48254A36)
MXC_DCD_ITEM(83, MMDC_P0_BASE_ADDR + 0x80c, 0x001F001F)
MXC_DCD_ITEM(84, MMDC_P0_BASE_ADDR + 0x810, 0x001F001F)
MXC_DCD_ITEM(85, MMDC_P1_BASE_ADDR + 0x80c, 0x00440044)
MXC_DCD_ITEM(86, MMDC_P1_BASE_ADDR + 0x810, 0x00440044)
MXC_DCD_ITEM(87, MMDC_P0_BASE_ADDR + 0x8b8, 0x00000800)
MXC_DCD_ITEM(88, MMDC_P1_BASE_ADDR + 0x8b8, 0x00000800)
MXC_DCD_ITEM(89, MMDC_P0_BASE_ADDR + 0x01c, 0x00000000)
MXC_DCD_ITEM(90, MMDC_P0_BASE_ADDR + 0x404, 0x00011006)
/* enable AXI cache for VDOA/VPU/IPU */
MXC_DCD_ITEM(91, IOMUXC_BASE_ADDR + 0x010, 0xf00000ff)
/* set IPU AXI-id0 Qos=0xf(bypass) AXI-id1 Qos=0x7 */
MXC_DCD_ITEM(92, IOMUXC_BASE_ADDR + 0x018, 0x007f007f)
MXC_DCD_ITEM(93, IOMUXC_BASE_ADDR + 0x01c, 0x007f007f)
#endif

View File

@ -0,0 +1,163 @@
/*
* Copyright (C) 2011 Freescale Semiconductor, Inc.
*
* 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.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
*/
#include <config.h>
#include <asm/arch/mx6.h>
/*
Disable L2Cache because ROM turn it on when uboot use plug-in.
If L2Cache is on default, there are cache coherence problem if kernel have
not config L2Cache.
*/
.macro init_l2cc
ldr r1, =0xa02000
ldr r0, =0x0
str r0, [r1, #0x100]
.endm /* init_l2cc */
/* invalidate the D-CACHE */
.macro inv_dcache
mov r0,#0
mcr p15,2,r0,c0,c0,0 /* cache size selection register, select dcache */
mrc p15,1,r0,c0,c0,0 /* cache size ID register */
mov r0,r0,ASR #13
ldr r3,=0xfff
and r0,r0,r3
cmp r0,#0x7f
moveq r6,#0x1000
beq size_done
cmp r0,#0xff
moveq r6,#0x2000
movne r6,#0x4000
size_done:
mov r2,#0
mov r3,#0x40000000
mov r4,#0x80000000
mov r5,#0xc0000000
d_inv_loop:
mcr p15,0,r2,c7,c6,2 /* invalidate dcache by set / way */
mcr p15,0,r3,c7,c6,2 /* invalidate dcache by set / way */
mcr p15,0,r4,c7,c6,2 /* invalidate dcache by set / way */
mcr p15,0,r5,c7,c6,2 /* invalidate dcache by set / way */
add r2,r2,#0x20
add r3,r3,#0x20
add r4,r4,#0x20
add r5,r5,#0x20
cmp r2,r6
bne d_inv_loop
.endm
/* AIPS setup - Only setup MPROTx registers.
* The PACR default values are good.*/
.macro init_aips
/*
* Set all MPROTx to be non-bufferable, trusted for R/W,
* not forced to user-mode.
*/
ldr r0, =AIPS1_ON_BASE_ADDR
ldr r1, =0x77777777
str r1, [r0, #0x0]
str r1, [r0, #0x4]
ldr r1, =0x0
str r1, [r0, #0x40]
str r1, [r0, #0x44]
str r1, [r0, #0x48]
str r1, [r0, #0x4C]
str r1, [r0, #0x50]
ldr r0, =AIPS2_ON_BASE_ADDR
ldr r1, =0x77777777
str r1, [r0, #0x0]
str r1, [r0, #0x4]
ldr r1, =0x0
str r1, [r0, #0x40]
str r1, [r0, #0x44]
str r1, [r0, #0x48]
str r1, [r0, #0x4C]
str r1, [r0, #0x50]
.endm /* init_aips */
.macro setup_pll pll, freq
.endm
.macro init_clock
/* PLL1, PLL2, and PLL3 are enabled by ROM */
#ifdef CONFIG_PLL3
/* enable PLL3 for UART */
ldr r0, ANATOP_BASE_ADDR_W
/* power up PLL */
ldr r1, [r0, #ANATOP_USB1]
orr r1, r1, #0x1000
str r1, [r0, #ANATOP_USB1]
/* enable PLL */
ldr r1, [r0, #ANATOP_USB1]
orr r1, r1, #0x2000
str r1, [r0, #ANATOP_USB1]
/* wait PLL lock */
100:
ldr r1, [r0, #ANATOP_USB1]
mov r1, r1, lsr #31
cmp r1, #0x1
bne 100b
/* clear bypass bit */
ldr r1, [r0, #ANATOP_USB1]
and r1, r1, #0xfffeffff
str r1, [r0, #ANATOP_USB1]
#endif
/* Restore the default values in the Gate registers */
ldr r1, =0xFFFFFFFF
ldr r0, CCM_BASE_ADDR_W
str r1, [r0, #CLKCTL_CCGR0]
str r1, [r0, #CLKCTL_CCGR1]
str r1, [r0, #CLKCTL_CCGR2]
str r1, [r0, #CLKCTL_CCGR3]
str r1, [r0, #CLKCTL_CCGR4]
str r1, [r0, #CLKCTL_CCGR5]
str r1, [r0, #CLKCTL_CCGR6]
str r1, [r0, #CLKCTL_CCGR7]
.endm
.section ".text.init", "x"
.globl lowlevel_init
lowlevel_init:
inv_dcache
init_l2cc
init_aips
init_clock
mov pc, lr
/* Board level setting value */
ANATOP_BASE_ADDR_W: .word ANATOP_BASE_ADDR
CCM_BASE_ADDR_W: .word CCM_BASE_ADDR

Some files were not shown because too many files have changed in this diff Show More