Compare commits

...

683 Commits

Author SHA1 Message Date
0617378277 ENGR00268063 imx6x android: Fix build error
Fix build error when build Android

Signed-off-by: Lin Fuzhen <fuzhen.lin@freescale.com>
2013-06-20 20:47:18 +08:00
3b76c5db3a ENGR00266869-2 imx6x sabresd: correct the bootargs for android
The original design set the boot params default for eMMC on sabrsd
This patch corrects env setting according boot device which is selected.

Signed-off-by: Lin Fuzhen <fuzhen.lin@freescale.com>
2013-06-19 15:22:03 +08:00
d1b4e0f520 ENGR00266869-1 imx6x sarebsd: Fix recovery fail issue on SD
Correct the recovery environment setting when boot from SD card on
sabresd board

Signed-off-by: Lin Fuzhen <fuzhen.lin@freescale.com>
2013-06-19 14:53:43 +08:00
8452e4708e ENGR00265720 Enlarge command line buffer size
Align mx6q_sabreauto_nand config to other mx6q_* config
for command line buffer size
The buffer size is too short for dule display nand config

Signed-off-by: guoyin.chen <guoyin.chen@freescale.com>
2013-06-05 16:00:57 +08:00
c06000618b ENGR00231572 mx6solo: Add Android solo uboot configure
Add fastboot and recovery, add default
bootargs and bootcmd for Android.

Signed-off-by: Xinyu Chen <xinyu.chen@freescale.com>
2013-06-05 15:55:17 +08:00
5899674bf3 ENGR00254091 fastboot: add reboot command for quick fastboot
Quick fastboot just support download and flash commands.
Add reboot command support when launch fastboot by "fastboot q"

Signed-off-by: Lin Fuzhen <fuzhen.lin@freescale.com>
2013-04-17 13:49:11 +08:00
18fdfe6984 ENGR00254470-4 mx6q-hdmidongle:sata device can't work properly on most boards
Revert "ENGR00241595-4 mx6q-hdmidongle:Enable SATA PHY PDDQ default"

This reverts commit d33eefe083.

Reasons:
* according to SATA Power mode (in SATA protocol) PHY TX/RX/CLK is
powered down automatically according to SATA controller
power mode SATA port support Disable/Slumber/Partial/Enabled(OOB)

The SATA PHY PDDQ mode is one-shot and recommeded to be used for test,
SATA would not work properly if the PHY PDDQ mode is enabled in U-boot.

Signed-off-by: Richard Zhu <r65037@freescale.com>
2013-04-16 13:49:36 +08:00
75a15f1dc8 ENGR00254470-3 mx6q-sabreauto:sata device can't work properly on most boards
Revert "ENGR00241595-3 mx6q-sabreauto:Enable SATA PHY PDDQ default"

This reverts commit 027af67a25.

Reasons:
* according to SATA Power mode (in SATA protocol) PHY TX/RX/CLK is
powered down automatically according to SATA controller
power mode SATA port support Disable/Slumber/Partial/Enabled(OOB)

The SATA PHY PDDQ mode is one-shot and recommeded to be used for test,
SATA would not work properly if the PHY PDDQ mode is enabled in U-boot.

Signed-off-by: Richard Zhu <r65037@freescale.com>
2013-04-16 13:49:30 +08:00
ed9f87cab1 ENGR00254470-2 mx6q-arm2:sata device can't work properly on most boards
Revert "ENGR00241595-2 mx6q-arm2:Enable SATA PHY PDDQ default"

This reverts commit b10e0c4559.

Reasons:
* according to SATA Power mode (in SATA protocol) PHY TX/RX/CLK is
powered down automatically according to SATA controller
power mode SATA port support Disable/Slumber/Partial/Enabled(OOB)

The SATA PHY PDDQ mode is one-shot and recommeded to be used for test,
SATA would not work properly if the PHY PDDQ mode is enabled in U-boot.

Signed-off-by: Richard Zhu <r65037@freescale.com>
2013-04-16 13:49:25 +08:00
b0695b29ff ENGR00254470-1 mx6q-sd:sata device can't work properly on most boards
Revert "ENGR00241595-1 mx6q-sabresd:Enable SATA PHY PDDQ default"

This reverts commit 9cb937432d.

Reasons:
* according to SATA Power mode (in SATA protocol) PHY TX/RX/CLK is
powered down automatically according to SATA controller
power mode SATA port support Disable/Slumber/Partial/Enabled(OOB)

The SATA PHY PDDQ mode is one-shot and recommeded to be used for test,
SATA would not work properly if the PHY PDDQ mode is enabled in U-boot.

Signed-off-by: Richard Zhu <r65037@freescale.com>
2013-04-16 13:49:18 +08:00
3c73a4c87c ENGR00256543 mx6: Update equation for thermal sensor on i.MX6DL
Use universal equation and 25C's calibration data to
get thermal sensor's ratio on i.MX6DL.

Signed-off-by: Anson Huang <b20788@freescale.com>
2013-04-02 19:51:45 -04:00
7232c7ce56 ENGR00255481 mx6: Update equation for thermal sensor
Use universal equation and 25C's calibration data to
get thermal sensor's ratio.

Signed-off-by: Anson Huang <b20788@freescale.com>
2013-03-27 16:42:59 -04:00
82a4725015 ENGR00244769-3 [NOR FLASH]-Improve WEIM NOR speed
Improvements for WEIM NOR read performance.
Changed burst and page size to 8 words.
Changed read wait states to 10 and page read wait states to 4.

Signed-off-by: Oliver Brown <oliver.brown@freescale.com>
2013-02-13 12:17:29 -06:00
550a56fb56 ENGR00243038: make get_mmc_env_devno to be a generic function
Currently, each board has one same function called get_mmc_env_devno,
this will make the code a little bit duplication. We can make the
get_mmc_env_devno to be a generic function, thus we can remove all the
scattered function definition in each board file.

And the patch also remove the boot check. Firstly, this check is needless,
secondly, this will break the second boot support,for example:
first boot from SPI, then switch to SD/MMC boot.

Signed-off-by: Jason Liu <r64343@freescale.com>
2013-02-04 10:58:39 +08:00
69867900d8 ENGR00242042 MX6DQ/DL: fix boot fail issue on mx6dl boards
MX6DQ and MX6DL share the common board file, but only MX6DQ has built-in
SATA,  for the SATA PDDQ should be enabled default, so it needs to add
code to distinguish different chip ID.

Signed-off-by: Lin Fuzhen <fuzhen.lin@freescale.com>
2013-01-28 20:35:56 +08:00
d33eefe083 ENGR00241595-4 mx6q-hdmidongle:Enable SATA PHY PDDQ default
The SATA PHY PDDQ configuration is depended on the CONFIG_CMD_SATA
defined or not in board config file. If SATA feature is not config,
then the PDDQ will not be set, SATA PHY will not entry in Low Power
Mode, and it will consume some power even there is no sata devices
on board.
This patch:
1 Enable SATA PHY PDDQ default no matter the SATA is enabled or not in
  board config file, SATA module will disable PDDQ first when used phy,
  so default enable PDDQ will not affect SATA feature.
2 It needs a delay to wait for SATA PHY initialize after enable it,
  otherwise write the phy registers will fail.

Signed-off-by: Lin Fuzhen <fuzhen.lin@freescale.com>
2013-01-25 14:24:20 +08:00
027af67a25 ENGR00241595-3 mx6q-sabreauto:Enable SATA PHY PDDQ default
The SATA PHY PDDQ configuration is depended on the CONFIG_CMD_SATA
defined or not in board config file. If SATA feature is not config,
then the PDDQ will not be set, SATA PHY will not entry in Low Power
Mode, and it will consume some power even there is no sata devices
on board.
This patch:
1 Enable SATA PHY PDDQ default no matter the SATA is enabled or not in
  board config file, SATA module will disable PDDQ first when used phy,
  so default enable PDDQ will not affect SATA feature.
2 It needs a delay to wait for SATA PHY initialize after enable it,
  otherwise write the phy registers will fail.

Signed-off-by: Lin Fuzhen <fuzhen.lin@freescale.com>
2013-01-25 14:23:20 +08:00
b10e0c4559 ENGR00241595-2 mx6q-arm2:Enable SATA PHY PDDQ default
The SATA PHY PDDQ configuration is depended on the CONFIG_CMD_SATA
defined or not in board config file. If SATA feature is not config,
then the PDDQ will not be set, SATA PHY will not entry in Low Power
Mode, and it will consume some power even there is no sata devices
on board.
This patch:
1 Enable SATA PHY PDDQ default no matter the SATA is enabled or not in
  board config file, SATA module will disable PDDQ first when used phy,
  so default enable PDDQ will not affect SATA feature.
2 It needs a delay to wait for SATA PHY initialize after enable it,
  otherwise write the phy registers will fail.

Signed-off-by: Lin Fuzhen <fuzhen.lin@freescale.com>
2013-01-25 14:23:20 +08:00
9cb937432d ENGR00241595-1 mx6q-sabresd:Enable SATA PHY PDDQ default
The SATA PHY PDDQ configuration is depended on the CONFIG_CMD_SATA
defined or not in board config file. If SATA feature is not config,
then the PDDQ will not be set, SATA PHY will not entry in Low Power
Mode, and it will consume some power even there is no sata devices
on board.
This patch:
1 Enable SATA PHY PDDQ default no matter the SATA is enabled or not in
  board config file, SATA module will disable PDDQ first when used phy,
  so default enable PDDQ will not affect SATA feature.
2 It needs a delay to wait for SATA PHY initialize after enable it,
  otherwise write the phy registers will fail.

Signed-off-by: Lin Fuzhen <fuzhen.lin@freescale.com>
2013-01-25 14:23:20 +08:00
04d02cae9c ENGR00240261 support fastboot for nand boot in sabreauto_android
Add partition table for nand boot.

Signed-off-by: b02247 <b02247@freescale.com>
2013-01-16 13:04:03 +08:00
414014e110 ENGR00239610: Enhance the quick fastboot stability
1. Correct oversight of setup and endpoint complete irq handler sequence
2. Add check to string descriptor index

Signed-off-by: LiGang <b41990@freescale.com>
2013-01-11 09:45:31 +08:00
545fa5d8e9 ENGR00239607 add nand config for android sabreauto
Add nand config for android sabreauto

Signed-off-by: b02247 <b02247@freescale.com>
2013-01-10 16:56:53 +08:00
2f9091b8fe ENGR00239366: Add support for nand storage in quick fastboot
1. Add more check before writing image to storage
2. Fix failure when using nand storagea

Signed-off-by: LiGang <b41990@freescale.com>
2013-01-09 13:53:58 +08:00
7e5dab8c53 ENGR00230437: mx6: epdc: EPDC I/O setup after V3p3 is enable
EPDC will be used when splash screen is shown, EPDC io setup is done
before 3V3 digitial power, which cause critical chip burn-out for all
platforms.

To follow the E-Ink specification, setup EPDC I/O after V3p3 is enable.

Signed-off-by: Fugang Duan  <B38611@freescale.com>
2013-01-08 17:32:08 +08:00
d0e1fff03a ENGR00238363: mx6dl: epdc: remove epdc macro redefinition in config file
Remove mx6dl_arm2 and mx6dl_sabresd config file epdc macro
redefinition to avoid build warning.

Signed-off-by: Fugang Duan  <B38611@freescale.com>
2013-01-08 17:32:08 +08:00
5d1bc96f05 ENGR00238834: mx6solo: add MFG support for mx6solo sabresd board
add MFG support for mx6solo sabresd board

Signed-off-by: Jason Liu <r64343@freescale.com>
2013-01-04 17:08:57 +08:00
82471d5f28 ENGR00238371: mx6solo: sabresd: make system prompt indicate solo config
make system prompt indicate solo config when using mx6solo_sabresd:
"MX6Solo SABRESD U-Boot > "

Signed-off-by: Jason Liu <r64343@freescale.com>
2012-12-27 15:45:12 +08:00
0e7ae7d547 ENGR00238300: enhance the download speed for fastboot
1. the new fastboot is an add-on feature, the original fastboot is reserved
2. the new fastboot is a subset of original fastboot, only support "download"
   and "flash" command
3. type "fastboot" in uboot to launch the original fastboot utility,
   type "fastboot q" in uboot to launch the new fastboot utility

Signed-off-by: LiGang <b41990@freescale.com>
2012-12-27 14:52:50 +08:00
b07b53788a ENGR00238048: Add support for processor serial ATAG in uboot for iMX53
Add support for Processor UID ATAG in uboot for iMX53. The UID is
present in Fuses bank 0 at offset 0x20.

Signed-off-by: Nitin Garg <nitin.garg@freescale.com>
2012-12-21 12:33:49 -06:00
896d566f53 ENGR00235540 add sabreauto_6q config for android
Support fastboot and recovery

Signed-off-by: b02247 <b02247@freescale.com>
2012-12-18 13:05:18 +08:00
56f8580741 ENGR00236472 Update DDR script of ARD solo emulation
Update DDR script of ARD solo emulation, the ddr script
based on the following commit from ddr-scripts-rel git:
dfde48e Added MX6Solo ARD DDR3 init.

Signed-off-by: Alejandro Sierra <b18039@freescale.com>
2012-12-13 11:04:16 -06:00
3f2cc14230 ENGR00236902: mx6solo_sabresd: update the DDR script for solo-sabresd
This patch update the DDR script for mx6solo_sabresd board. The DDR script
based on the following commit from ddr-scripts-rel.git

9d4e11a Added MX6Solo SabreSD DDR3 script

Signed-off-by: Jason Liu <r64343@freescale.com>
2012-12-13 17:00:30 +08:00
b7c5badf94 ENGR00235821 mx6: correct work flow of PFDs
PFDs need to be gate/ungate after PLL lock to reset
PFDs to right state. Otherwise PFDs may lose correct
state in state-machine, then no output clock.
For i.MX6DL and i.MX6SL, ROM have taken care of PFD396
already since the bus clock needs it.

Signed-off-by: Anson Huang <b20788@freescale.com>
2012-12-13 14:34:43 -05:00
d31df11541 ENGR00236620: Add Android fastboot and recovery reboot support
Add support for Android fastboot and recovery reboot
commands for iMX5.

Signed-off-by: Nitin Garg <nitin.garg@freescale.com>
2012-12-11 11:10:36 -06:00
07663772b1 ENGR00235817 mx6: use SNVS LPGPR register to store boot mode value.
After using POR reset, the content in SRC will be reset.
See RM: 63.5.1.2.3 IPP_RESET_B(POR)

Because POR reset will reset most of register in IC, so use
SNVS_LP General Purpose Register (LPGPR) to store the boot mode value.

Below copy from SNVS_BlockGuide.pdf:
The SNVS_LP General Purpose Register provides a 32 bit read write
register, which can be used by any application for retaining 32 bit
data during a power-down mode

This Patch will use [7,8] bits of this register.

Signed-off-by: Zhang Jiejing <jiejing.zhang@freescale.com>
2012-12-11 16:00:31 +08:00
0daf8bc6b7 ENGR00236337: mx6/clock: emi_slow clock rate is not printed out correctly
This issue due to PODF is not used correcly, need use the following instead:
ACLK_EMI_SLOW_PODF_OFFSET, the original used ACLK_EMI_PODF_OFFSET was wrong.

Signed-off-by: Jason Liu <r64343@freescale.com>
2012-12-10 13:56:10 +08:00
c738932446 ENGR000234991 MX6DL/ARD: Two boards met kernel dump during boot up
The issue is caused by DDR script changed io pads to DDR differential mode
but forget to do the calibration data update.

This patch updated the DDR script on MX6DL ARD board based on
the commit on the ddr-scripts-rel:
53121e0 Updated MX6DL and MX6DQ ARD and SabreSD scripts with new
calibration values for IO pads set to differential mode;

Signed-off-by: Jason Liu <r64343@freescale.com>
2012-12-05 20:41:08 +08:00
2ff6f45780 ENGR00235564: i.mx6 u-boot: change plugin to use ROM API table for code jump
The original plugin code uses hard coded assembly address for the code jump
to "pu_irom_hwcnfg_setup", it can only works for specific chip version, for
a new TO, the assembly address will change, and the plugin code simply fails.

In fact there is an API entry table in a fixed ROM location, it contains the
entry to the "pu_irom_hwcnfg_setup". This patch retrieve the jump address
from this API table, thus avoid the limitation for current implementation.

Apply to all plugin enabled platforms, MX6Q/DL ARM2, MX6SL ARM2/EVK

Signed-off-by: Eric Sun <jian.sun@freescale.com>
2012-12-03 18:55:19 +08:00
5d743e40a0 ENGR00223037 fsl: Add new board HDMI dongle for imx6 Q/DL.
Add HDMIdongle board for imx6Q/DL under board/freescale.

Signed-off-by: Zhang Xiaodong <B39117@freescale.com>
2012-11-28 13:28:37 +08:00
fc6c25a18a ENGR00233168 - U-Boot fails to boot from eMMC
Aligning the flash header to remove the boot plugin as in previous release.

Signed-off-by: Oliver Brown <oliver.brown@freescale.com>
2012-11-27 13:37:30 -06:00
d6eb8ba4d1 ENGR00233928 i.mx6q/sabresd: update the DDR script for i.MX6Q sabresd board
This commit update the DDR script for i.MX6Q sabresd board
based on the top of the following commit on ddr-scripts-rel:
02b8a73 removed some verbage (comments) from init, no changes to actual init

Signed-off-by: Jason Liu <r64343@freescale.com>
2012-11-26 16:46:56 +08:00
f2f0cec4ed ENGR00234353-3: mx6q_sabreauto remove EIM_A24 nor pads
* Remove EIM_A24 nor pads as this are used for
  io steer control and are not connectted to NOR
  flash memory.
* Fix conflict access when it's used as io control
  gpio.

Signed-off-by: Adrian Alonso <aalonso@freescale.com>
2012-11-20 19:32:27 -06:00
d2245970c5 ENGR00234353-2: mx6q_sabreauto_weimnor fix redundant env offset
* Fix redundant enviroment offset
* Disable I2C support as they share pads
* Enable flash empty information
* weim-nor partition layout
  +-----------------+ 0x08000000
  +      u-boot     +
  +-----------------+ 0x08040000 (256k)
  +    u-boot env   +
  +-----------------+ 0x08060000 (128k)
  + u-boot redundat +
  +-----------------+ 0x08080000 (128k)
  +     Kernel      +
  +-----------------+ 0x08480000 (4M)
  +     Rootfs      +
  +-----------------+ (~27M)

Signed-off-by: Adrian Alonso <aalonso@freescale.com>
2012-11-20 19:31:45 -06:00
72695af957 ENGR00234353-1: mx6_sabreauto fix weim-nor boot
* Fix weim-nor boot failure
* Group weim-nor conflict modules
  If not defined CONFIG_CMD_WEIMNOR
  enable SPI-NOR and I2C (default)
  else enable weim-nor
* Remove FLASH_SIZE macro, size is query by
  CFI driver
* Enable flash empty information

Signed-off-by: Adrian Alonso <aalonso@freescale.com>
2012-11-20 19:28:30 -06:00
95c7393cf3 ENGR00233366-5 Anatop PFUZE: move LDO bypass code to kernel
move LDO bypass code and one PFUZE1.0 workaround code to kernel. Remove
CONFIG_MX6_INTER_LDO_BYPASS in u-boot

Signed-off-by: Robin Gong <b38343@freescale.com>
2012-11-19 10:45:13 +08:00
bbbdf5aa56 ENGR00233933 i.mx6dl/sabresd: update the DDR script for i.MX6DL sabresd board
This patch update the DDR script for the i.MX6DL sabresd board
The script is based on top the commit on ddr-scripts-rel:
02b8a73 removed some verbage (comments) from init, no changes to actual init

Signed-off-by: Jason Liu <r64343@freescale.com>
2012-11-16 17:58:39 +08:00
6c24fc424f ENGR00233709-2 i.mx6q/sabreauto: update the DDR script for i.mx6q AI board:
This commit update the DDR script for i.MX6Q Sabreauto(AI) board.
The script is based on top the commit on ddr-scripts-rel:

02b8a73 removed some verbage (comments) from init, no changes to actual init

Signed-off-by: Jason Liu <r64343@freescale.com>
2012-11-16 16:39:39 +08:00
2cd66a0359 ENGR00233709-1 i.mx6dl/sabreauto: update the DDR script for i.mx6dl AI board:
This commit update the DDR script for i.MX6DL Sabreauto(AI) board.
The script is based on top the commit on ddr-scripts-rel:

02b8a73 removed some verbage (comments) from init, no changes to actual init

Signed-off-by: Jason Liu <r64343@freescale.com>
2012-11-16 16:39:39 +08:00
3263f7d0a7 ENGR00233881 Camera mx6q_sabresd:swap VGEN5&VGEN3 to fix camera streaks issue
On mx6q_sabresd RevC board, there is camera streaks issue, after HW check, they
think there is current limit risk because VDDHIGH_IN and camera 2.8V power
share the same VGEN5, they suggest seprate them, so we use VGEN5 as VDDHIGH_IN
and use VGEN3 as camera 2.8V power supply. Also increase VDDHIG_IN from 2.8V to
3.0V to align with latest datasheet
Signed-off-by: Robin Gong <B38343@freescale.com>
2012-11-16 14:08:52 +08:00
06e8a025d0 ENGR00233716-2: mx6q_sabreauto flash u-boot into spi-nor fails to boot
* Fix spi-nor boot failure
* Fix unconfigured gpio pad setting when spi-nor or
  weim-nor on steer control gpios
* Group gpio access only when I2C is enabled and restore
  route paths to avoid conflicts on shared pads

Signed-off-by: Adrian Alonso <aalonso@freescale.com>
2012-11-15 15:09:07 -06:00
6ffbfff232 ENGR00233716-1: mx6q_sabreauto aling spi-nor environment offsset
* Aling spi-nor environment offsset to 256k
  this allows a partition layout

  +-----------------+ 0x0
  +   bootloader    +
  +-----------------+ 0x40000 (256k)
  +   boot env      +
  +-----------------+ 0x42000 (8k)
  +   kernel        +
  +-----------------+ Remaining space (~3.7M)

Signed-off-by: Adrian Alonso <aalonso@freescale.com>
2012-11-15 15:09:07 -06:00
5dd1086142 ENGR00233730 PFUZE mx6q_sabresd: remove extra increase for PFUZE tolerance
There is no more tolerance issue on PFUZE, it will be only 25mV, so that we no
need increase VDDSOC_IN from 1.375V to 1.425V.

Signed-off-by: Robin Gong <B38343@freescale.com>
2012-11-15 10:33:41 +08:00
ad21cbe117 ENGR00233307 Need secure/encrypted boot for Widevine support.
* Adding the config option CONFIG_SECURE_BOOT to the SabreSD board,
but defaulting it to be disabled. Removed the CONFIG_SECURE_BOOT
key from mx6q_arm2_android.h so that it is only in one file,
include/configs/mx6q_arm2.h

* Fixed up an address alignment check in authenticate_image(). The
test would fail in the event the address is already aligned.
Also, added some debug code which can be enabled to assist in
testing secure images.

* Added support for authenticating an image when using booti.

* Adding support for secure boot to the Sabre SD board.

* Added support for encrypted boot to mx6q arm2 board linker script.

Signed-off-by: Dan Douglass <dan.douglass@freescale.com>
2012-11-12 13:43:06 -06:00
552907b7a2 ENGR00232682 mx6sl snvs: fix long press ONOFF failed issue in u-boot
the same as TKT104835 reported on MX6Q/DL
Need set Power Supply Glitch to 0x41736166 and clear Power Supply
Glitch Detect bit when POR or reboot or power on, otherwise system could
not be power off anymore, it will power up auto agian.

Signed-off-by: Lin Fuzhen <fuzhen.lin@freescale.com>
2012-11-09 17:12:11 +08:00
8ed73ecdbc ENGR00230364 - imx6sl: FEC: fix cycle reboot fail in EVK platform for bootp.
In some imx6sl evk boards, fec cannot work fine while doing
cycle reboot via to execute command "reboot" in kernel.

The root cause: phys clock source is closed when reboot system,
and LAN8720 status machine is in disorder. So it needs to do phy
hardware reset to make phy enter normal state machine.

Signed-off-by: Fugang Duan  <B38611@freescale.com>
2012-11-08 16:37:29 +08:00
27e939e7bc ENGR002232258 MX6Q-ARM2: add a NAND boot config for uboot
add a new config for NAND boot in the mx6q-arm2 board.

Signed-off-by: Huang Shijie <b32955@freescale.com>
2012-11-02 16:51:32 +08:00
1f2f2d3f5c ENGR00231891-2 gpmi: fix the 4k page size limit
We may use the 8K page nand now. So expand the page size from 4k
to 8K. Also expand the oobsize to 1K size.

Signed-off-by: Huang Shijie <b32955@freescale.com>
2012-10-31 18:27:28 +08:00
711e63c611 ENGR00231891-1 gpmi: replace the hardcode
We have get the right infomation when we call the set_geometry().
So we replace the hardcode with the proper gpmi_info's values.

Signed-off-by: Huang Shijie <b32955@freescale.com>
2012-10-31 18:24:46 +08:00
6283d8b65e ENGR00231781 fsl common:Align reversed color logo to standard
This patch removes the 'semiconductor' word in the freescale
reversed color logo to align with the standard(preferred) one
which can be found at the link:
http://media.freescale.com/phoenix.zhtml?c=196520&p=irol-logosdisclaim

Signed-off-by: Liu Ying <Ying.Liu@freescale.com>
2012-10-31 11:51:57 +08:00
2dcb1c5313 ENGR00231581 BCH: fix the wrong data size macros in BCH
In the mx23/mx28, the DATA0_SIZE/DATAN_SIZE of the BCH's
HW_BCH_FLASH1LAYOUT0/HW_BCH_FLASH0LAYOUT1 should be the real
bytes length of the data chunk 0 and data chunk 1.

But in the mx6q/mx50, the DATA0_SIZE/DATAN_SIZE of the BCH's
HW_BCH_FLASH1LAYOUT0/HW_BCH_FLASH0LAYOUT1 should be multiple of 4 bytes.

this patch fixes the wrong macros.

Signed-off-by: Huang Shijie <b32955@freescale.com>
2012-10-30 14:04:48 +08:00
07a5dceee3 ENGR00230967 Enable recovery mode by keys when boot
1. Add matrix key support
2. Add recovery mode support by pressing power key and  volume down key
    when boot
    SW10 on MX6SL-EVK board configed as volume down key.
    SW1 on MX6SL-EVK board configed as power key

Signed-off-by: LiGang <b41990@freescale.com>
2012-10-30 13:47:15 +08:00
a7decba622 ENGR00231553: MX6SL: Uncovered an issue for I2C parent clock
We need to check reg bit to decide I2C parent clock.

Signed-off-by: Terry Lv <r65388@freescale.com>
2012-10-30 09:46:53 +08:00
c078b850cf ENGR00230981-1 pfuze:set all switches to PFM mode in standby
To save power, set all switches to PFM mode in standby,although PFM mode need
6% tolerance.But it will be implemented in kernel, and move the workaround
which all buck switches need be configured PWM mode on PF100 1.0
Another two change is:
1. u-boot will print PFUZE device id and revision id.
2. add value check for i2c write and read.

Signed-off-by: Robin Gong <B38343@freescale.com>
2012-10-26 18:48:39 +08:00
09420eacbc ENGR00231155 add enable_wait_mode=off for all the mx6q/dl mfg uboot
- currently only a work around can be applied, the root cause is not
  identified yet
  The workaround is to disable wait mode, so all the mfgtool uboot
  need to add "enable_wait_mode=off" in the cmd line pass to kernel

Signed-off-by: Tony LIU <junjie.liu@freescale.com>
2012-10-25 17:15:36 +08:00
e4ab626ad1 ENGR00230391: Fix build fail issue of sata
Fix build fail issue of sata.

mx6q_arm2.c: In function 'sata_initialize':
mx6q_arm2.c:261:6: error: 'sata_curr_device' undeclared (first use in
		this function)
mx6q_arm2.c:261:6: note: each undeclared identifier is reported only
once for each function it appears in
mx6q_arm2.c:299:2: warning: implicit declaration of function
'__sata_initialize' [-Wimplicit-function-declaration]
mx6q_arm2.c: In function 'setup_sata':
mx6q_arm2.c:346:6: error: 'sata_curr_device' undeclared (first use in
		this function)
mx6q_arm2.c: At top level:
mx6q_arm2.c:81:12: warning: 'system_rev' defined but not used
[-Wunused-variable]
make[1]: *** [mx6q_arm2.o] Error 1

Signed-off-by: Terry Lv <r65388@freescale.com>
2012-10-19 14:28:02 +08:00
8397d1de63 ENGR00230104 mx6q_sabreauto_nand: fix fec phy address
* Fix FEC Phy address to 1
* Enable micrel phy support, revA compatibility

Signed-off-by: Adrian Alonso <aalonso@freescale.com>
2012-10-18 21:17:25 -05:00
8bd01cd413 ENGR00230334: Fix the mx53_smd_android config
Update the u-boot config for mx53 smd android to
include the correct boot env, enable boot splash,
increase the cmdline buffer, tokens and 1G DDR.

Signed-off-by: Nitin Garg <nitin.garg@freescale.com>
2012-10-18 13:28:14 -05:00
b92e78257d ENGR00229931 Support for Solo configuration on ARD platform
Added support for Solo configuration on ARD platform.
This support was replaced by DL configuration,
however it was added again to emulate or use
Solo chip on ARD platform.

Signed-off-by: Alejandro Sierra <b18039@freescale.com>
2012-10-17 10:11:31 -05:00
721ae657a8 ENGR00229789 AHCI Disable SATA PHY in initialization
* disable SATA PHY in default
* add sata_initialize() func used to re-initialize SATA when
sata is used.

Signed-off-by: Richard Zhu <r65037@freescale.com>
2012-10-17 09:06:07 +08:00
2130d083c3 ENGR00229711 Add weim-nor argument on uboot config Quad/DL
Missing argument "weim-nor" on uboot configuration
to boot from NOR.
Quad/DL

Signed-off-by: Alejandro Sierra <b18039@freescale.com>
2012-10-16 11:27:46 -05:00
7d4a7aa6bd ENGR00229709 Support 2 processors at Linux boot
Remove argument "nosmp" to support
dual processor configuration on Linux.

Signed-off-by: Alejandro Sierra <b18039@freescale.com>
2012-10-16 11:27:46 -05:00
1d11a8a0d6 ENGR00229817: i.mx6dl/mx6solo_sabresd_config: fix the build issue
This patch fixed the following build issue:

mx6q_sabresd.c:1382: undefined reference to `imx_pwm_config'
mx6q_sabresd.c:1383: undefined reference to `imx_pwm_enable'

And also removed the extra '_' in the config name.

Signed-off-by: Jason Liu <r64343@freescale.com>
2012-10-16 17:44:52 +08:00
d6ff40e31c ENGR00229614 mx6: disable VDDPU by default, xpu will enable it if needed.
Disable VDDPU_CAP by default, xPU will enable it
in driver when they need it.

Signed-off-by: Anson Huang <b20788@freescale.com>
2012-10-16 15:06:12 -04:00
17d38b4648 ENGR00229456 Support for 64bit DDR configuration for ARD
Added support for 64bit DDR configuration
on DL chip. On ARD platform

Signed-off-by: Alejandro Sierra <b18039@freescale.com>
2012-10-12 16:43:36 -05:00
3070c9de03 ENGR00227413 Change configuration file names on AI
Change configuration file names for AI
platform. From solo to DL.

Signed-off-by: Alejandro Sierra <b18039@freescale.com>
2012-10-12 15:51:46 -05:00
31f0941821 ENGR00228238 i.mx6/i.mx6dl: sabresd: add solo-ddr32bit support
This patch adds the solo-ddr32bit config support. The DDR script got from:
http://compass.freescale.net/livelink/livelink/227589697/
MX6DL_init_DDR3_400MHz_32bit_For_SD_1.0.inc.txt?func=doc.Fetch&nodeid=227589697

Signed-off-by: Jason Liu <r64343@freescale.com>
2012-10-11 18:00:26 +08:00
306f1510e6 ENGR00223797-3 IPUv3:Wait for sw reset finish
This patch checks self-clear sw_ipu_rst bit in
SCR register of SRC controller to be cleared
after setting it to reset IPUv3. This makes
sure that IPUv3 finishes  sofware resetting.

Signed-off-by: Liu Ying <Ying.Liu@freescale.com>
2012-09-27 11:10:31 +08:00
fa12531578 ENGR00223797-2 MX6Q/DL CPU:Do not disable IPU display channel
This patch changes to keep IPU display channel being running
rather than disable IPU display channel when we leave uboot
stage and go to kernel stage. This may support smooth
tranistion from Uboot splash screen to kernel stage.

Signed-off-by: Liu Ying <Ying.Liu@freescale.com>
2012-09-27 11:10:31 +08:00
b8c2285070 ENGR00223797-1 MX6 SabreSD:Align IPU related clocks with kernel
This patch aligns IPU related clocks with imx_3.0.35(_android)
kernel setting to support smooth transition from uboot splash
screen to kernel stage.
The IPU related clock trees are:
1) MX6DQ SabreSD:
 ipu1_clk --
   osc_clk(24M)->pll2_528_bus_main_clk(528M)->periph_clk(528M)
   ->mmdc_ch0_axi_clk(528M)->ipu1_clk(264M)

 ipu1_pixel_clk_x --
   osc_clk(24M)->pll2_528_bus_main_clk(528M)->
   pll2_pfd_352M(452.57M)->ldb_dix_clk(64.65M)->
   ipu1_di_clk_x(64.65M)->ipu1_pixel_clk_x(64.65M)

2) MX6DL SabreSD:
 ipu1_clk --
   osc_clk(24M)->pll3_usb_otg_main_clk(480M)->
   pll3_pfd_540M(540M)->ipu1_clk(270M)

 ipu1_pixel_clk_x --
   osc_clk(24M)->pll2_528_bus_main_clk(528M)->
   pll2_pfd_352M(452.57M)->ldb_dix_clk(64.65M)->
   ipu1_di_clk_x(64.65M)->ipu1_pixel_clk_x(64.65M)

Signed-off-by: Liu Ying <Ying.Liu@freescale.com>
2012-09-27 11:10:31 +08:00
82d607a727 ENGR00223794 MX6 SabreSD:Enable LVDS panel pwm backlight
This patch enables pwm backlight for LVDS panel and stops
using gpio backlight to align with kernel to avoid unstable
backlight when booting into kernel, as kernel usually uses
pwm backlight instead of gpio backlight. Following items
are done to support this:
1) Add PWM1 and PWM2 controller base addresses.
2) Change PIN SD1_DAT3 mux from GPIO to PWM1_PWMO.
3) Set default backlight density to 50%.

Signed-off-by: Liu Ying <Ying.Liu@freescale.com>
2012-09-27 11:10:31 +08:00
ce91cea872 ENGR00226048 Fix weim nor for mfg tool
Weim interface share pins with I2C.
A define was declared to enable weim
pins and disable I2C when mfg tool is used.

Signed-off-by: Alejandro Sierra <b18039@freescale.com>
2012-09-26 20:50:07 -05:00
ca704fbc8b ENGR00225691 NAND support on i.MX6Solo ARD
NAND support on i.MX6Solo ARD. Two files were added.
mx6solo_sabreauto_nand.h --> bootloader's image
mx6solo_sabreauto_nand_mfg.h --> mfg tool bootloader

Signed-off-by: Alejandro Sierra <b18039@freescale.com>
2012-09-24 15:16:01 -05:00
1b3f3eaf01 ENGR00225486 Support for spi-nor boot
Support for spi-nor boot with valid
"extra_env_settings". It used to be the
same as the SD Card boot, however it couldn't
read/write the env settings because the
CONFIG_FSL_ENV_IN_MMC  was set instead of
CONFIG_FSL_ENV_IN_SF.

Signed-off-by: Alejandro Sierra <b18039@freescale.com>
2012-09-21 17:19:22 -05:00
097643f5cb ENGR00224313:i.MX6 general:enable CONFIG_CMD_IMXOTP to fix the build error
Commit 7942886(ENGR00221503-2 imx6: add cpu serial number support)
introduces dependency on "CONFIG_SERIAL_TAG" and "CONFIG_CMD_IMXOTP".
On U-boot configuration header files which only defines the first one, build
error will be met.

--- build error message ---
arm_cortexa8/mx6/libmx6.a(generic.o): In function `get_board_serial':
arm_cortexa8/mx6/generic.c:1438: undefined reference to `imx_otp_read_one_u32'
arm_cortexa8/mx6/generic.c:1439: undefined reference to `imx_otp_read_one_u32'
---------------------------

To fix it, add missing "CONFIG_CMD_IMXOTP" macro definition in the
config head file.

Configs affected are:
---------------------------
	mx6q_arm2_iram
	mx6q_sabresd_iram
	mx6dl_arm2_iram
	mx6sl_arm2_iram
	mx6sl_evk_iram

Signed-off-by: Eric Sun <jian.sun@freescale.com>
2012-09-14 16:52:13 +08:00
b7447e2cf6 ENGR00224291:i.MX6Q/ARM2-LPDDR2:enable CONFIG_CMD_IMXOTP to fix the build error
Need enable CONFIG_CMD_IMXOTP to fix the build error:

arm_cortexa8/mx6/generic.c:1438: undefined reference to `imx_otp_read_one_u32'
arm_cortexa8/mx6/generic.c:1439: undefined reference to `imx_otp_read_one_u32'

Signed-off-by: Jason Liu <r64343@freescale.com>
2012-09-14 11:34:16 +08:00
9b6f867956 ENGR00224272: MFG:i.mx6q/ARM2 enable CONFIG_CMD_IMXOTP to fix the build error
Need enable CONFIG_CMD_IMXOTP to fix the build error:

arm_cortexa8/mx6/generic.c:1438: undefined reference to `imx_otp_read_one_u32'
arm_cortexa8/mx6/generic.c:1439: undefined reference to `imx_otp_read_one_u32'

Signed-off-by: Jason Liu <r64343@freescale.com>
2012-09-14 00:47:58 +08:00
d88984cfb3 ENGR00223788 mx6sl_evk: change boot args to boot from mmc/sd
default setting is to boot via nfs. By this way, after mfgtool burned the whole
image on EVK, the system will probably not load the Linux kernel if the network
is not correctly set or not availabe for it. Change to mmc/sd boot to make
sure an entire boot process can be completed, in order to easily verify mfgtool.

Signed-off-by: Robby Cai <R63905@freescale.com>
2012-09-13 14:23:00 +08:00
fb5aaaea8f ENGR00223027 Add support for nand on MFG for IMX6Q
Add support for nand flash on IMX6Q. Modifying partitions number and size.
mx6q_sabreauto_nand_boot.h --> Modify the size of partitions used to 3.
      PARTITION 0 (16M)
------------------------------
|                             |
|             uboot           |
|                             |
------------------------------

      PARTITION 1 (16M)
------------------------------
|                             |
|            Kernel           |
|                             |
------------------------------

      PARTITION 2 (128M)
------------------------------
|                             |
|                             |
|       Root file system      |
|                             |
|                             |
------------------------------

mx6q_sabreauto_mfg_enable_nand.h --> Enable partitions on manufacturing tool

Signed-off-by: Alejandro Sierra <b18039@freescale.com>
2012-09-11 18:14:21 -05:00
d5445135db ENGR00223236-1 [MX6]Change the temperature range to -40C ~ 125C
Previous temperature range is -25C ~ 125C, according to latest
datasheet, change it to -40C to 125C.

Fix temperature report error when it is < 0C.

Signed-off-by: Anson Huang <b20788@freescale.com>
2012-09-06 15:58:15 +08:00
34424c323c ENGR00222170: Add mx6sl_evk_android_config for mx6sl evk board
- mx6sl_evk_android.h  is a new file, copied from mx6sl_arm2_android.h
- set default sdio port as mmc1

Signed-off-by: LiGang <b41990@freescale.com>
2012-09-06 15:50:08 +08:00
794288699c ENGR00221503-2 imx6: add cpu serial number support.
add cpu serial number tag, kernel will read this
number and put it in /proc/cpuinfo, as 'Serial' part
it can be used as a UUID source in software.

Signed-off-by: Zhang Jiejing <jiejing.zhang@freescale.com>
2012-08-31 12:20:22 +08:00
eec0c300a5 ENGR00221503-1 cmd_imxotp: refine the help of this command.
This command use index but not addr, it confuse user, add
a help how to convert the addr from fuse map to the index.

Signed-off-by: Zhang Jiejing <jiejing.zhang@freescale.com>
2012-08-31 12:20:22 +08:00
1b7102521f ENGR00222005 mfgtool can't work on mx6sl
- for arm2 board, the I2C module is not defined in mfg config
- and a new config file for evk board
- change some prompt information

Signed-off-by: Tony LIU <junjie.liu@freescale.com>
2012-08-30 15:13:06 +08:00
8b8362b438 ENGR00219316-2: mx6q sabreauto enable lvds backlight by default
* Enable lvds backlight by default, configure
  io_expander A to enable backlight.
* As weimnor_d18, spinor_d18, i2c3_sda share the pad
  MX6Q_PAD_EIM_D18 if wiemnor or spinor is enabled
  it overrides i2c3 settings and kernel fails to configure
  io_expander causing read/write errors.
* This commit allows a default configuration on control
  lines behind io_expander A.

Signed-off-by: Adrian Alonso <aalonso@freescale.com>
2012-08-29 14:05:41 -05:00
3bd28a9826 ENGR00219316-1: mx6 sabreauto: enable mxc_gpio support
* Enable mxc_gpio support in order to configure
  steer logic circuits so attached pads can be used
  by dedicated IP modules I2C3, SPI-NOR, WEIM-NOR.

Signed-off-by: Adrian Alonso <aalonso@freescale.com>
2012-08-29 14:05:41 -05:00
5258372493 ENGR00221013 MX6 SabreSD:Disable LVDS panel CABC function
This patch sets CABC_EN0/1 pins to low to disable
LVDS panel CABC function. This function will turn backlight
automatically according to display content which may cause
potential unstable backlight phenomena.

Signed-off-by: Liu Ying <Ying.Liu@freescale.com>
2012-08-28 10:13:01 +08:00
d5f739dc39 ENGR00221332: U_BOOT: remove "boot" and "enable" from configs' name
Remove "boot" and "enable" from some configs' name.
Affacted configs:

mx6q_sabreauto_boot_weimnor
mx6q_sabreauto_mfg_enable_weimnor
mx6solo_sabreauto_boot_weimnor
mx6solo_sabreauto_mfg_enable_weimnor
mx6q_sabreauto_mfg_enable_spi-nor
mx6solo_sabreauto_mfg_enable_spi-nor
mx6q_sabreauto_nand_boot

Currently, various u-boot are built in nightlybuild, to make it easier,
we naming u-boot binary name and config as
<soc_name>_<board_type>_<ddr_type>_<boot_device>.
Then it is easier to be parsed, also easier to be maintained in
nightlybuild and u-boot git.

Signed-off-by: Terry Lv <r65388@freescale.com>
2012-08-24 19:50:24 +08:00
439a5e37ab ENGR00221135: imx6x: clear PowerDown Enable bit of WDOG1_WMCR
From IC spec:
---
The Power down Counter inside WDOG-1 will be enabled out of reset.
This counter has a fixed time-out value of 16 seconds, after which
it will drive the WDOG-1 signal low.

To prevent this, the software must disable this counter by clearing
the PDE bit of Watchdog Miscellaneous Control Register (WDOG_WMCR)
within 16 seconds of reset de-assertion. Once disabled, this counter
cannot be enabled again until the next system reset occurs. This
feature is provided to prevent the hanging up of cores after reset, as
WDOG-1 is not enabled out of reset.
---

NOTE for the last sentence:
This feature requires a dedicated WDOG_B pin for it. The fact that changing
the IOMUX configuration can alter the WDOG_B functionality (GPIO by default)
is not ideal as it defeats the purpose of this feature. But it still
takes effect when the muxed pin is configured as WDOG_B within 16 seconds.

Clear PDE bit to avoid WDOG_B (aka, WDOG-1) assertion.

Tested on MX6SL. May add this for other MX6x.

Signed-off-by: Robby Cai <R63905@freescale.com>
2012-08-24 16:37:40 +08:00
7ada9f6b7d ENGR00221150 Support spi-nor on manufacturing tool
Two configuration files were included to suppoort spi-nor
on the manufacturing tool. Basically these files send the
parameter "spi-nor" to the kernel, so the SPI interface can be setup.
Files included are:
mx6q_sabreauto_mfg_enable_spi-nor.h --> For Quad
mx6solo_sabreauto_mfg_enable_spi-nor.h --> For solo

Signed-off-by: Alejandro Sierra <b18039@freescale.com>
2012-08-22 12:37:43 -05:00
f6c6e96cc9 ENGR00220824: mx6sl_evk: mmc: only SD1 supports 8bit on evk board.
- configure SD1 to support 8bit on evk

Signed-off-by: Ryan QIAN <b32804@freescale.com>
2012-08-21 10:25:22 +08:00
65776680cc ENGR00180538-1 MFG download burn sd,spi, nand, nor failed.
Added  two new board files for Solo and Quad which allow uboot
to be booted from WEIM NOR. Also amended the word  “weim-nor” in
both mfg configuration files which allow to erase/write u-boot
and uImage in Parallel nor using the mfg tool. Lastly just added
a label in the regular board files indicating that another config
file has to be used in the case of NOR boot.

Modified files:
Makefile
common/env_common.c
include/configs/mx6q_sabreauto.h
include/configs/mx6q_sabreauto_boot_weimnor.h
include/configs/mx6q_sabreauto_mfg_enable_weimnor.h
include/configs/mx6solo_sabreauto.h
include/configs/mx6solo_sabreauto_boot_weimnor.h
include/configs/mx6solo_sabreauto_mfg_enable_weimnor.h

Signed-off-by: Francisco Munoz <francisco.munoz@freescale.com>
2012-08-21 09:26:35 +08:00
af52274a9f ENGR00217505-8 uboot: MX6Q-ARD: set the default gpmi clock to 20MHz
Set the default clock to 20MHz. The 11Mhz is too slow.

Signed-off-by: Huang Shijie <b32955@freescale.com>
2012-08-20 16:08:53 +08:00
c2513f07ac ENGR00217505-7 uboot: gpmi: update the mtd->ecc_stats when reading page failed
If tell the real correcting infomation to the upper layer of
MTD, the torture thread of UBIFS will do the torture test in
a very often frequency. This will eat up all the reservation blocks
of the UBIFS.

So tell the real correcting infomation only when the failure occured,
or the corrected times nearly reached the ECC threshold.

Signed-off-by: Huang Shijie <b32955@freescale.com>
2012-08-20 16:08:53 +08:00
d20be86153 ENGR00217505-6 uboot: gpmi: set default value for busy_timeout
Set 0x500 to the busy_timeout in HW_GPMI_TIMING1.
If we do not set this busy_timeout, the gpmi may become unstable.

Signed-off-by: Huang Shijie <b32955@freescale.com>
2012-08-20 16:08:53 +08:00
ba759e8991 ENGR00217505-5 uboot: gpmi: update the ecc_strength code
Rewrite the code for calculate the ecc strength.
Use the same code as in the gpmi driver.

Signed-off-by: Huang Shijie <b32955@freescale.com>
2012-08-20 16:08:53 +08:00
d622b0abb3 ENGR00217505-4 uboot: gpmi: replace the gpmi_nfc_reset_block()
Use the latest gpmi_reset_block(), and remove the old gpmi_nfc_reset_block().

Signed-off-by: Huang Shijie <b32955@freescale.com>
2012-08-20 16:08:53 +08:00
3fccd2aee4 ENGR00217505-3 uboot: gpmi: use the community's nand chip database
Abandon our nand chip database, use the community's database.

Signed-off-by: Huang Shijie <b32955@freescale.com>
2012-08-20 16:08:52 +08:00
aec25e93ac ENGR00217505-2 uboot: mtd: update nand_get_flash_type()
update nand_get_flash_type() to the latest code.
Also add the support of ONFI nand.

Signed-off-by: Huang Shijie <b32955@freescale.com>
2012-08-20 16:08:52 +08:00
d4b9e8af7b ENGR00217505-1 uboot: MX6Q-ARD: add a NAND boot config
add a new config for NAND boot in the mx6q-ard board.

Signed-off-by: Huang Shijie <b32955@freescale.com>
2012-08-20 16:08:52 +08:00
82f1345279 ENGR00220486 Modify ODT values for Solo AI
Modify ODT values for Solo AI. Some Solo boards did not passed the "mtest"
from uboot using the previous configuration.
Old configuration:
MXC_DCD_ITEM(76, MMDC_P0_BASE_ADDR + 0x818, 0x00000007)
MXC_DCD_ITEM(77, MMDC_P1_BASE_ADDR + 0x818, 0x00000007)
MXC_DCD_ITEM(67, MMDC_P0_BASE_ADDR + 0x818, 0x00000007)
MXC_DCD_ITEM(68, MMDC_P1_BASE_ADDR + 0x818, 0x00000007)

New configuration:
MXC_DCD_ITEM(76, MMDC_P0_BASE_ADDR + 0x818, 0x00011117)
MXC_DCD_ITEM(77, MMDC_P1_BASE_ADDR + 0x818, 0x00011117)
MXC_DCD_ITEM(67, MMDC_P0_BASE_ADDR + 0x818, 0x00011117)
MXC_DCD_ITEM(68, MMDC_P1_BASE_ADDR + 0x818, 0x00011117)

Signed-off-by: Alejandro Sierra <b18039@freescale.com>
2012-08-20 15:24:00 +08:00
dedfb0b085 ENGR00220161: imx6sl: Add MX6SL EVK Support
Add mx6sl evk board support
- copied from ARM2 board support
- added a new board revision
- removed unused boot device detection

Signed-off-by: Robby Cai <R63905@freescale.com>
2012-08-14 14:07:04 +08:00
4846133a1c ENGR00220164 pfuze:rise VDDARM_IN to 1.425V and work around pfuze1.0
1.Considering pfuze tolerance and IR drop and board ripple, need rise from
  1.375V to 1.425V. Only for Sabresd.
2.workaround pfuze1.0 ER1, set all buck regulator except SW1C to PWM mode.
  now for mx6sl_arm2 and mx6_sabresd.

Signed-off-by: Robin Gong <B38343@freescale.com>
2012-08-13 12:25:00 +08:00
9fb63c201a ENGR00220076 fix the fastboot usb re-connect issue
in fastboot mode, if usb cable re-connectted, the fastboot feature will
fail. This issue is caused by logic control oversight.

Signed-off-by: LiGang <b41990@freescale.com>
2012-08-10 19:21:47 +08:00
526a3e74ad ENGR00219854-1 Enable fastboot feature on mx6q-arm2 board
1. enable fastboot feature on mx6q-arm2 board
2. enlarge fastboot buffer to 320MB
3. correct some usb descriptors

Signed-off-by: LiGang <b41990@freescale.com>
2012-08-09 11:04:03 +08:00
7140562bb1 ENGR00219636 MX6 UBOOT : Enlarge command line buffer size
There is a problem that a too long command line parameter in U-Boot
console will actually be truncated and not properly truncated to the
kernel.

The root cause is that the command line in the U-Boot console is read
into a buffer --- console_buffer[CONFIG_SYS_CBSIZE]. Currently the
CONFIG_SYS_CBSIZE is set as 256. Command line parameter larger than it
will not be recorded. On the other hand, max length of boot parameter of
linux kernel is set to 1024, which means it can accept parameter size as
large as 1024.

So we need to align these 2 values. Enlarge CONFIG_SYS_CBSIZE to 1024 as
well.

Signed-off-by: Eric Sun <jian.sun@freescale.com>
2012-08-07 16:41:13 +08:00
e590a6d2fb ENGR00218915-2 MX6 SabreSD:Use new 8bit bmp boot logo
This patch changes to use new 8bit 600x400 bmp boot logo.
As this boot logo has black background and white words,
the user experience will be better.

Signed-off-by: Liu Ying <Ying.Liu@freescale.com>
2012-08-03 18:23:44 +08:00
e8499570b8 ENGR00218915-1 FSL common:Add new boot logo
This patch adds new boot 8bit 600x400 bmp logo
who has black background and white words.

Signed-off-by: Liu Ying <Ying.Liu@freescale.com>
2012-08-03 18:23:26 +08:00
4e52490e36 ENGR00218972 MX6 Secure Boot, Change to dynamic HAB data authentication
The original secure boot implementation make a consumption that
u-boot.bin will not exceed 0x2F000. With this consumption, the hab data
is hard coded in linker script file to relative address 0x2F000 without
causing any problem.

But when this consumption don't hold, the hard coded way will cause
memory region overlap and break build. So we need to change to a dynamic
way of allocating hab_data. The new implementation put hab data at the
next 0x1000 alignment after u-boot data and text section, instead of
hard coded to 0x2F000.

Similar changes is made to uImage authentication implementation.

Changes in U-Boot includes:
    - in u-boot.lds file, change "__hab_data" to dynamic align to 0x1000
    - change authenticate_image implementation, originally the uImage
      parameters are hard coded, now they are retrived from the
      "load_addr" and the image_hdr

The new secure image layout:

U-Boot
    +-------------------+      DDR_START
    |                   |
    |    U-Boot Image   |
    |                   |
    +-------------------+      DDR_START + UBOOT_SIZE
    |    PADDING        |
    +-------------------+      align to 0x1000
    |    CSF Data       | -
    +-------------------+  +-- CSF + Pad,  Size : 0x2000
    |    PADDING        | -
    +-------------------+

uImage

    +-------------------+      DDR_START
    |                   |
    |     uImage        |
    |                   |
    +-------------------+      DDR_START + UIMAGE_SIZE
    |     PADDING       |
    +-------------------+      align to 0x1000
    |     IVT           | ---- Size : 0x20
    +-------------------+
    |     CSF Data      | -
    +-------------------+  +-- CSF + Pad,  Size : 0x2000
    |     PADDING       | -
    +-------------------+

Signed-off-by: Eric Sun <jian.sun@freescale.com>
2012-08-01 13:25:22 +08:00
499febf0a2 ENGR00218583-5 MX6DL SabreSD Android:Add splashimage uboot var
This patch adds splashimage related variables to board configure
file so that splashimage can work without touching the uboot
variables.

Signed-off-by: Liu Ying <Ying.Liu@freescale.com>
2012-07-31 16:37:06 +08:00
d26a478810 ENGR00218583-4 MX6Q SabreSD Android:Add splashimage uboot var
This patch adds splashimage related variables to board configure
file so that splashimage can work without touching the uboot
variables.

Signed-off-by: Liu Ying <Ying.Liu@freescale.com>
2012-07-31 16:37:06 +08:00
7292258760 ENGR00218583-3 MX6DL SabreSD:Enable splashimage by default
This patch adds CONFIG_SPLASH_SCREEN definition to board
config file to enable splashimage by default.

Signed-off-by: Liu Ying <Ying.Liu@freescale.com>
2012-07-31 16:37:05 +08:00
0eaf2efb6d ENGR00218583-2 MX6Q SabreSD:Enable splashimage by default
This patch adds CONFIG_SPLASH_SCREEN definition to board
config file to enable splashimage by default.

Signed-off-by: Liu Ying <Ying.Liu@freescale.com>
2012-07-31 16:36:56 +08:00
1304702c69 ENGR00218583-1 MX6Q/DL SabreSD:Support LVDS1 splashimage
This patch configures iomux gpr3 register to enable LVDS1
via IPU1 DI1 if user chooses to use it.

Signed-off-by: Liu Ying <Ying.Liu@freescale.com>
2012-07-31 10:11:23 +08:00
1c325b0236 ENGR00218805 imx6: print the silicon revision correctly
The silicon revision is not printed correctly, on ARM2
and sabrelite board, the log is just as the following:

CPU: Freescale i.MX6 family TO0.0 at 792 MHz

We need print the silicon revision correctly as:

CPU: Freescale i.MX6 family TO1.2 at 792 MHz
with i.mx6q TO1.2 chip

Signed-off-by: Jason Liu <r64343@freescale.com>
2012-07-30 17:45:52 +08:00
2e0fba106d ENGR00218465 Android: mx6sl-arm2: fix fastboot crash issue
Fix fastboot crash issue on fastmx6sl-arm2 board.
Enlarge fastboot buffer size to 320MB for mx6 arm2 board, mx6 sabresd
board, thus fastboot could flash system.img up to 320MB

Signed-off-by: LiGang <b41990@freescale.com>
2012-07-30 14:19:44 +08:00
d52f815a0d ENGR00217401 common: fix build warning
Fix the build warning in uboot build.
Fix bug of incorrect dereference to periph2 clock pre divider.
Fix incorrect type of maxpackage size assign, even it's
not used at all in fastboot.

Signed-off-by: Xinyu Chen <xinyu.chen@freescale.com>
2012-07-26 14:27:31 +08:00
2dbfc63a4a ENGR00218282 MX6Q: fix linker error when more configure enabled.
This commit fix the linker error when enable more function(like CONFIG_NAND,
CONFIG_SPASHSCREEN,etc) in uboot ARM2 board, and a possable linker error for
other MX6 boards:

/home/lambert/share/SATA2/R13.3/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/
bin/arm-eabi-ld: section .bss [27831000 -> 278666e7] overlaps section
.rodata [2782387c -> 278609eb]

/home/lambert/share/SATA2/R13.3/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/
bin/arm-eabi-ld: section .rodata.str1.1 [278609ec -> 27867803] overlaps
section .bss [27831000 -> 278666e7]

One issue here is:
A recent gcc added a new unaligned rodata section called '.rodata.str1.1',
which needs to be added the the linker script.  Instead of just adding this
one section, we use a wildcard ".rodata*" to get all rodata linker section
gcc has now and might add in the future.

Another issue is:
The secure boot feature require __hab_data section in uboot linker script,
but it's have a hard coding magic number, but if we enable more code, cause
.text section bigger, it will cross the line, so it report the
first linker error.

This commit disable SECURE_BOOT feature by default for android,
and comments if user want to use this feature, it needs change the
.lds by there configure.
Also, enlarge the magic number that this feature needs to cover
if more code is build in.

Signed-off-by: Zhang Jiejing <jiejing.zhang@freescale.com>
2012-07-25 14:38:35 +08:00
3c3fe71df7 ENGR00218067 mx6sl LDO_BYPASS: enable LDO BYPASS in mx6sl by default
To validate LDO bypass function fully, enable CONFIG_MX6_INTER_LDO_BYPASS
on u-boot and kernel, only for mx6sl.

Signed-off-by: Robin Gong <B38343@freescale.com>
2012-07-24 10:42:59 +08:00
06cfbf9be5 ENGR00217764 MX6 Secure Boot : Fix NAND BOOT Failure due to secure patch
With the secure boot patch. MX6 NAND Boot is not functional. The root
cause is that, the original secure boot patch fills "0xFF' to spacing
regions, due to a issue in ROM code, read pages of all "0xff" will be
treated as a critical error. Thus prevent the U-Boot from booting
normally.

The fix adjust image copy size in IVT so that when secure boot is not
enabled, no unuseful data is copied by ROM code. Also the secure boot
option is default disabled. The end user won't enable it unless they
know what they are doing.

These prevent the ROM code from copied pages of "0xff" data, and fix the
issue.

Signed-off-by: Eric Sun <jian.sun@freescale.com>
2012-07-23 10:43:32 +08:00
5ced161d77 ENGR00217381-02: show sd/mmc clk freq for mmcinfo
It prints sd clk freq for cmd of mmcinfo, then it is much
easier to tell which mode sd/mmc card is running at.

Signed-off-by: Ryan QIAN <b32804@freescale.com>
2012-07-19 14:09:56 +08:00
dc7eace5ee ENGR00217381-01: mx6sl add sd1 and sd2 to support SD3.0
enable SD3.0 support on SD1 and SD2 on mx6sl arm2 cpu board.

Signed-off-by: Ryan QIAN <b32804@freescale.com>
2012-07-19 14:09:55 +08:00
d131ae8ece ENGR00217114-2 MX6 U-Boot, Secure Boot, one code base for MX6Q/DL/SL
Move the uImage authentication to an earlier phase, in this way prevent
DDR content changed by OS load code, causing authentication failure.

Signed-off-by: Eric Sun <jian.sun@freescale.com>
2012-07-13 15:45:12 +08:00
db5d1e6606 ENGR00217114-1 MX6 U-Boot, Secure Boot, one code base for MX6Q/DL/SL
Move the secure boot related implementation code from mx6q_arm2.c to
mx6/generic.c. In this way the HAB feature can be shared by all MX6
platforms

Signed-off-by: Eric Sun <jian.sun@freescale.com>
2012-07-13 15:45:12 +08:00
86a3cb55b2 ENGR00216852 MX6SL ARM2, UBoot : Apply V0.93 LPDDR2 Script
IC Validation team release new LPDDR2 script V0.93 in the following link,
"http://compass.freescale.net/livelink/livelink?func=ll&objId=226733834/"
Make changes to align to it

Signed-off-by: Eric Sun <jian.sun@freescale.com>
2012-07-13 10:53:35 +08:00
616c262d6c ENGR00215197 pfuze MX6SL_ARM2: enable LDO bypass on u-boot
1.enable I2C and I2C bus recovery support on mx6sl_arm2
2.enable LDO bypass on u-boot, by configuring 'CONFIG_MX6_INTER_LDO_BYPASS'
Signed-off-by: Robin Gong <B38343@freescale.com>
2012-07-04 11:24:18 +08:00
8a5eb914dc ENGR00215367 MX6 Platforms, remove "nosmp" in default parameters
nosmp is added in the bootargs originally because of issues in kernel
smp implementation. Now these issues are fixed and we can safely remove
them

Signed-off-by: Eric Sun <jian.sun@freescale.com>
2012-07-03 17:20:46 +08:00
34863332fb ENGR00215633 MX6DL LPDDR2 : enable plugin mode of system boot
For MX6DL LPDDR2 board, in order to use both the 2 channels of the memory, the
"PL301_FAST2" must be set to 0x1. However this bit is not accessible using
DCD. Plugin mode must be utilized for this purpose.

The patch can be verified this way:
    Enter U-boot console
	    > mw.l 0x80000000 0xC0 10
	    > mw.l 0x10000000 0xC1 10
	    > md.l 0x10000000 10
	    > md.l 0x80000000 10
    Before the patch, 0x10000000 and 0x80000000 in fact point to the
    same memory location. So the last 2 dump will show memory content of
    both 0x000000C1
    After the patch, 0x80000000 ponit to channel 0, 0x10000000 point to
    channel 1. the last 2 dump will show memory content of 0x000000C0
    and 0x000000C1 respectively

Signed-off-by: Eric Sun <jian.sun@freescale.com>
2012-07-03 16:53:58 +08:00
b218508875 ENGR00215515 MX6: Move IPU QoS and VDOA/IPU/VPU AXI Cache config to kernel
Move IPU QoS and VDOA/IPU/VPU AXI Cache config
to linux kernel in order to reduce code duplicate

Signed-off-by: Wayne Zou <b36644@freescale.com>
2012-07-02 15:23:04 +08:00
31aa7991a5 ENGR00214947 MX6 UBOOT : default enable wait mode as default parameters
For historical reasons U-Boot set "enable_wait_mode=off" in default
U-Boot parameter. Now wait mode is OK for these platforms so we
remove these settings.

Signed-off-by: Eric Sun <jian.sun@freescale.com>
2012-06-26 19:17:19 +08:00
2b307251d6 ENGR00214866 MX6SL ARM2, UBoot : Apply V0.91 LPDDR2 Script
Validation team released lateset LPDDR2 script V0.91, See
"http://compass.freescale.net/livelink/livelin
k?func=ll&objId=226435628&objAction=browse&viewType=1"
This change is necessary for bus freq scaling

Apply it for both DCD mode and plugin mode.

Signed-off-by: Eric Sun <jian.sun@freescale.com>
2012-06-26 13:15:06 +08:00
22c0075757 ENGR00213689 - U-Boot: EPDC Splash Screen failing for MX 6DL/S
Fix a hang and a garbage update to the E Ink panel with the following
changes for both MX 6DL/S SabreSD and MX 6DL/S ARM2:
- Update the address for the EPDC waveform file to 6MB offset
in SD card.
- Update the waveform file size to cover the default
Pearl panel waveform file.

Signed-off-by: Danny Nold <dannynold@freescale.com>
2012-06-14 18:55:46 -05:00
e8f18f57c7 ENGR00212229 [MX6SL_ARM2]uboot: 8bit MMC cards failed to boot on SD1.
issue:
	SD1 connector on ARM2 is an MS-SD combo one which can not make
good contact with DAT4~DAT7 of 8bit mmc cards. It is an hw limitation
which will cause boot failure from 8bit mmc.

solution:
	disable SD1 8bit mode on MX6SL arm2 board.

Signed-off-by: Ryan QIAN <b32804@freescale.com>
2012-06-08 07:12:24 +08:00
82d93b3ced ENGR00212571 [MX6]Change DRAM ODT setting to save power
We can use weak ODT setting, it will save about 50% DDR
power in runtime. Now we use 0x00007

MMDC0_MPODTCTRL MMDC1_MPODTCTRL, (Ohm)

Setting		DDR_ODT		imx_ODT		Max_overclocking

0x22227		120		060		615MHz
0x11117		120		120		604MHz
0x00007		120		000		576MHz
0x00000		000		000		556MHz

Signed-off-by: Anson Huang <b20788@freescale.com>
2012-06-06 18:31:06 +08:00
6f0a281d42 ENGR00212287 - U-Boot EPDC splash screen: Disable EPDC splash by default
- EPDC splash screen changed to be disabled by default in the config
file for MX6DL_SABRESD and MX6DL_ARM2.  If left enabled, the U-Boot image
will not boot correctly (hang), since some additional content on the boot device
(waveform file) is required for EPDC splash to work correctly.
- Fixes U-Boot break introduced with commit for ENGR00212287

Signed-off-by: Danny Nold <dannynold@freescale.com>
2012-06-04 10:30:44 -05:00
41e9b04376 ENGR00211117 - U-Boot: Add EPDC splash screen for MX 6DL/S platforms
- EPDC Splash support for MX6DL/S Sabre SD
- EPDC Splash support for MX6DL/S ARM2
- Currently, splash screen consists of a simple black border
around a white screen.  Done this way to save in memory footprint.

Signed-off-by: Danny Nold <dannynold@freescale.com>
2012-05-30 09:10:39 -05:00
75752c1cbe ENGR00211038 Fix the PAD_LVE implementation
Fix the PAD_LVE implementation used on MX6SL.

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@freescale.com>
2012-05-30 07:58:09 -05:00
1627b8fd46 ENGR00210918-2 cleanup android support, build pass all boards
- move recovery.h to common inlcude place.
- move supported_reco_envs to soc related, not board related,
- user can change this via configure header,
  don't needs this in every board file.
- pass build for all mx5/mx6 android configs.

Signed-off-by: Zhang Jiejing <jiejing.zhang@freescale.com>
2012-05-29 17:57:10 +08:00
f5d0383f91 ENGR00210918-1 android: add mx6sl android support
- add android build config for mx6sl_arm2 board.
- add gpio support for mx6sl
- add boot image support
- add android recovery support
- add fastboot support, but fastboot cannot transfer file.

Signed-off-by Zhang Jiejing <jiejing.zhang@freescale.com>
2012-05-29 17:57:00 +08:00
b704d5b48d ENGR00209910 Add support for MX6SL mfgtools firmware support
Add support for MX6SL mfgtools firmware support

Signed-off-by: Frank Li <Frank.Li@freescale.com>
2012-05-21 09:13:11 +08:00
fac7b6ab0e ENGR00209899-2 MX6Q: cleanup: cleanup fastboot, udc warnning.
cleanup android fastboot and udc build warnnings.

Signed-off-by: Zhang Jiejing <jiejing.zhang@freescale.com>
2012-05-21 09:50:11 +08:00
500e69df90 ENGR00209899-1 mx6x: add generic gpio interface.
Add generic gpio interface in uboot.

Seems more and more gpio operation invoke in uboot,
without RAW register operation, we should
use generic gpio interface.

you should define the CONFIG_MXC_GPIO

use generic gpio interface:
gpio_request,
gpio_direction_output,
gpio_direction_input,
gpio_set_value,
gpio_get_value, etc.

Test on MX6Q, MX6DL.
Other MX6X should also define this config.

Signed-off-by: Zhang Jiejing <jiejing.zhang@freescale.com>
2012-05-21 09:50:11 +08:00
9b6dfc4b6f ENGR00210014 i.mx6 : i.mx6sl : add PAD_CTL_LVE support for pad configuration
Original pad configuration don't provide enough bitfield width to hold
all necessary information. For MX6Sololite, a "PAD_CTL_LVE" is needed
to be configed for many pins.
iomux_v3_cfg_t is re-orgnized to address this issue. PAD_CTRL is
extended by 1 bit to hold the "PAD_CTL_LVE". Which is mapped to proper
bit location when configure the PAD config register.

Signed-off-by: Mahesh Mahadevan <r9aadq@freescale.com>
2012-05-18 20:05:39 +08:00
66a2afd595 ENGR00180103 MX6 sabreauto: 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: Wayne Zou <b36644@freescale.com>
2012-05-16 14:44:56 +08:00
a043cca635 ENGR00209306 i.mx6:i.mx6sl: fixup the load address for i.mx6sl uImage
In order to support one uImage for the i.mx6 soc family, the bootloader
must need fix up the load/entry address by adding the offset 0x70000000
for MX6SL parts due to the ddr physical address start from 0x80000000 on
MX6SL,but 0x10000000 for the soc other than i.mx6sl

Signed-off-by: Jason Liu <r64343@freescale.com>
2012-05-15 20:27:34 +08:00
2bb05eaa65 ENGR00209059 android: refine fastboot and recovery support.
1. add check asrc register to enter recovery mode,
   rather then check the file.
2. fix the boot.img can not fastboot flash function.
3. consolidate and cleanup fastboot code.
4. clean up many build warnning message.

Signed-off-by: Zhang Jiejing <jiejing.zhang@freescale.com>
2012-05-14 15:11:17 +08:00
c06971be58 ENGR00182459 fastboot: change vid pid to align with winXP fastboot driver.
align vid, pid to let windows fastboot driver can be install.

Signed-off-by: Zhang Jiejing <jiejing.zhang@freescale.com>
2012-05-11 14:46:07 +08:00
970754bfef ENGR00182739 sabresd I2C:add i2c recovery function in board_lateinit
This issue have been found in mx53_smd(ENGR00163704), and found in sabresd
if accessing pfuze while system reboot or reset, I2C bus will be blocked
even if reboot,then pfuze will be failed to be probed, all device driver
which use pfuze regulator will be impacted. In u-boot, we can check the
SDA line low or high, if low, generate SCL and STOP signal to tell I2C
device release I2C bus. Please check ENGR00163704
Signed-off-by: Robin Gong <B38343@freescale.com>
2012-05-11 11:07:31 +08:00
fef250219c ENGR00182426 MX6DL: add fastboot support for MX6DL.
fix mx6dl usb init issue, due to leak of reset phy,
it was only called on MX6Q.

Signed-off-by: Shi Make <make.shi@freescale.com>
Signed-off-by: Zhang Jiejing <jiejing.zhang@freescale.com>
2012-05-09 16:23:46 +08:00
84525c282b ENGR00182017 mx6dl sabresd I2C: fix build error and support mx6dl_sabresd
1.fix build error :
mx6q_sabresd.c: In function 'setup_i2c':
mx6q_sabresd.c:382: error: expected ')' before ';' token
mx6q_sabresd.c:393: error: expected ';' before '}' token
mx6q_sabresd.c: In function 'setup_pmic_voltages':
mx6q_sabresd.c:399: warning: unused variable 'val'
make[1]: *** [mx6q_sabresd.o] Error 1

2.modify mx6dl_sabresd_config to support pfuze on mx6dl sabresd board

Signed-off-by: Robin Gong <B38343@freescale.com>
2012-05-07 11:05:03 +08:00
ddb92a63f7 ENGR00181348 pfuze sabresd: pfuze support in u-boot
add pfuze and I2C support, support cpu internal LDO bypass which can be
enabled by CONFIG_MX6_INTER_LDO_BYPASS
Signed-off-by: Robin Gong <B38343@freescale.com>
2012-05-04 10:54:31 +08:00
cc5984828f ENGR00181621 : MX6Solo SABREAI - Set default boot up to SD Card
Set default boot to SD Card

Signed-off-by: Prabhu Sundararaj <b36876@freescale.com>
2012-05-03 17:07:36 -05:00
372ec1fe34 ENGR00181337-4 i.mx6 : i.mx6sl: Fix FEC RX CRC Error
Since FEC_RX_ER is not connected with PHY(LAN8720A), we need
either configure FEC_RX_ER PAD to other mode than FEC_RX_ER,
or configure FEC_RX_ER PAD to FEC_RX_ER but need pull it down,
otherwise, FEC MAC will report CRC error always. We configure
FEC_RX_ER PAD to GPIO mode here and remove the SW hack which
ignore the CRC error in fec driver

Signed-off-by: Jason Liu <r64343@freescale.com>
2012-05-03 14:21:43 +08:00
adb73799f5 ENGR00181337-3 i.mx6: i.mx6sl: add initial support for i.mx6sl ARM2 board
This patch is to add the initial support for i.mx6sl ARM2 board, the patch does:
	- implemention of LPDDR2 init script
	- Plug-in/DCD mode support to do DDR initialization
	- Debug UART(UART1) support
	- SPI-NOR(M25P32, 4MB) flash support
	- FEC support, PHY(LAN8720A, RMII mode)
	- SD/MMC card support, SD1/SD2/SD3

Signed-off-by: Danny Nold <dannynold@freescale.com>
Signed-off-by: Fugang Duan  <B38611@freescale.com>
Signed-off-by: Jason Liu <r64343@freescale.com>
Signed-off-by: Terry Lv <r65388@freescale.com>
Signed-off-by: Nancy Chen <Nancy.Chen@freescale.com>
Signed-off-by: Eric Sun <jian.sun@freescale.com>
2012-05-03 14:14:09 +08:00
636ccbbb69 ENGR00181337-2 i.mx6 : i.mx6sl arm2 add EPDC support
Add EPDC splash screen support for U-Boot

Signed-off-by: Danny Nold <dannynold@freescale.com>
2012-05-03 14:14:03 +08:00
6abbb22566 ENGR00181337-1 i.mx6 : add initial support for i.mx6sl
This patch is to add the initial support for Freescale i.mx6sl chip.
i.mx6sl is the SoloLite verison of Freescale i.mx6 family.

The patch does:
	- memory layout support,
	- iomux support,
	- clock support,

Signed-off-by: Jason Liu <r64343@freescale.com>
Signed-off-by: Ryan QIAN <b32804@freescale.com>
Signed-off-by: Fugang Duan  <B38611@freescale.com>
2012-05-02 19:27:18 +08:00
f849a9a209 ENGR00180955 mx6q sabresd snvs TKT104835: fix long press ONOFF failed in u-boot
Need set Power Supply Glitch to 0x41736166 and clear Power Supply Glitch
Detect bit when POR or reboot or power on, otherwise system could not be
power off anymore, it will power up auto agian. These steps may be move to
ROM code or fix by soc team in the future(PDM ticket number:TKT104835),
anyway,u-boot fix the issue firsly.
Signed-off-by: Robin Gong <b38343@freescale.com>

Signed-off-by: Robin Gong <B38343@freescale.com>
2012-04-26 17:41:47 +08:00
6739ea7dfb ENGR00180623 fastboot: add fastboot in MX6Q_SABERSD boards
add fastboot function back in MX6Q_SABERSD board.
the MX6DL_SABERSD have usb init related issue which will
keep RESET, but left as later developement.

Signed-off-by: Zhang Jiejing <jiejing.zhang@freescale.com>
2012-04-24 14:08:32 +08:00
074efa5991 MX: Added definition file for MC13892
The MC13892 is a Power Controller used with processors
of the family MX.51. The file adds definitions to be used to setup
the internal registers via SPI.

Signed-off-by: Stefano Babic <sbabic@denx.de>
2012-04-20 17:35:51 +08:00
86d42b68b5 IMX: uniform GPIO interface using GPIO framework
IMX processors has a slightly different interface
to access GPIOs and do not make use of the provided GPIO
framework. The patch substitutes mxc_ specific
functions and make use of the API in asm/gpio.h

Signed-off-by: Stefano Babic <sbabic@denx.de>
2012-04-20 13:13:35 +08:00
7f61979f27 Add generic gpio.h in asm-generic
Since we want want to have a standard GPIO interface, this adds a definition
for this into include/asm-generic/gpio.h.

Signed-off-by: Simon Glass <sjg@chromium.org>
2012-04-20 13:01:23 +08:00
b0b3b3afe4 misc: pmic: fix regression in pmic_fsl.c (SPI)
This fixes write access to PMIC registers, the bug was
introduced partly in commit 64aac65099 and in commit c9fe76dd91.
It was tested on an i.mx31 with a mc13783.

Signed-off-by: Helmut Raiger <helmut.raiger@hale.at>
Acked-by: Stefano Babic <sbabic@denx.de>
2012-04-20 13:00:55 +08:00
18796325e9 misc: pmic: addI2C support to pmic_fsl driver
Signed-off-by: Stefano Babic <sbabic@denx.de>
2012-04-20 12:56:33 +08:00
3a4934917c misc: pmic: use I2C_SET_BUS in pmic I2C
Instead of using directly the i2c_set_bus() function,
the I2C_SET_BUS macro must be used to avoid build
errors for targets without multibus I2C.

Signed-off-by: Stefano Babic <sbabic@denx.de>
2012-04-20 12:54:18 +08:00
6672130e19 misc:pmic:core New generic PMIC driver
I2C or SPI PMIC devices can be accessed.
Separate files: pmic_i2c.c and pmic_spi.c are responsible
for handling transmission over I2C or SPI bus.

New flags:
CONFIG_PMIC - enable PMIC general device.
CONFIG_PMIC_I2C/SPI - specify the interface to be used.

Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Cc: Stefano Babic <sbabic@denx.de>
2012-04-20 12:53:22 +08:00
99af8d9b8e MX: Added Freescale Power Management Driver
The patch add supports for the Freescale's Power
Management Controller (known as Atlas) used together with i.MX31/51
processors. It was tested with a MC13783 (MX31) and
MC13892 (MX51).

Signed-off-by: Stefano Babic <sbabic@denx.de>
2012-04-20 12:48:35 +08:00
7b0cbbd4d0 ENGR00179762: i.MX6: print the SOC revision correctly
For example: The soc rev on i.mx6dl rev 1.0 not print correctly:
CPU:   Freescale i.MX 6 family 0.0V at 792 MHz

This patch help u-boot print out the SOC revision correctly:
CPU: Freescale i.MX6 family TO1.0 at 792 MHz

Signed-off-by: Jason Liu <r64343@freescale.com>
2012-04-18 18:40:57 +08:00
a9f787edee ENGR00179013 : MX6Solo/Quad : SABREAUTO: Add Parallel NOR Support
-Added u-boot config CONFIG_CMD_WEIMNOR for MX6Solo/Quad SABREAUTO to
support WEIM NOR.
- CONFIG_FLASH_HEADER_OFFSET is 0x1000 for WEIM NOR.
-SPI NOR and WEIM NOR has pin conflicts, either one can be enabled.
- mx6q_sabreauto_config, mx6solo_sabreauto_config configured default
for SPI NOR.
-In order to enable  the read/write commands and to boot from WEIM NOR,
need to enable the CONFIG_CMD_WEIMNOR. This will disable SPI-NOR

Signed-off-by: Prabhu Sundararaj <b36876@freescale.com>
2012-04-13 09:05:36 -05:00
f21d545ac0 ENGR00179000 i.mx6q/dl: sabresd: Add the splash screen support
This patch will add the splash screen support for the
i.mx6q/dl splash screen support.

In order to enable the splash screen, you need make sure
the following env variable has been set correctly:

splashimage=0x30000000
splashpos=m,m
lvds_num=0

The splash screen is default OFF, to enable it, please add:
on i.mx6dq sabresd platform:
define CONFIG_SPLASH_SCREEN in include/configs/mx6q_sabresd.h
or on i.mx6dl sabresd platform:
define CONFIG_SPLASH_SCREEN in include/configs/mx6dl_sabresd.h

Signed-off-by: Jason Liu <r64343@freescale.com>
2012-04-13 17:51:03 +08:00
d3020f5dfa ENGR00179437-2 u-boot: mx6q: iomux: code clean up
Remove the dead definiton which never used by iomux-v3 framework
And move the SION bit definiton to arch-mx6/iomux-v3.h for sharing

Signed-off-by: Jason Liu <r64343@freescale.com>
2012-04-13 15:41:00 +08:00
339d655272 ENGR00179437-1: u-boot: iomux: NO_PAD_I/NO_PAD_MUX not set corretly
NO_PAD_I/NO_PAD_MUX not defined correctly, which will cause build error.
And According to iomux-v3.h, the NO_PAD_I/NO_PAD_MUX should be 0 for the
pins which does not have PAD/MUX config.

Signed-off-by: Jason Liu <r64343@freescale.com>
2012-04-13 15:40:59 +08:00
10c85638bd ENGR00179150 MX6Q_ARM2 HAB Boot : avoid uImage authentication on un-fused chip
Before running authentication on uImage in DDR, u-boot first check if
SEC_CONFIG[1] (OTP_CFG5[1]) is burned. If so, it means the chip is in
secure configuration, the authentication continues; if not, the chip
in not in secure configuration, just bypass the authentication

Signed-off-by: Eric Sun <jian.sun@freescale.com>
2012-04-09 13:53:19 +08:00
e16c1bcc77 ENGR00176537 mx6qsabreauto: i2c3_sda route setting
* In RevB boards a steer logic circuit enables the
  route path of I2C3_SDA signal and is controlled by
  EIM_A24__GPIO_5_4 pad.
* Configure GPIO_5_4 as as output and enable steer logic
  circuit.

Signed-off-by: Adrian Alonso <aalonso@freescale.com>
2012-04-05 10:11:06 -05:00
841ea64c9e ENGR00178989: Disable secrity boot configs.
Security boot need to use fuse item. Thus it should not be enabled as
default.

Signed-off-by: Terry Lv <r65388@freescale.com>
2012-04-05 16:57:52 +08:00
afd98c03ab ENGR00139223-2 [MX6Q] Secure Boot, enable HAB on ARM2 platform (Stage 2)
authenticate_image is called to verify uImage when excecuting "bootm", the
uImage togehter with its CSF data should has been located in DDR.

The new uImage layout is as the following:

+------------+  0x0 (0x10800000)    \
|   Header   |                       |
+------------+  0x40                 |
|            |                       |
|            |                       |
|            |                       |
|            |                       |
| Image Data |                       |
.            |                       |
.            |                        > Stuff to be authenticated ------+
.            |                       |                                  |
|            |                       |                                  |
|            |                       |                                  |
+------------+                       |                                  |
|            |                       |                                  |
| Fill Data  |                       |                                  |
|            |                       |                                  |
+------------+ 0x003F_DFE0           |                                  |
|    IVT     |                       |                                  |
+------------+ 0x003F_E000          /                                   |
|            |                                                          |
|  CSF DATA  | <--------------------------------------------------------+
|            |
+------------+
|            |
| Fill Data  |
|            |
+------------+ 0x0040_0000

Signed-off-by: Eric Sun <jian.sun@freescale.com>
2012-04-01 15:19:56 +08:00
87a0deee1c ENGR00139223-1 [MX6Q] Secure Boot, enable HAB on ARM2 platform (Stage 1)
The first stage of High Assurance Boot (HAB) is the authentication of
U-boot. A CST tool is used to generate the CSF data, which include
public key, certificate and instruction of authentication process. Then
it is attached to the original u-boot.bin

The IVT should be modified to contain a pointer to the CSF data. The original
u-boot.bin is with size between 0x27000 to 0x28000. For convinence, we first
extend the u-boot.bin to 0x2F000 (with fill 0xFF). Then concatenate it with
the CSF data. The combined image is again extend to a fixed length (0x31000),
which is used as the IVT size parameter.

The new memory layout is as the following.

    U-Boot Image
    +-------------+
    |   Blank     |
    |-------------| 0x400
    |    IVT      |-----------------------+
    |-------------|                       |
    |             |                       |
    |             |                       |
    |             |                       |
    |Remaining UB |                       |  CSF pointer
    |             |                       |
    |             |                       |
    |             |                       |
    |-------------|                       |
    |             |                       |
    |  Fill Data  |                       |
    |             |                       |
    |-------------| 0x2F000 <-------------+
    |             |
    |   CSF Data  |
    |             |
    |-------------|
    |             |
    |  Fill Data  |
    |             |
    +-------------+ 0x31000

HAB APIs are ROM implemented, the entry table is located in a fixed
location in the ROM. We export them so that during the HAB we can
have some information about the secure boot process. For convinience
some wrapper API is implemented based on the HAB APIs.

 - get_hab_status : used to dump information of authentication result
 - authenticate_image : used by u-boot to authenticate uImage

For security hardware to function, CAAM related clock (CG0[4~6]) must
be open. They are default closed in the original U-boot.
"hab_caam_clock_enable" and "hab_caam_clock_disable" are created to
open and close these clock gates.

The generation of CSF data is not in the scope of this patch. CST tool
will be used for this purpose. The procedure will be introduced in
another document.

Signed-off-by: Eric Sun <jian.sun@freescale.com>
2012-04-01 15:19:56 +08:00
9faa736fe5 ENGR00176837-4 - FEC:enable some macro define for all chip
- Enable below macro define for all chip. Firstly, the marcos
  will be used in later version for later i.MX. Secondly, fix
  the build error in the former i.MX series chip before i.MX6.
	#define PHY_MIPSCR_LINK_UP      (0x1 << 10)
	#define PHY_MIPSCR_SPEED_MASK   (0x3 << 14)
	#define PHY_MIPSCR_1000M        (0x2 << 14)
	#define PHY_MIPSCR_100M         (0x1 << 14)
	#define PHY_MIPSCR_FULL_DUPLEX  (0x1 << 13)

Signed-off-by: Fugang Duan  <B38611@freescale.com>
2012-03-31 10:42:09 +08:00
b849cc37fc ENGR00176834-4 - [imx]:add macro define to include chip head file
- Different chip will include different head file, so add macro
  define to limit the use range.

Signed-off-by: Fugang Duan  <B38611@freescale.com>
2012-03-31 10:42:09 +08:00
39b2b91d75 ENGR00178558 mx6solo sabreauto: integrate DDR3 script V1.1
This patch is used to integrate DDR3 script V1.1 of mx6solo
sabreauto MX6DL_init_DDR3_400MHZ_32bit_sabre_1_1.inc under
http://compass.freescale.net/livelink/livelink?func=ll&objid
=225128962&objAction=browse&sort=name

Signed-off-by: Lily Zhang <r58066@freescale.com>
2012-03-30 20:09:59 +08:00
b57421ea9a ENGR00178024 mx6solo sabreauto: add nosmp arm_freq=800 by default
Add "nosmp arm_freq=800" options for mx6solo sabreauto board
by default

Signed-off-by: Lily Zhang <r58066@freescale.com>
2012-03-30 20:04:53 +08:00
69b21d8f85 ENGR00178547 i.mx6dl sabresd: add android config file
add android config file;
support booti fastboot command and etc.

Signed-off-by: Lin Fuzhen <fuzhen.lin@freescale.com>
2012-03-30 19:17:41 +08:00
3a46a9a1bb mmc: CMD7:MMC_CMD_SELECT_CARD response fix
As per JEDEC document JESD84-A441 (page 105) response for CMD7
(MMC_CMD_SELECT_CARD) response should be R1 instead of R1b. In uboot we
never take MMC to disconnected state and on powerup its always ideal
state which later goes to stand-by state.

from document footnote:
R1 while selecting from Stand-By State to Transfer State; R1b while
selecting from Disconnected State to Programming State.

Signed-off-by: Ajay Bhargav <ajay.bhargav@einfochips.com>
2012-03-29 15:12:06 +08:00
a1db4fa037 ENGR00177954 mx6solo sabreauto: remove MMDC1 setting
Remove MMDC1 setting from DDR script of mx6solo sabreauto
if it's not used.

Signed-off-by: Lily Zhang <r58066@freescale.com>
2012-03-26 19:06:27 +08:00
c51f28d353 ENGR00177909: mx6q/mx6dl SabreSD: SPI-NOR flash not probed as expected
SPI NOR flash(m25p32-vmw6tg) not probed and function as expected, this
due to the lack of iomux pad config and incorrect CS line.

This patch fix the above issue and also fix the mfg config file

(For the code readable, I intent to omit the following checkpatch warning:
 in the iomux/mx6_pins.h WARNING: line over 80 characters)

Signed-off-by: Jason Liu <r64343@freescale.com>
2012-03-26 16:21:14 +08:00
7c7820f1d3 ENGR00177905 : i.mx6q sabresd: add fec auto discover phy configuration.
- i.mx6q sabresd revA ethernet phy addr is 0 (PHYADDRESS1-PHYADDRESS0:00)
  , but revB ethernet phy address is 0x1 (PHYADDRESS1-PHYADDRESS0:01).
  To avoid to change hardware, add auto discover phy address configuration.

Signed-off-by: Fugang Duan  <B38611@freescale.com>
2012-03-26 15:26:45 +08:00
c7e13a3529 ENGR00177783: i.mx6dl: sabresd revB: update DD3 init script
Update the DDR3 script on i.mx6dl SabreSD revB board, the
script got from:
http://wiki.freescale.net/download/attachments/33954617/MX6DL_init_DDR3
_400MHz_64bit_1_2_For_SD_RevB.inc?version=1&modificationDate=1332495827000

Signed-off-by: Jason Liu <r64343@freescale.com>
2012-03-23 19:29:28 +08:00
92347515f0 ENGR00177657: Add mfg configs for mx6dl sabresd and mx6solo sabreauto
Add mfg configs for mx6dl sabresd and mx6solo sabreauto.

Signed-off-by: Terry Lv <r65388@freescale.com>
2012-03-23 09:16:57 +08:00
a009cd46b5 ENGR00176837-4 - imx6solo sabreauto : remove Ethernet phy MICREL macro.
- FEC detect phy OUID to check phy type, so remove MICREL macro
  in board config file.

 Signed-off-by: Fugang Duan  <B38611@freescale.com>
2012-03-22 20:30:20 +08:00
0831e71b50 ENGR00176837-3 - FEC : detect phy ID to match the phy type.
- Add phy id macro definitions.
- Add mxc_get_phy_ouid helper function.
- Use phy ouid to check the phy type.

Signed-off-by: Fugang Duan  <B38611@freescale.com>
2012-03-22 20:30:15 +08:00
3df4b117b5 ENGR00176837-2 - imx6 sabreauto : add i2c3 support for revb board.
- Add i2c3_SDA iomux config for the change of signal traces.

Signed-off-by: Fugang Duan  <B38611@freescale.com>
2012-03-22 20:29:59 +08:00
10e65e82a5 ENGR00176837-1 - imx6 sabreauto : add net support for revb boards.
- In imx6 sabreauto board REVB Ethernet phy adopt AR8031. Add
  phy init rework.

  Signed-off-by: Fugang Duan  <B38611@freescale.com>
2012-03-22 20:21:21 +08:00
222932f207 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:22:49 +08:00
99db93a95b ENGR00177244 - imx6 : Use common fsl_sys_rev to check board reversion
- Use fsl_sys_rev to check Sebreauto board reversion.
- Add macro define for expedient print the board and chip name.
  mx6_chip_name()
  mx6_board_rev_name()

Signed-off-by: Fugang Duan <B38611@freescale.com>
2012-03-20 14:38:55 +08:00
34bd725fcc ENGR00176834-3 - i.MX6DL sabresd : DDR init script update
Use the ddr init script “MX6DL_init_DDR3_400MHz_64bit_1.2.inc”
 for SD revB with Rigel mounted, and update the calibration parameters
 (write leveling, DQS gating, read delay, write delay),
 which is located at:
 	http://compass.freescale.net/livelink/livelink?func=ll&
 objid=225128962&objAction=browse&sort=name

 Signed-off-by: Fugang Duan <B38611@freescale.com>
2012-03-20 13:36:56 +08:00
5ec7e8338a ENGR00176834-2 - i.MX6DL sabresd: board bringup
The serial of patches adds the initial support for mx6dl
sabra sd board:

- DDR3 400MHz@64bit, 1G, 256M*4
- SD/MMC basic operations
- Add PIN/IOMUX support for mmx6dl sabresd.
- Ethernet is ok for 100/1000Mbps.
- OTP fuse

Signed-off-by: Fugang Duan <B38611@freescale.com>
2012-03-20 13:36:36 +08:00
f175905d50 ENGR00176834-1 - [imx6] : add fsl_system_rev to check chip and board.
- Add fsl_system_rev to distinguish chip ID and board reversion.
- Add some api:
  mx6_chip_is_dq()
  mx6_chip_is_dl()
  mx6_chip_is_solo()
  mx6_chip_is_sololite()

  mx6_board_is_reva()
  mx6_board_is_revb()
  mx6_board_is_revc()

Signed-off-by: Fugang Duan <B38611@freescale.com>
2012-03-20 13:36:26 +08:00
2e16cc7388 ENGR00177070 android: isolate booti command to fix build.
fix build error invoke by this patch:

commit e3303f5b59
Author: Lily Zhang <r58066@freescale.com>
Date:   Fri Mar 9 21:16:51 2012 +0800

Signed-off-by: Zhang Jiejing <jiejing.zhang@freescale.com>
2012-03-16 17:49:36 +08:00
d3ea4d7258 ENGR00176347-9 fec : increase wait time for phy link
- remove the excrescent code in enet_board_init function.
- KSZ9021 phy auto-negotiation in mx6solo sabreauto RevA
  is used to establish link with the remote hub or switch.
  In general, the negotiation time is about 3-5 senconds
  But connecting to Gbps hub, the time
  is range from 8s to 15s. So, changing the MAX link waiting time
  to 20s.
  According to repetitious tests, solo ARD ethernet is ok in 100Mbps
  environment. It is not stable in 1000Mbps mode.

Signed-off-by: Fugang Duan <B38611@freescale.com>
2012-03-13 14:55:12 +08:00
e3303f5b59 ENGR00176347-8 cmd_bootm: remove build warning
Remove the following build warning:
cmd_bootm.c: In function 'do_booti':
cmd_bootm.c:1524: warning: unused variable 'partno'
cmd_bootm.c:1520: warning: unused variable 'pte'
cmd_bootm.c:1654: warning: implicit declaration of function 'do_booti_linux'
cmd_bootm.c:1596: warning: 'info.start' may be used uninitialized in
this function
cmd_bootm.c:1502: warning: 'addr' may be used uninitialized in this function

Signed-off-by: Lily Zhang <r58066@freescale.com>
2012-03-13 14:55:12 +08:00
09b87ad3c1 ENGR00176347-7 bootm: remove build warning
Remove the following build warning:
bootm.c: In function 'do_booti_linux':
bootm.c:147: warning: pointer targets in assignment differ in signedness

Signed-off-by: Lily Zhang <r58066@freescale.com>
2012-03-13 14:55:12 +08:00
22404ba0d9 ENGR00176347-6 mx6solo sabreauto: remove build warning
Remove the following build warning:
mx6q_sabreauto.c: In function 'enet_board_init':
mx6q_sabreauto.c:999: warning: unused variable 'reg'
mx6q_sabreauto.c: At top level:
mx6q_sabreauto.c:921: warning: 'phy_read' defined but not used

Signed-off-by: Lily Zhang <r58066@freescale.com>
2012-03-13 14:55:11 +08:00
62705741de ENGR00176347-5 mx6solo sabreauto: set system_rev
Add set_system_rev function. The layout of system_rev is:
bit 0-7: Chip Revision ID. Read from Anatop register
bit 8-11: Board Revision ID. Read from fuse OCOTP_GP1[15:8]
	1: RevA Board
	0: RevB board, Unknown board
bit 12-19: Chip Silicon ID. Read from Anatop register
	0x63: i.MX 6Dual/Quad
	0x61: i.MX 6Solo/DualLite

board_is_rev(system_rev,BOARD_REV_1) can be used to
distinguish RevB board.
board_is_rev(system_rev,BOARD_REV_2) is for RevA board.

Signed-off-by: Lily Zhang <r58066@freescale.com>
2012-03-13 14:55:06 +08:00
01133f43a8 ENGR00176347-4 anatop: add support for mx6solo/dl
Enable anatop command "regul" for mx6solo/DL

Signed-off-by: Lily Zhang <r58066@freescale.com>
2012-03-13 14:14:44 +08:00
3912eaffae ENGR00176347-3 mx6solo sabreauto: add board support
- Add PIN/IOMUX support for mx6solo sabreauto board
- Remove GPIO_9 codes because GPIO_9 is not the backlight
- change system_rev as 0x610000

Signed-off-by: Lily Zhang <r58066@freescale.com>
2012-03-13 14:14:11 +08:00
78403d06c8 ENGR00176347-2 mx6solo sabreauto: add DDR3 support
Add DDR3 script (400MHz@32 bit) in mx6solo sabre auto
board. MX6Solo_DDR3_400MHZ_32bit.inc was delivered
on Mar 7, 2012 by Fan Chongbin-B32609

Signed-off-by: Lily Zhang <r58066@freescale.com>
2012-03-13 13:36:49 +08:00
460cfc0823 ENGR00176347-1 mx6solo sabreauto: add configuration support
The serial of patches adds the initial support for mx6solo
sabra auto board:
- DDR3 400MHz@32bit
- SD/MMC basic operations
- SPI-NOR basic operations
- OTP fuse
- clock command
- Anatop regulator command
- splash screen support by enabling "CONFIG_SPLASH_SCREEN"

Because i.mx6solo share the same ARD board with i.mx6dq,
the same board file is shared between i.mx6dq and i.mx6solo.
CONFIG_MX6DL configuration is used to distinguish the difference.

This patch is used to add mx6solo sabreauto configuration support.

Signed-off-by: Lily Zhang <r58066@freescale.com>
2012-03-13 10:55:43 +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
523 changed files with 226054 additions and 1497 deletions

2
.gitignore vendored
View File

@ -13,6 +13,7 @@
*~
*.swp
*.patch
*.swp
#
# Top-level generic files
@ -58,6 +59,7 @@ cscope.*
/tags
/ctags
/etags
/csc
# OneNAND IPL files
/onenand_ipl/onenand-ipl*

182
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,175 @@ 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_nand_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
mx6solo_sabresd_config \
mx6solo_sabresd_mfg_config \
mx6solo_sabresd_android_config \
mx6dl_sabresd_config \
mx6dl_sabresd_mfg_config \
mx6dl_sabresd_android_config \
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
mx6dl_hdmidongle_config \
mx6dl_hdmidongle_nand_config \
mx6dl_hdmidongle_mfg_config \
mx6dl_hdmidongle_nand_mfg_config \
mx6dl_hdmidongle_android_config \
mx6dl_hdmidongle_nand_android_config \
mx6q_hdmidongle_config \
mx6q_hdmidongle_nand_config \
mx6q_hdmidongle_android_config \
mx6q_hdmidongle_nand_android_config \
mx6q_hdmidongle_mfg_config \
mx6q_hdmidongle_nand_mfg_config : unconfig
@$(MKCONFIG) $(@:_config=) arm arm_cortexa8 mx6q_hdmidongle freescale mx6
mx6q_sabreauto_android_config \
mx6q_sabreauto_nand_android_config \
mx6dl_sabreauto_android_config \
mx6dl_sabreauto_nand_android_config \
mx6solo_sabreauto_android_config \
mx6solo_sabreauto_nand_android_config \
mx6q_sabreauto_weimnor_mfg_config \
mx6q_sabreauto_weimnor_config \
mx6q_sabreauto_nand_mfg_config \
mx6dl_sabreauto_nand_mfg_config \
mx6q_sabreauto_spi-nor_config \
mx6dl_sabreauto_weimnor_mfg_config \
mx6dl_sabreauto_weimnor_config \
mx6dl_sabreauto_config \
mx6dl_sabreauto_mfg_config \
mx6dl_sabreauto_spi-nor_config \
mx6q_sabreauto_mfg_config \
mx6q_sabreauto_spi-nor_mfg_config \
mx6dl_sabreauto_spi-nor_mfg_config \
mx6q_sabreauto_nand_config \
mx6dl_sabreauto_nand_config \
mx6solo_sabreauto_nand_config \
mx6solo_sabreauto_nand_mfg_config \
mx6solo_sabreauto_weimnor_config \
mx6solo_sabreauto_weimnor_mfg_config \
mx6solo_sabreauto_spi-nor_config \
mx6solo_sabreauto_spi-nor_mfg_config \
mx6solo_sabreauto_config \
mx6solo_sabreauto_mfg_config \
mx6q_sabreauto_config : unconfig
@$(MKCONFIG) $(@:_config=) arm arm_cortexa8 mx6q_sabreauto freescale mx6
mx6sl_arm2_config \
mx6sl_arm2_android_config \
mx6sl_arm2_mfg_config \
mx6sl_arm2_iram_config : unconfig
@[ -z "$(findstring iram_,$@)" ] || \
{ echo "TEXT_BASE = 0x00907000" >$(obj)board/freescale/mx6sl_arm2/config.tmp ; \
echo "... with iram configuration" ; \
}
@$(MKCONFIG) $(@:_config=) arm arm_cortexa8 mx6sl_arm2 freescale mx6
mx6sl_evk_config \
mx6sl_evk_android_config \
mx6sl_evk_mfg_config \
mx6sl_evk_iram_config : unconfig
@[ -z "$(findstring iram_,$@)" ] || \
{ echo "TEXT_BASE = 0x00907000" >$(obj)board/freescale/mx6sl_evk/config.tmp ; \
echo "... with iram configuration" ; \
}
@$(MKCONFIG) $(@:_config=) arm arm_cortexa8 mx6sl_evk freescale mx6
omap2420h4_config : unconfig
@$(MKCONFIG) $(@:_config=) arm arm1136 omap2420h4 NULL omap24xx

View File

@ -29,6 +29,7 @@ endif
LIB = $(obj)lib$(VENDOR).a
COBJS-${CONFIG_MXC} += fsl_sys_rev.o
COBJS-${CONFIG_FSL_CADMUS} += cadmus.o
COBJS-${CONFIG_FSL_VIA} += cds_via.o
COBJS-${CONFIG_FSL_DIU_FB} += fsl_diu_fb.o fsl_logo_bmp.o
@ -36,11 +37,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 fsl_bmp_reversed_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

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,137 @@
/*
* Freescale system chip & board version define
* Copyright (C) 2012-2013 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 <config.h>
#include <common.h>
#include <asm/io.h>
#if defined(CONFIG_MX6Q) || defined(CONFIG_MX6DL)
#include <asm/arch/mx6.h>
#endif
#ifdef CONFIG_CMD_IMXOTP
#include <imx_otp.h>
#endif
unsigned int fsl_system_rev;
#if defined(CONFIG_MX6Q) || defined(CONFIG_MX6DL)
/*
* Set fsl_system_rev:
* bit 0-7: Chip Revision ID
* bit 8-11: Board Revision ID
* 0: Unknown or latest revision
* 1: RevA Board
* 2: RevB board
* 3: RevC board
* bit 12-19: Chip Silicon ID
* 0x63: i.MX6 Dual/Quad
* 0x61: i.MX6 Solo/DualLite
* 0x60: i.MX6 SoloLite
*/
void fsl_set_system_rev(void)
{
/* Read Silicon information from Anatop register */
/* The register layout:
* bit 16-23: Chip Silicon ID
* 0x60: i.MX6 SoloLite
* 0x61: i.MX6 Solo/DualLite
* 0x63: i.MX6 Dual/Quad
*
* bit 0-7: Chip Revision ID
* 0x00: TO1.0
* 0x01: TO1.1
* 0x02: TO1.2
*
* exp:
* Chip Major Minor
* i.MX6Q1.0: 6300 00
* i.MX6Q1.1: 6300 01
* i.MX6Solo1.0: 6100 00
* Thus the system_rev will be the following layout:
* | 31 - 20 | 19 - 12 | 11 - 8 | 7 - 0 |
* | resverd | CHIP ID | BD REV | SI REV |
*/
u32 cpu_type = readl(ANATOP_BASE_ADDR + 0x260);
u32 board_type = 0;
/* Chip Silicon ID */
fsl_system_rev = ((cpu_type >> 16) & 0xFF) << 12;
/* Chip silicon major revision */
fsl_system_rev |= ((cpu_type >> 8) & 0xFF) << 4;
fsl_system_rev += 0x10;
/* Chip silicon minor revision */
fsl_system_rev |= cpu_type & 0xFF;
/* Get Board ID information from OCOTP_GP1[15:8]
* bit 12-15: Board type
* 0x0 : Unknown
* 0x1 : Sabre-AI (ARD)
* 0x2 : Smart Device (SD)
* 0x3 : Quick-Start Board (QSB)
* 0x4 : SoloLite EVK (SL-EVK)
* 0x6 : HDMI Dongle
*
* bit 8-11: Board Revision ID
* 0x0 : Unknown or latest revision
* 0x1 : RevA board
* 0x2 : RevB
* 0x3 : RevC
*
* exp:
* i.MX6Q ARD RevA: 0x11
* i.MX6Q ARD RevB: 0x12
* i.MX6Solo ARD RevA: 0x11
* i.MX6Solo ARD RevB: 0x12
*/
#ifdef CONFIG_CMD_IMXOTP
imx_otp_read_one_u32(0x26, &board_type);
switch ((board_type >> 8) & 0xF) {
case 0x1: /* RevA */
fsl_system_rev |= BOARD_REV_2;
break;
case 0x2: /* RevB */
fsl_system_rev |= BOARD_REV_3;
break;
case 0x3: /* RevC */
fsl_system_rev |= BOARD_REV_4;
break;
case 0x0: /* Unknown */
default:
fsl_system_rev |= BOARD_REV_1;
break;
}
#endif
}
int cpu_is_mx6q()
{
if (fsl_system_rev != NULL)
fsl_set_system_rev();
return (((fsl_system_rev & 0xff000)>>12) == 0x63);
}
#else
void fsl_set_system_rev(void)
{
}
int cpu_is_mx6q()
{
return 0;
}
#endif

View File

@ -0,0 +1,129 @@
/*
* Freescale Android Recovery mode checking routing
*
* Copyright (C) 2010-2013 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_powerkey_pressed(void);
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 = NULL;
int state = 0, keys, i;
int ret = 0;
mxc_kpp_init();
/* due to glitch suppression circuit,
wait sometime to let all keys scanned. */
udelay(1000);
keys = mxc_kpp_getc(&key_info);
if (!check_powerkey_pressed())
keys = 0;
#ifdef CONFIG_MX6SL_EVK
/* For mx6sl-evk, hold power+vol_down when boot
will enter recovery mode */
printf("Detecting VOL_DOWN+POWER key for recovery(%d:%d) ...\n",
keys, keys ? key_info->val : 0);
if (keys > 0) {
for (i = 0; i < keys; i++) {
if (test_key(CONFIG_VOL_DOWN_KEY, &key_info[i])) {
ret = 1;
break;
}
}
}
#else
puts("Detecting HOME+POWER key for recovery ...\n");
if (keys > 1) {
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;
}
}
if ((state & RECOVERY_KEY_MASK) == RECOVERY_KEY_MASK)
ret = 1;
#endif
if (key_info)
free(key_info);
return ret;
}
#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_cmd;
int bootdev = get_boot_device();
printf("recovery on bootdev: %d\n", bootdev);
boot_cmd = supported_reco_envs[bootdev].cmd;
if (boot_cmd == NULL) {
printf("Unsupported bootup device for recovery: dev: %d\n", bootdev);
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,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,973 @@
/*
* Copyright (C) 2007, Guennadi Liakhovetski <lg@denx.de>
*
* (C) Copyright 2009-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/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 <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
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,111 @@
/*
* Copyright (C) 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., 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
#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 0x77800000
image_len: .word _end_of_copy - TEXT_BASE + CONFIG_FLASH_HEADER_OFFSET
plugin: .word 0x0
dcd_hdr: .word 0x40A001D2 /* Tag=0xD2, Len=51*8 + 4 + 4, Ver=0x40 */
write_dcd_cmd: .word 0x049C01CC /* Tag=0xCC, Len=51*8 + 4, Param=4 */
/* DCD */
MXC_DCD_ITEM(1, IOMUXC_BASE_ADDR + 0x554, 0x00300000)
MXC_DCD_ITEM(2, IOMUXC_BASE_ADDR + 0x558, 0x00300040)
MXC_DCD_ITEM(3, IOMUXC_BASE_ADDR + 0x560, 0x00300000)
MXC_DCD_ITEM(4, IOMUXC_BASE_ADDR + 0x564, 0x00300040)
MXC_DCD_ITEM(5, IOMUXC_BASE_ADDR + 0x568, 0x00300040)
MXC_DCD_ITEM(6, IOMUXC_BASE_ADDR + 0x570, 0x00300000)
MXC_DCD_ITEM(7, IOMUXC_BASE_ADDR + 0x574, 0x00300000)
MXC_DCD_ITEM(8, IOMUXC_BASE_ADDR + 0x578, 0x00300000)
MXC_DCD_ITEM(9, IOMUXC_BASE_ADDR + 0x57c, 0x00300040)
MXC_DCD_ITEM(10, IOMUXC_BASE_ADDR + 0x580, 0x00300040)
MXC_DCD_ITEM(11, IOMUXC_BASE_ADDR + 0x584, 0x00300000)
MXC_DCD_ITEM(12, IOMUXC_BASE_ADDR + 0x588, 0x00300000)
MXC_DCD_ITEM(13, IOMUXC_BASE_ADDR + 0x590, 0x00300040)
MXC_DCD_ITEM(14, IOMUXC_BASE_ADDR + 0x594, 0x00300000)
MXC_DCD_ITEM(15, IOMUXC_BASE_ADDR + 0x6f0, 0x00300000)
MXC_DCD_ITEM(16, IOMUXC_BASE_ADDR + 0x6f4, 0x00000000)
MXC_DCD_ITEM(17, IOMUXC_BASE_ADDR + 0x6fc, 0x00000000)
MXC_DCD_ITEM(18, IOMUXC_BASE_ADDR + 0x714, 0x00000000)
MXC_DCD_ITEM(19, IOMUXC_BASE_ADDR + 0x718, 0x00300000)
MXC_DCD_ITEM(20, IOMUXC_BASE_ADDR + 0x71c, 0x00300000)
MXC_DCD_ITEM(21, IOMUXC_BASE_ADDR + 0x720, 0x00300000)
MXC_DCD_ITEM(22, IOMUXC_BASE_ADDR + 0x724, 0x04000000)
MXC_DCD_ITEM(23, IOMUXC_BASE_ADDR + 0x728, 0x00300000)
MXC_DCD_ITEM(24, IOMUXC_BASE_ADDR + 0x72c, 0x00300000)
MXC_DCD_ITEM(25, ESDCTL_BASE_ADDR + 0x088, 0x35343535)
MXC_DCD_ITEM(26, ESDCTL_BASE_ADDR + 0x090, 0x4d444c44)
MXC_DCD_ITEM(27, ESDCTL_BASE_ADDR + 0x07c, 0x01370138)
MXC_DCD_ITEM(28, ESDCTL_BASE_ADDR + 0x080, 0x013b013c)
MXC_DCD_ITEM(29, ESDCTL_BASE_ADDR + 0x018, 0x00011740)
MXC_DCD_ITEM(30, ESDCTL_BASE_ADDR + 0x000, 0xc3190000)
MXC_DCD_ITEM(31, ESDCTL_BASE_ADDR + 0x00c, 0x9f5152e3)
MXC_DCD_ITEM(32, ESDCTL_BASE_ADDR + 0x010, 0xb68e8a63)
MXC_DCD_ITEM(33, ESDCTL_BASE_ADDR + 0x014, 0x01ff00db)
MXC_DCD_ITEM(34, ESDCTL_BASE_ADDR + 0x02c, 0x000026d2)
MXC_DCD_ITEM(35, ESDCTL_BASE_ADDR + 0x030, 0x009f0e21)
MXC_DCD_ITEM(36, ESDCTL_BASE_ADDR + 0x008, 0x12273030)
MXC_DCD_ITEM(37, ESDCTL_BASE_ADDR + 0x004, 0x0002002d)
MXC_DCD_ITEM(38, ESDCTL_BASE_ADDR + 0x01c, 0x00008032)
MXC_DCD_ITEM(39, ESDCTL_BASE_ADDR + 0x01c, 0x00008033)
MXC_DCD_ITEM(40, ESDCTL_BASE_ADDR + 0x01c, 0x00028031)
MXC_DCD_ITEM(41, ESDCTL_BASE_ADDR + 0x01c, 0x052080b0)
MXC_DCD_ITEM(42, ESDCTL_BASE_ADDR + 0x01c, 0x04008040)
MXC_DCD_ITEM(43, ESDCTL_BASE_ADDR + 0x01c, 0x0000803a)
MXC_DCD_ITEM(44, ESDCTL_BASE_ADDR + 0x01c, 0x0000803b)
MXC_DCD_ITEM(45, ESDCTL_BASE_ADDR + 0x01c, 0x00028039)
MXC_DCD_ITEM(46, ESDCTL_BASE_ADDR + 0x01c, 0x05208138)
MXC_DCD_ITEM(47, ESDCTL_BASE_ADDR + 0x01c, 0x04008048)
MXC_DCD_ITEM(48, ESDCTL_BASE_ADDR + 0x020, 0x00005800)
MXC_DCD_ITEM(49, ESDCTL_BASE_ADDR + 0x040, 0x04b80003)
MXC_DCD_ITEM(50, ESDCTL_BASE_ADDR + 0x058, 0x00022227)
MXC_DCD_ITEM(51, ESDCTL_BASE_ADDR + 0x01C, 0x00000000)
#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,86 @@
/*
* 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-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
*/
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 : { *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.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 when HAB is not enabled */
/* Extend to align to 0x1000, then put the Hab Data */
. = ALIGN(0x1000);
__hab_data = .;
. = . + 0x2000;
__data_enc_key = .;
/* actually, only 64bytes are needed, but this generates
a size multiple of 512bytes, which is optimal for SD boot */
. = . + 0x200;
__hab_data_end = .;
/* End of Hab Data, Place it before BSS section */
__bss_start = .;
.bss : { *(.bss) }
_end = .;
}

View File

@ -0,0 +1,47 @@
#
# (C) Copyright 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., 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,306 @@
/*
* Copyright (C) 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., 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
#if defined CONFIG_MX6DL_DDR3
dcd_hdr: .word 0x40E002D2 /* Tag=0xD2, Len=91*8 + 4 + 4, Ver=0x40 */
write_dcd_cmd: .word 0x04DC02CC /* Tag=0xCC, Len=91*8 + 4, Param=0x04 */
# IOMUXC_BASE_ADDR = 0x20e0000
# DDR IO TYPE
MXC_DCD_ITEM(1, IOMUXC_BASE_ADDR + 0x774, 0x000c0000)
MXC_DCD_ITEM(2, IOMUXC_BASE_ADDR + 0x754, 0x00000000)
# Clock
MXC_DCD_ITEM(3, IOMUXC_BASE_ADDR + 0x4ac, 0x00000030)
MXC_DCD_ITEM(4, IOMUXC_BASE_ADDR + 0x4b0, 0x00000030)
# Address
MXC_DCD_ITEM(5, IOMUXC_BASE_ADDR + 0x464, 0x00000030)
MXC_DCD_ITEM(6, IOMUXC_BASE_ADDR + 0x490, 0x00000030)
MXC_DCD_ITEM(7, IOMUXC_BASE_ADDR + 0x74c, 0x00000030)
# Control
MXC_DCD_ITEM(8, IOMUXC_BASE_ADDR + 0x494, 0x00000030)
MXC_DCD_ITEM(9, IOMUXC_BASE_ADDR + 0x4a4, 0x00003000)
MXC_DCD_ITEM(10, IOMUXC_BASE_ADDR + 0x4a8, 0x00003000)
MXC_DCD_ITEM(11, IOMUXC_BASE_ADDR + 0x4a0, 0x00000000)
MXC_DCD_ITEM(12, IOMUXC_BASE_ADDR + 0x4b4, 0x00003030)
MXC_DCD_ITEM(13, IOMUXC_BASE_ADDR + 0x4b8, 0x00003030)
MXC_DCD_ITEM(14, IOMUXC_BASE_ADDR + 0x76c, 0x00000030)
# Data Strobe
MXC_DCD_ITEM(15, IOMUXC_BASE_ADDR + 0x750, 0x00020000)
MXC_DCD_ITEM(16, IOMUXC_BASE_ADDR + 0x4bc, 0x00000030)
MXC_DCD_ITEM(17, IOMUXC_BASE_ADDR + 0x4c0, 0x00000030)
MXC_DCD_ITEM(18, IOMUXC_BASE_ADDR + 0x4c4, 0x00000030)
MXC_DCD_ITEM(19, IOMUXC_BASE_ADDR + 0x4c8, 0x00000030)
MXC_DCD_ITEM(20, IOMUXC_BASE_ADDR + 0x4cc, 0x00000030)
MXC_DCD_ITEM(21, IOMUXC_BASE_ADDR + 0x4d0, 0x00000030)
MXC_DCD_ITEM(22, IOMUXC_BASE_ADDR + 0x4d4, 0x00000030)
MXC_DCD_ITEM(23, IOMUXC_BASE_ADDR + 0x4d8, 0x00000030)
# DATA
MXC_DCD_ITEM(24, IOMUXC_BASE_ADDR + 0x760, 0x00020000)
MXC_DCD_ITEM(25, IOMUXC_BASE_ADDR + 0x764, 0x00000030)
MXC_DCD_ITEM(26, IOMUXC_BASE_ADDR + 0x770, 0x00000030)
MXC_DCD_ITEM(27, IOMUXC_BASE_ADDR + 0x778, 0x00000030)
MXC_DCD_ITEM(28, IOMUXC_BASE_ADDR + 0x77c, 0x00000030)
MXC_DCD_ITEM(29, IOMUXC_BASE_ADDR + 0x780, 0x00000030)
MXC_DCD_ITEM(30, IOMUXC_BASE_ADDR + 0x784, 0x00000030)
MXC_DCD_ITEM(31, IOMUXC_BASE_ADDR + 0x78c, 0x00000030)
MXC_DCD_ITEM(32, IOMUXC_BASE_ADDR + 0x748, 0x00000030)
MXC_DCD_ITEM(33, IOMUXC_BASE_ADDR + 0x470, 0x00000030)
MXC_DCD_ITEM(34, IOMUXC_BASE_ADDR + 0x474, 0x00000030)
MXC_DCD_ITEM(35, IOMUXC_BASE_ADDR + 0x478, 0x00000030)
MXC_DCD_ITEM(36, IOMUXC_BASE_ADDR + 0x47c, 0x00000030)
MXC_DCD_ITEM(37, IOMUXC_BASE_ADDR + 0x480, 0x00000030)
MXC_DCD_ITEM(38, IOMUXC_BASE_ADDR + 0x484, 0x00000030)
MXC_DCD_ITEM(39, IOMUXC_BASE_ADDR + 0x488, 0x00000030)
MXC_DCD_ITEM(40, IOMUXC_BASE_ADDR + 0x48c, 0x00000030)
# MMDC_P0_BASE_ADDR = 0x021b0000
# MMDC_P1_BASE_ADDR = 0x021b4000
# Calibrations
# ZQ
MXC_DCD_ITEM(41, MMDC_P0_BASE_ADDR + 0x800, 0xa1390003)
MXC_DCD_ITEM(42, MMDC_P1_BASE_ADDR + 0x800, 0xa1390003)
# write leveling
MXC_DCD_ITEM(43, MMDC_P0_BASE_ADDR + 0x80c, 0x001F001F)
MXC_DCD_ITEM(44, MMDC_P0_BASE_ADDR + 0x810, 0x001F001F)
MXC_DCD_ITEM(45, MMDC_P1_BASE_ADDR + 0x80c, 0x001F001F)
MXC_DCD_ITEM(46, MMDC_P1_BASE_ADDR + 0x810, 0x001F001F)
# DQS gating, read delay, write delay calibration values
# based on calibration compare of 0x00ffff00
MXC_DCD_ITEM(47, MMDC_P0_BASE_ADDR + 0x83c, 0x420E020E)
MXC_DCD_ITEM(48, MMDC_P0_BASE_ADDR + 0x840, 0x02000200)
MXC_DCD_ITEM(49, MMDC_P1_BASE_ADDR + 0x83C, 0x42020202)
MXC_DCD_ITEM(50, MMDC_P1_BASE_ADDR + 0x840, 0x01720172)
MXC_DCD_ITEM(51, MMDC_P0_BASE_ADDR + 0x848, 0x494C4F4C)
MXC_DCD_ITEM(52, MMDC_P1_BASE_ADDR + 0x848, 0x4A4C4C49)
MXC_DCD_ITEM(53, MMDC_P0_BASE_ADDR + 0x850, 0x3F3F3133)
MXC_DCD_ITEM(54, MMDC_P1_BASE_ADDR + 0x850, 0x39373F2E)
# read data bit delay
MXC_DCD_ITEM(55, MMDC_P0_BASE_ADDR + 0x81c, 0x33333333)
MXC_DCD_ITEM(56, MMDC_P0_BASE_ADDR + 0x820, 0x33333333)
MXC_DCD_ITEM(57, MMDC_P0_BASE_ADDR + 0x824, 0x33333333)
MXC_DCD_ITEM(58, MMDC_P0_BASE_ADDR + 0x828, 0x33333333)
MXC_DCD_ITEM(59, MMDC_P1_BASE_ADDR + 0x81c, 0x33333333)
MXC_DCD_ITEM(60, MMDC_P1_BASE_ADDR + 0x820, 0x33333333)
MXC_DCD_ITEM(61, MMDC_P1_BASE_ADDR + 0x824, 0x33333333)
MXC_DCD_ITEM(62, MMDC_P1_BASE_ADDR + 0x828, 0x33333333)
# Complete calibration by forced measurment
MXC_DCD_ITEM(63, MMDC_P0_BASE_ADDR + 0x8b8, 0x00000800)
MXC_DCD_ITEM(64, MMDC_P1_BASE_ADDR + 0x8b8, 0x00000800)
# MMDC init:
# in DDR3, 64-bit mode, only MMDC0 is initiated:
MXC_DCD_ITEM(65, MMDC_P0_BASE_ADDR + 0x004, 0x0002002d)
MXC_DCD_ITEM(66, MMDC_P0_BASE_ADDR + 0x008, 0x00333030)
MXC_DCD_ITEM(67, MMDC_P0_BASE_ADDR + 0x00c, 0x40445323)
MXC_DCD_ITEM(68, MMDC_P0_BASE_ADDR + 0x010, 0xb66e8c63)
MXC_DCD_ITEM(69, MMDC_P0_BASE_ADDR + 0x014, 0x01ff00db)
MXC_DCD_ITEM(70, MMDC_P0_BASE_ADDR + 0x018, 0x00081740)
MXC_DCD_ITEM(71, MMDC_P0_BASE_ADDR + 0x01c, 0x00008000)
MXC_DCD_ITEM(72, MMDC_P0_BASE_ADDR + 0x02c, 0x000026d2)
MXC_DCD_ITEM(73, MMDC_P0_BASE_ADDR + 0x030, 0x00440e21)
MXC_DCD_ITEM(74, MMDC_P0_BASE_ADDR + 0x040, 0x00000027)
MXC_DCD_ITEM(75, MMDC_P0_BASE_ADDR + 0x000, 0xc31a0000)
# Initialize 2GB DDR3 - Micron MT41J128M
# MR2
MXC_DCD_ITEM(76, MMDC_P0_BASE_ADDR + 0x01c, 0x04008032)
MXC_DCD_ITEM(77, MMDC_P0_BASE_ADDR + 0x01c, 0x0400803a)
# MR3
MXC_DCD_ITEM(78, MMDC_P0_BASE_ADDR + 0x01c, 0x00008033)
MXC_DCD_ITEM(79, MMDC_P0_BASE_ADDR + 0x01c, 0x0000803b)
# MR1
MXC_DCD_ITEM(80, MMDC_P0_BASE_ADDR + 0x01c, 0x00428031)
MXC_DCD_ITEM(81, MMDC_P0_BASE_ADDR + 0x01c, 0x00428039)
# MR0
MXC_DCD_ITEM(82, MMDC_P0_BASE_ADDR + 0x01c, 0x07208030)
MXC_DCD_ITEM(83, MMDC_P0_BASE_ADDR + 0x01c, 0x07208038)
# ZQ calibration
MXC_DCD_ITEM(84, MMDC_P0_BASE_ADDR + 0x01c, 0x04008040)
MXC_DCD_ITEM(85, MMDC_P0_BASE_ADDR + 0x01c, 0x04008048)
# final DDR setup
MXC_DCD_ITEM(86, MMDC_P0_BASE_ADDR + 0x020, 0x00005800)
MXC_DCD_ITEM(87, MMDC_P0_BASE_ADDR + 0x818, 0x00000007)
MXC_DCD_ITEM(88, MMDC_P1_BASE_ADDR + 0x818, 0x00000007)
MXC_DCD_ITEM(89, MMDC_P0_BASE_ADDR + 0x004, 0x0002556d)
MXC_DCD_ITEM(90, MMDC_P1_BASE_ADDR + 0x404, 0x00011006)
MXC_DCD_ITEM(91, MMDC_P0_BASE_ADDR + 0x01c, 0x00000000)
#else
dcd_hdr: .word 0x40D802D2 /* Tag=0xD2, Len=90*8 + 4 + 4, Ver=0x40 */
write_dcd_cmd: .word 0x04D402CC /* Tag=0xCC, Len=90*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, 0x00000030)
MXC_DCD_ITEM(22, IOMUXC_BASE_ADDR + 0x58c, 0x00000000)
MXC_DCD_ITEM(23, IOMUXC_BASE_ADDR + 0x59c, 0x00000030)
MXC_DCD_ITEM(24, IOMUXC_BASE_ADDR + 0x5a0, 0x00000030)
MXC_DCD_ITEM(25, IOMUXC_BASE_ADDR + 0x784, 0x00000030)
MXC_DCD_ITEM(26, IOMUXC_BASE_ADDR + 0x788, 0x00000030)
MXC_DCD_ITEM(27, IOMUXC_BASE_ADDR + 0x794, 0x00000030)
MXC_DCD_ITEM(28, IOMUXC_BASE_ADDR + 0x79c, 0x00000030)
MXC_DCD_ITEM(29, IOMUXC_BASE_ADDR + 0x7a0, 0x00000030)
MXC_DCD_ITEM(30, IOMUXC_BASE_ADDR + 0x7a4, 0x00000030)
MXC_DCD_ITEM(31, IOMUXC_BASE_ADDR + 0x7a8, 0x00000030)
MXC_DCD_ITEM(32, IOMUXC_BASE_ADDR + 0x748, 0x00000030)
MXC_DCD_ITEM(33, IOMUXC_BASE_ADDR + 0x74c, 0x00000030)
MXC_DCD_ITEM(34, IOMUXC_BASE_ADDR + 0x750, 0x00020000)
MXC_DCD_ITEM(35, IOMUXC_BASE_ADDR + 0x758, 0x00000000)
MXC_DCD_ITEM(36, IOMUXC_BASE_ADDR + 0x774, 0x00020000)
MXC_DCD_ITEM(37, IOMUXC_BASE_ADDR + 0x78c, 0x00000030)
MXC_DCD_ITEM(38, IOMUXC_BASE_ADDR + 0x798, 0x000C0000)
MXC_DCD_ITEM(39, MMDC_P0_BASE_ADDR + 0x81c, 0x33333333)
MXC_DCD_ITEM(40, MMDC_P0_BASE_ADDR + 0x820, 0x33333333)
MXC_DCD_ITEM(41, MMDC_P0_BASE_ADDR + 0x824, 0x33333333)
MXC_DCD_ITEM(42, MMDC_P0_BASE_ADDR + 0x828, 0x33333333)
MXC_DCD_ITEM(43, MMDC_P1_BASE_ADDR + 0x81c, 0x33333333)
MXC_DCD_ITEM(44, MMDC_P1_BASE_ADDR + 0x820, 0x33333333)
MXC_DCD_ITEM(45, MMDC_P1_BASE_ADDR + 0x824, 0x33333333)
MXC_DCD_ITEM(46, MMDC_P1_BASE_ADDR + 0x828, 0x33333333)
MXC_DCD_ITEM(47, MMDC_P0_BASE_ADDR + 0x018, 0x00081740)
MXC_DCD_ITEM(48, MMDC_P0_BASE_ADDR + 0x01c, 0x00008000)
MXC_DCD_ITEM(49, MMDC_P0_BASE_ADDR + 0x00c, 0x555A7975)
MXC_DCD_ITEM(50, MMDC_P0_BASE_ADDR + 0x010, 0xFF538E64)
MXC_DCD_ITEM(51, MMDC_P0_BASE_ADDR + 0x014, 0x01FF00DB)
MXC_DCD_ITEM(52, MMDC_P0_BASE_ADDR + 0x02c, 0x000026D2)
MXC_DCD_ITEM(53, MMDC_P0_BASE_ADDR + 0x030, 0x005B0E21)
MXC_DCD_ITEM(54, MMDC_P0_BASE_ADDR + 0x008, 0x09444040)
MXC_DCD_ITEM(55, MMDC_P0_BASE_ADDR + 0x004, 0x00025576)
MXC_DCD_ITEM(56, MMDC_P0_BASE_ADDR + 0x040, 0x00000027)
MXC_DCD_ITEM(57, MMDC_P0_BASE_ADDR + 0x000, 0x831A0000)
MXC_DCD_ITEM(58, MMDC_P0_BASE_ADDR + 0x01c, 0x04088032)
MXC_DCD_ITEM(59, MMDC_P0_BASE_ADDR + 0x01c, 0x0408803A)
MXC_DCD_ITEM(60, MMDC_P0_BASE_ADDR + 0x01c, 0x00008033)
MXC_DCD_ITEM(61, MMDC_P0_BASE_ADDR + 0x01c, 0x0000803B)
MXC_DCD_ITEM(62, MMDC_P0_BASE_ADDR + 0x01c, 0x00428031)
MXC_DCD_ITEM(63, MMDC_P0_BASE_ADDR + 0x01c, 0x00428039)
MXC_DCD_ITEM(64, MMDC_P0_BASE_ADDR + 0x01c, 0x09408030)
MXC_DCD_ITEM(65, MMDC_P0_BASE_ADDR + 0x01c, 0x09408038)
MXC_DCD_ITEM(66, MMDC_P0_BASE_ADDR + 0x01c, 0x04008040)
MXC_DCD_ITEM(67, MMDC_P0_BASE_ADDR + 0x01c, 0x04008048)
MXC_DCD_ITEM(68, MMDC_P0_BASE_ADDR + 0x800, 0xA1380003)
MXC_DCD_ITEM(69, MMDC_P1_BASE_ADDR + 0x800, 0xA1380003)
MXC_DCD_ITEM(70, MMDC_P0_BASE_ADDR + 0x020, 0x00005800)
MXC_DCD_ITEM(71, MMDC_P0_BASE_ADDR + 0x818, 0x00000007)
MXC_DCD_ITEM(72, MMDC_P1_BASE_ADDR + 0x818, 0x00000007)
MXC_DCD_ITEM(73, MMDC_P0_BASE_ADDR + 0x83c, 0x427D0303)
MXC_DCD_ITEM(74, MMDC_P0_BASE_ADDR + 0x840, 0x02740267)
MXC_DCD_ITEM(75, MMDC_P1_BASE_ADDR + 0x83c, 0x43010301)
MXC_DCD_ITEM(76, MMDC_P1_BASE_ADDR + 0x840, 0x02770247)
MXC_DCD_ITEM(77, MMDC_P0_BASE_ADDR + 0x848, 0x44343a36)
MXC_DCD_ITEM(78, MMDC_P1_BASE_ADDR + 0x848, 0x3e3d363d)
MXC_DCD_ITEM(79, MMDC_P0_BASE_ADDR + 0x850, 0x37434644)
MXC_DCD_ITEM(80, MMDC_P1_BASE_ADDR + 0x850, 0x472a4640)
# fine tune SDCLK duty cyc to low - seen to improve measured duty cycle of i.mx6
MXC_DCD_ITEM(81, MMDC_P0_BASE_ADDR + 0x8c0, 0x24911492)
MXC_DCD_ITEM(82, MMDC_P1_BASE_ADDR + 0x8c0, 0x24911492)
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, 0x001F001F)
MXC_DCD_ITEM(86, MMDC_P1_BASE_ADDR + 0x810, 0x001F001F)
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)
#endif
#endif

View File

@ -0,0 +1,167 @@
/*
* Copyright (C) 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., 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 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
*/
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_hdmidongle/flash_header.o (.text.flasheader)
cpu/arm_cortexa8/start.o
board/freescale/mx6q_hdmidongle/libmx6q_hdmidongle.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 : { *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.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,533 @@
/*
* 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., 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
#if defined CONFIG_MX6SOLO_DDR3
dcd_hdr: .word 0x40E001D2 /* Tag=0xD2, Len=59*8 + 4 + 4, Ver=0x40 */
write_dcd_cmd: .word 0x04DC01CC /* Tag=0xCC, Len=80*8 + 4, Param=0x04 */
/* DCD */
/* DDR3 initialization based on the MX6Solo Auto Reference Design (ARD) */
/* DDR IO TYPE */
MXC_DCD_ITEM(1, IOMUXC_BASE_ADDR + 0x774, 0x000c0000)
MXC_DCD_ITEM(2, IOMUXC_BASE_ADDR + 0x754, 0x00000000)
/* CLOCK */
MXC_DCD_ITEM(3, IOMUXC_BASE_ADDR + 0x4ac, 0x00000030)
MXC_DCD_ITEM(4, IOMUXC_BASE_ADDR + 0x4b0, 0x00000030)
/* ADDRESS */
MXC_DCD_ITEM(5, IOMUXC_BASE_ADDR + 0x464, 0x00000030)
MXC_DCD_ITEM(6, IOMUXC_BASE_ADDR + 0x490, 0x00000030)
MXC_DCD_ITEM(7, IOMUXC_BASE_ADDR + 0x74c, 0x00000030)
/* CONTROLE */
MXC_DCD_ITEM(8, IOMUXC_BASE_ADDR + 0x494, 0x00000030)
MXC_DCD_ITEM(9, IOMUXC_BASE_ADDR + 0x4a0, 0x00000000)
MXC_DCD_ITEM(10, IOMUXC_BASE_ADDR + 0x4b4, 0x00000030)
MXC_DCD_ITEM(11, IOMUXC_BASE_ADDR + 0x4b8, 0x00000030)
MXC_DCD_ITEM(12, IOMUXC_BASE_ADDR + 0x76c, 0x00000030)
/* DATA STROBE */
MXC_DCD_ITEM(13, IOMUXC_BASE_ADDR + 0x750, 0x00020000)
MXC_DCD_ITEM(14, IOMUXC_BASE_ADDR + 0x4bc, 0x00000028)
MXC_DCD_ITEM(15, IOMUXC_BASE_ADDR + 0x4c0, 0x00000028)
MXC_DCD_ITEM(16, IOMUXC_BASE_ADDR + 0x4c4, 0x00000028)
MXC_DCD_ITEM(17, IOMUXC_BASE_ADDR + 0x4c8, 0x00000028)
/* DATA */
MXC_DCD_ITEM(18, IOMUXC_BASE_ADDR + 0x760, 0x00020000)
MXC_DCD_ITEM(19, IOMUXC_BASE_ADDR + 0x764, 0x00000028)
MXC_DCD_ITEM(20, IOMUXC_BASE_ADDR + 0x770, 0x00000028)
MXC_DCD_ITEM(21, IOMUXC_BASE_ADDR + 0x778, 0x00000028)
MXC_DCD_ITEM(22, IOMUXC_BASE_ADDR + 0x77c, 0x00000028)
MXC_DCD_ITEM(23, IOMUXC_BASE_ADDR + 0x470, 0x00000028)
MXC_DCD_ITEM(24, IOMUXC_BASE_ADDR + 0x474, 0x00000028)
MXC_DCD_ITEM(25, IOMUXC_BASE_ADDR + 0x478, 0x00000028)
MXC_DCD_ITEM(26, IOMUXC_BASE_ADDR + 0x47c, 0x00000028)
/* ZQ */
MXC_DCD_ITEM(27, MMDC_P0_BASE_ADDR + 0x800, 0xa1390003)
/* Write leveling */
MXC_DCD_ITEM(28, MMDC_P0_BASE_ADDR + 0x80c, 0x001f001f)
MXC_DCD_ITEM(29, MMDC_P0_BASE_ADDR + 0x810, 0x001f001f)
MXC_DCD_ITEM(30, MMDC_P0_BASE_ADDR + 0x83c, 0x421c0216)
MXC_DCD_ITEM(31, MMDC_P0_BASE_ADDR + 0x840, 0x017b017a)
MXC_DCD_ITEM(32, MMDC_P0_BASE_ADDR + 0x848, 0x4b4a4e4c)
MXC_DCD_ITEM(33, MMDC_P0_BASE_ADDR + 0x850, 0x3f3f3334)
/* Read data bit delay */
MXC_DCD_ITEM(34, MMDC_P0_BASE_ADDR + 0x81c, 0x33333333)
MXC_DCD_ITEM(35, MMDC_P0_BASE_ADDR + 0x820, 0x33333333)
MXC_DCD_ITEM(36, MMDC_P0_BASE_ADDR + 0x824, 0x33333333)
MXC_DCD_ITEM(37, MMDC_P0_BASE_ADDR + 0x828, 0x33333333)
/* Complete calibration by forced measurement */
MXC_DCD_ITEM(38, MMDC_P0_BASE_ADDR + 0x8b8, 0x00000800)
MXC_DCD_ITEM(39, MMDC_P0_BASE_ADDR + 0x004, 0x00020025)
MXC_DCD_ITEM(40, MMDC_P0_BASE_ADDR + 0x008, 0x00333030)
MXC_DCD_ITEM(41, MMDC_P0_BASE_ADDR + 0x00c, 0x676b5313)
MXC_DCD_ITEM(42, MMDC_P0_BASE_ADDR + 0x010, 0xb66e8b63)
MXC_DCD_ITEM(43, MMDC_P0_BASE_ADDR + 0x014, 0x01ff00db)
MXC_DCD_ITEM(44, MMDC_P0_BASE_ADDR + 0x018, 0x00001740)
MXC_DCD_ITEM(45, MMDC_P0_BASE_ADDR + 0x01c, 0x00008000)
MXC_DCD_ITEM(46, MMDC_P0_BASE_ADDR + 0x02c, 0x000026d2)
MXC_DCD_ITEM(47, MMDC_P0_BASE_ADDR + 0x030, 0x006b1023)
MXC_DCD_ITEM(48, MMDC_P0_BASE_ADDR + 0x040, 0x00000027)
MXC_DCD_ITEM(49, MMDC_P0_BASE_ADDR + 0x000, 0x84190000)
MXC_DCD_ITEM(50, MMDC_P0_BASE_ADDR + 0x01c, 0x04008032)
MXC_DCD_ITEM(51, MMDC_P0_BASE_ADDR + 0x01c, 0x00008033)
MXC_DCD_ITEM(52, MMDC_P0_BASE_ADDR + 0x01c, 0x00048031)
MXC_DCD_ITEM(53, MMDC_P0_BASE_ADDR + 0x01c, 0x05208030)
MXC_DCD_ITEM(54, MMDC_P0_BASE_ADDR + 0x01c, 0x04008040)
MXC_DCD_ITEM(55, MMDC_P0_BASE_ADDR + 0x020, 0x00005800)
MXC_DCD_ITEM(56, MMDC_P0_BASE_ADDR + 0x818, 0x00011117)
MXC_DCD_ITEM(57, MMDC_P0_BASE_ADDR + 0x004, 0x00025565)
MXC_DCD_ITEM(58, MMDC_P0_BASE_ADDR + 0x404, 0x00011006)
MXC_DCD_ITEM(59, MMDC_P0_BASE_ADDR + 0x01c, 0x00000000)
#elif defined CONFIG_LPDDR2
dcd_hdr: .word 0x40F003D2 /* Tag=0xD2, Len=125*8 + 4 + 4, Ver=0x40 */
write_dcd_cmd: .word 0x04EC03CC /* Tag=0xCC, Len=125*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)
#elif defined CONFIG_MX6DL_DDR3
dcd_hdr: .word 0x40A002D2 /* Tag=0xD2, Len=83*8 + 4 + 4, Ver=0x40 */
write_dcd_cmd: .word 0x049C02CC /* Tag=0xCC, Len=83*8 + 4, Param=0x04 */
# IOMUXC_BASE_ADDR = 0x20e0000
# DDR IO TYPE
MXC_DCD_ITEM(1, IOMUXC_BASE_ADDR + 0x774, 0x000c0000)
MXC_DCD_ITEM(2, IOMUXC_BASE_ADDR + 0x754, 0x00000000)
# Clock
MXC_DCD_ITEM(3, IOMUXC_BASE_ADDR + 0x4ac, 0x00000030)
MXC_DCD_ITEM(4, IOMUXC_BASE_ADDR + 0x4b0, 0x00000030)
# Address
MXC_DCD_ITEM(5, IOMUXC_BASE_ADDR + 0x464, 0x00000030)
MXC_DCD_ITEM(6, IOMUXC_BASE_ADDR + 0x490, 0x00000030)
MXC_DCD_ITEM(7, IOMUXC_BASE_ADDR + 0x74c, 0x00000030)
# Control
MXC_DCD_ITEM(8, IOMUXC_BASE_ADDR + 0x494, 0x00000030)
MXC_DCD_ITEM(9, IOMUXC_BASE_ADDR + 0x4a0, 0x00000000)
MXC_DCD_ITEM(10, IOMUXC_BASE_ADDR + 0x4b4, 0x00000030)
MXC_DCD_ITEM(11, IOMUXC_BASE_ADDR + 0x4b8, 0x00000030)
MXC_DCD_ITEM(12, IOMUXC_BASE_ADDR + 0x76c, 0x00000030)
# Data Strobe
MXC_DCD_ITEM(13, IOMUXC_BASE_ADDR + 0x750, 0x00020000)
MXC_DCD_ITEM(14, IOMUXC_BASE_ADDR + 0x4bc, 0x00000028)
MXC_DCD_ITEM(15, IOMUXC_BASE_ADDR + 0x4c0, 0x00000028)
MXC_DCD_ITEM(16, IOMUXC_BASE_ADDR + 0x4c4, 0x00000028)
MXC_DCD_ITEM(17, IOMUXC_BASE_ADDR + 0x4c8, 0x00000028)
MXC_DCD_ITEM(18, IOMUXC_BASE_ADDR + 0x4cc, 0x00000028)
MXC_DCD_ITEM(19, IOMUXC_BASE_ADDR + 0x4d0, 0x00000028)
MXC_DCD_ITEM(20, IOMUXC_BASE_ADDR + 0x4d4, 0x00000028)
MXC_DCD_ITEM(21, IOMUXC_BASE_ADDR + 0x4d8, 0x00000028)
# DATA
MXC_DCD_ITEM(22, IOMUXC_BASE_ADDR + 0x760, 0x00020000)
MXC_DCD_ITEM(23, IOMUXC_BASE_ADDR + 0x764, 0x00000028)
MXC_DCD_ITEM(24, IOMUXC_BASE_ADDR + 0x770, 0x00000028)
MXC_DCD_ITEM(25, IOMUXC_BASE_ADDR + 0x778, 0x00000028)
MXC_DCD_ITEM(26, IOMUXC_BASE_ADDR + 0x77c, 0x00000028)
MXC_DCD_ITEM(27, IOMUXC_BASE_ADDR + 0x780, 0x00000028)
MXC_DCD_ITEM(28, IOMUXC_BASE_ADDR + 0x784, 0x00000028)
MXC_DCD_ITEM(29, IOMUXC_BASE_ADDR + 0x78c, 0x00000028)
MXC_DCD_ITEM(30, IOMUXC_BASE_ADDR + 0x748, 0x00000028)
MXC_DCD_ITEM(31, IOMUXC_BASE_ADDR + 0x470, 0x00000028)
MXC_DCD_ITEM(32, IOMUXC_BASE_ADDR + 0x474, 0x00000028)
MXC_DCD_ITEM(33, IOMUXC_BASE_ADDR + 0x478, 0x00000028)
MXC_DCD_ITEM(34, IOMUXC_BASE_ADDR + 0x47c, 0x00000028)
MXC_DCD_ITEM(35, IOMUXC_BASE_ADDR + 0x480, 0x00000028)
MXC_DCD_ITEM(36, IOMUXC_BASE_ADDR + 0x484, 0x00000028)
MXC_DCD_ITEM(37, IOMUXC_BASE_ADDR + 0x488, 0x00000028)
MXC_DCD_ITEM(38, IOMUXC_BASE_ADDR + 0x48c, 0x00000028)
# MMDC_P0_BASE_ADDR = 0x021b0000
# MMDC_P1_BASE_ADDR = 0x021b4000
# Calibrations
# ZQ
MXC_DCD_ITEM(39, MMDC_P0_BASE_ADDR + 0x800, 0xa1390003)
# write leveling
MXC_DCD_ITEM(40, MMDC_P0_BASE_ADDR + 0x80c, 0x001F001F)
MXC_DCD_ITEM(41, MMDC_P0_BASE_ADDR + 0x810, 0x001F001F)
MXC_DCD_ITEM(42, MMDC_P1_BASE_ADDR + 0x80c, 0x001F001F)
MXC_DCD_ITEM(43, MMDC_P1_BASE_ADDR + 0x810, 0x001F001F)
# DQS gating, read delay, write delay calibration values
# based on calibration compare of 0x00ffff00
MXC_DCD_ITEM(44, MMDC_P0_BASE_ADDR + 0x83c, 0x42190217)
MXC_DCD_ITEM(45, MMDC_P0_BASE_ADDR + 0x840, 0x017B017B)
MXC_DCD_ITEM(46, MMDC_P1_BASE_ADDR + 0x83C, 0x4176017B)
MXC_DCD_ITEM(47, MMDC_P1_BASE_ADDR + 0x840, 0x015F016C)
MXC_DCD_ITEM(48, MMDC_P0_BASE_ADDR + 0x848, 0x4C4C4D4C)
MXC_DCD_ITEM(49, MMDC_P1_BASE_ADDR + 0x848, 0x4A4D4C48)
MXC_DCD_ITEM(50, MMDC_P0_BASE_ADDR + 0x850, 0x3F3F3F40)
MXC_DCD_ITEM(51, MMDC_P1_BASE_ADDR + 0x850, 0x3538382E)
# read data bit delay
MXC_DCD_ITEM(52, MMDC_P0_BASE_ADDR + 0x81c, 0x33333333)
MXC_DCD_ITEM(53, MMDC_P0_BASE_ADDR + 0x820, 0x33333333)
MXC_DCD_ITEM(54, MMDC_P0_BASE_ADDR + 0x824, 0x33333333)
MXC_DCD_ITEM(55, MMDC_P0_BASE_ADDR + 0x828, 0x33333333)
MXC_DCD_ITEM(56, MMDC_P1_BASE_ADDR + 0x81c, 0x33333333)
MXC_DCD_ITEM(57, MMDC_P1_BASE_ADDR + 0x820, 0x33333333)
MXC_DCD_ITEM(58, MMDC_P1_BASE_ADDR + 0x824, 0x33333333)
MXC_DCD_ITEM(59, MMDC_P1_BASE_ADDR + 0x828, 0x33333333)
# Complete calibration by forced measurment
MXC_DCD_ITEM(60, MMDC_P0_BASE_ADDR + 0x8b8, 0x00000800)
MXC_DCD_ITEM(61, MMDC_P1_BASE_ADDR + 0x8b8, 0x00000800)
# MMDC init:
# in DDR3, 64-bit mode, only MMDC0 is initiated:
MXC_DCD_ITEM(62, MMDC_P0_BASE_ADDR + 0x004, 0x00020025)
MXC_DCD_ITEM(63, MMDC_P0_BASE_ADDR + 0x008, 0x00333030)
MXC_DCD_ITEM(64, MMDC_P0_BASE_ADDR + 0x00c, 0x676B5313)
MXC_DCD_ITEM(65, MMDC_P0_BASE_ADDR + 0x010, 0xB66E8B63)
MXC_DCD_ITEM(66, MMDC_P0_BASE_ADDR + 0x014, 0x01ff00db)
MXC_DCD_ITEM(67, MMDC_P0_BASE_ADDR + 0x018, 0x00001740)
MXC_DCD_ITEM(68, MMDC_P0_BASE_ADDR + 0x01c, 0x00008000)
MXC_DCD_ITEM(69, MMDC_P0_BASE_ADDR + 0x02c, 0x000026d2)
MXC_DCD_ITEM(70, MMDC_P0_BASE_ADDR + 0x030, 0x006B1023)
MXC_DCD_ITEM(71, MMDC_P0_BASE_ADDR + 0x040, 0x00000047)
MXC_DCD_ITEM(72, MMDC_P0_BASE_ADDR + 0x000, 0x841A0000)
# Initialize 2GB DDR3 - Micron MT41J128M
# final DDR setup
MXC_DCD_ITEM(73, MMDC_P0_BASE_ADDR + 0x01c, 0x04008032)
MXC_DCD_ITEM(74, MMDC_P0_BASE_ADDR + 0x01c, 0x00008033)
MXC_DCD_ITEM(75, MMDC_P0_BASE_ADDR + 0x01c, 0x00048031)
MXC_DCD_ITEM(76, MMDC_P0_BASE_ADDR + 0x01c, 0x05208030)
MXC_DCD_ITEM(77, MMDC_P0_BASE_ADDR + 0x01c, 0x04008040)
MXC_DCD_ITEM(78, MMDC_P0_BASE_ADDR + 0x020, 0x00005800)
MXC_DCD_ITEM(79, MMDC_P0_BASE_ADDR + 0x818, 0x00011117)
MXC_DCD_ITEM(80, MMDC_P1_BASE_ADDR + 0x818, 0x00011117)
MXC_DCD_ITEM(81, MMDC_P0_BASE_ADDR + 0x004, 0x00025565)
MXC_DCD_ITEM(82, MMDC_P1_BASE_ADDR + 0x404, 0x00011006)
MXC_DCD_ITEM(83, MMDC_P0_BASE_ADDR + 0x01c, 0x00000000)
#else
dcd_hdr: .word 0x40A002D2 /* Tag=0xD2, Len=83*8 + 4 + 4, Ver=0x40 */
write_dcd_cmd: .word 0x049C02CC /* Tag=0xCC, Len=83*8 + 4, Param=0x04 */
/* DCD */
/* DDR3 initialization based on the MX6Q Auto Reference Design (ARD) */
/* DDR IO TYPE: */
MXC_DCD_ITEM(1, IOMUXC_BASE_ADDR + 0x798, 0x000C0000)
MXC_DCD_ITEM(2, IOMUXC_BASE_ADDR + 0x758, 0x00000000)
/* CLOCK: */
MXC_DCD_ITEM(3, IOMUXC_BASE_ADDR + 0x588, 0x00000030)
MXC_DCD_ITEM(4, IOMUXC_BASE_ADDR + 0x594, 0x00000030)
/* ADDRESS: */
MXC_DCD_ITEM(5, IOMUXC_BASE_ADDR + 0x56c, 0x00000030)
MXC_DCD_ITEM(6, IOMUXC_BASE_ADDR + 0x578, 0x00000030)
MXC_DCD_ITEM(7, IOMUXC_BASE_ADDR + 0x74c, 0x00000030)
/* CONTROL: */
MXC_DCD_ITEM(8, IOMUXC_BASE_ADDR + 0x57c, 0x00000030)
MXC_DCD_ITEM(9, IOMUXC_BASE_ADDR + 0x58c, 0x00000000)
/* configured using Group Control Register: IOMUXC_SW_PAD_CTL_GRP_CTLDS */
MXC_DCD_ITEM(10, IOMUXC_BASE_ADDR + 0x59c, 0x00000030)
MXC_DCD_ITEM(11, IOMUXC_BASE_ADDR + 0x5a0, 0x00000030)
MXC_DCD_ITEM(12, IOMUXC_BASE_ADDR + 0x78c, 0x00000030)
/* DATA STROBE: */
MXC_DCD_ITEM(13, IOMUXC_BASE_ADDR + 0x750, 0x00020000)
MXC_DCD_ITEM(14, IOMUXC_BASE_ADDR + 0x5a8, 0x00000028)
MXC_DCD_ITEM(15, IOMUXC_BASE_ADDR + 0x5b0, 0x00000028)
MXC_DCD_ITEM(16, IOMUXC_BASE_ADDR + 0x524, 0x00000028)
MXC_DCD_ITEM(17, IOMUXC_BASE_ADDR + 0x51c, 0x00000028)
MXC_DCD_ITEM(18, IOMUXC_BASE_ADDR + 0x518, 0x00000028)
MXC_DCD_ITEM(19, IOMUXC_BASE_ADDR + 0x50c, 0x00000028)
MXC_DCD_ITEM(20, IOMUXC_BASE_ADDR + 0x5b8, 0x00000028)
MXC_DCD_ITEM(21, IOMUXC_BASE_ADDR + 0x5c0, 0x00000028)
/* DATA: */
MXC_DCD_ITEM(22, IOMUXC_BASE_ADDR + 0x774, 0x00020000)
MXC_DCD_ITEM(23, IOMUXC_BASE_ADDR + 0x784, 0x00000028)
MXC_DCD_ITEM(24, IOMUXC_BASE_ADDR + 0x788, 0x00000028)
MXC_DCD_ITEM(25, IOMUXC_BASE_ADDR + 0x794, 0x00000028)
MXC_DCD_ITEM(26, IOMUXC_BASE_ADDR + 0x79c, 0x00000028)
MXC_DCD_ITEM(27, IOMUXC_BASE_ADDR + 0x7a0, 0x00000028)
MXC_DCD_ITEM(28, IOMUXC_BASE_ADDR + 0x7a4, 0x00000028)
MXC_DCD_ITEM(29, IOMUXC_BASE_ADDR + 0x7a8, 0x00000028)
MXC_DCD_ITEM(30, IOMUXC_BASE_ADDR + 0x748, 0x00000028)
MXC_DCD_ITEM(31, IOMUXC_BASE_ADDR + 0x5ac, 0x00000028)
MXC_DCD_ITEM(32, IOMUXC_BASE_ADDR + 0x5b4, 0x00000028)
MXC_DCD_ITEM(33, IOMUXC_BASE_ADDR + 0x528, 0x00000028)
MXC_DCD_ITEM(34, IOMUXC_BASE_ADDR + 0x520, 0x00000028)
MXC_DCD_ITEM(35, IOMUXC_BASE_ADDR + 0x514, 0x00000028)
MXC_DCD_ITEM(36, IOMUXC_BASE_ADDR + 0x510, 0x00000028)
MXC_DCD_ITEM(37, IOMUXC_BASE_ADDR + 0x5bc, 0x00000028)
MXC_DCD_ITEM(38, IOMUXC_BASE_ADDR + 0x5c4, 0x00000028)
MXC_DCD_ITEM(39, MMDC_P0_BASE_ADDR + 0x800, 0xA1390003)
MXC_DCD_ITEM(40, MMDC_P0_BASE_ADDR + 0x80c, 0x001F001F)
MXC_DCD_ITEM(41, MMDC_P0_BASE_ADDR + 0x810, 0x001F001F)
MXC_DCD_ITEM(42, MMDC_P1_BASE_ADDR + 0x80c, 0x001F001F)
MXC_DCD_ITEM(43, MMDC_P1_BASE_ADDR + 0x810, 0x001F001F)
/* Read DQS Gating calibration */
MXC_DCD_ITEM(44, MMDC_P0_BASE_ADDR + 0x83c, 0x4302030B)
MXC_DCD_ITEM(45, MMDC_P0_BASE_ADDR + 0x840, 0x0275026A)
MXC_DCD_ITEM(46, MMDC_P1_BASE_ADDR + 0x83c, 0x4302031A)
MXC_DCD_ITEM(47, MMDC_P1_BASE_ADDR + 0x840, 0x027B0249)
/* Read calibration */
MXC_DCD_ITEM(48, MMDC_P0_BASE_ADDR + 0x848, 0x3F343534)
MXC_DCD_ITEM(49, MMDC_P1_BASE_ADDR + 0x848, 0x3A373345)
/* Write calibration */
MXC_DCD_ITEM(50, MMDC_P0_BASE_ADDR + 0x850, 0x31424732)
MXC_DCD_ITEM(51, MMDC_P1_BASE_ADDR + 0x850, 0x48334736)
/* read data bit delay: (3 is the reccommended default value, although out of reset value is 0): */
MXC_DCD_ITEM(52, MMDC_P0_BASE_ADDR + 0x81c, 0x33333333)
MXC_DCD_ITEM(53, MMDC_P0_BASE_ADDR + 0x820, 0x33333333)
MXC_DCD_ITEM(54, MMDC_P0_BASE_ADDR + 0x824, 0x33333333)
MXC_DCD_ITEM(55, MMDC_P0_BASE_ADDR + 0x828, 0x33333333)
MXC_DCD_ITEM(56, MMDC_P1_BASE_ADDR + 0x81c, 0x33333333)
MXC_DCD_ITEM(57, MMDC_P1_BASE_ADDR + 0x820, 0x33333333)
MXC_DCD_ITEM(58, MMDC_P1_BASE_ADDR + 0x824, 0x33333333)
MXC_DCD_ITEM(59, MMDC_P1_BASE_ADDR + 0x828, 0x33333333)
/* Complete calibration by forced measurement: */
MXC_DCD_ITEM(60, MMDC_P0_BASE_ADDR + 0x8b8, 0x00000800)
MXC_DCD_ITEM(61, MMDC_P1_BASE_ADDR + 0x8b8, 0x00000800)
/* MMDC init: */
MXC_DCD_ITEM(62, MMDC_P0_BASE_ADDR + 0x004, 0x00020036)
MXC_DCD_ITEM(63, MMDC_P0_BASE_ADDR + 0x008, 0x09444040)
MXC_DCD_ITEM(64, MMDC_P0_BASE_ADDR + 0x00c, 0x8A8F7955)
MXC_DCD_ITEM(65, MMDC_P0_BASE_ADDR + 0x010, 0xFF328F64)
MXC_DCD_ITEM(66, MMDC_P0_BASE_ADDR + 0x014, 0x01FF00DB)
MXC_DCD_ITEM(67, MMDC_P0_BASE_ADDR + 0x018, 0x00001740)
MXC_DCD_ITEM(68, MMDC_P0_BASE_ADDR + 0x01c, 0x00008000)
/* t during MMDC set up */
MXC_DCD_ITEM(69, MMDC_P0_BASE_ADDR + 0x02c, 0x000026D2)
/* t values */
MXC_DCD_ITEM(70, MMDC_P0_BASE_ADDR + 0x030, 0x008F1023)
MXC_DCD_ITEM(71, MMDC_P0_BASE_ADDR + 0x040, 0x00000047)
MXC_DCD_ITEM(72, MMDC_P0_BASE_ADDR + 0x000, 0x841A0000)
/* Mode register writes */
MXC_DCD_ITEM(73, MMDC_P0_BASE_ADDR + 0x01c, 0x04088032)
MXC_DCD_ITEM(74, MMDC_P0_BASE_ADDR + 0x01c, 0x00008033)
MXC_DCD_ITEM(75, MMDC_P0_BASE_ADDR + 0x01c, 0x00048031)
MXC_DCD_ITEM(76, MMDC_P0_BASE_ADDR + 0x01c, 0x09408030)
MXC_DCD_ITEM(77, MMDC_P0_BASE_ADDR + 0x01c, 0x04008040)
MXC_DCD_ITEM(78, MMDC_P0_BASE_ADDR + 0x020, 0x00005800)
MXC_DCD_ITEM(79, MMDC_P0_BASE_ADDR + 0x818, 0x00011117)
MXC_DCD_ITEM(80, MMDC_P1_BASE_ADDR + 0x818, 0x00011117)
MXC_DCD_ITEM(81, MMDC_P0_BASE_ADDR + 0x004, 0x00025576)
MXC_DCD_ITEM(82, MMDC_P0_BASE_ADDR + 0x404, 0x00011006)
MXC_DCD_ITEM(83, MMDC_P0_BASE_ADDR + 0x01c, 0x00000000)
#endif
#endif

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