mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-03-20 22:21:41 +00:00
Merge branch 'u-boot-imx/master' into 'u-boot-arm/master'
This commit is contained in:
commit
e6c7f86f03
22 changed files with 1776 additions and 106 deletions
|
@ -665,9 +665,9 @@ Fabio Estevam <fabio.estevam@freescale.com>
|
||||||
mx31pdk i.MX31
|
mx31pdk i.MX31
|
||||||
mx53ard i.MX53
|
mx53ard i.MX53
|
||||||
mx53smd i.MX53
|
mx53smd i.MX53
|
||||||
mx6qsabresd i.MX6Q
|
mx6sabresd i.MX6Q/DL
|
||||||
mx6qsabreauto i.MX6Q
|
mx6qsabreauto i.MX6Q
|
||||||
wandboard i.MX6DL/S
|
wandboard i.MX6DL/S/Q
|
||||||
mx6slevk i.MX6SL
|
mx6slevk i.MX6SL
|
||||||
|
|
||||||
Daniel Gorsulowski <daniel.gorsulowski@esd.eu>
|
Daniel Gorsulowski <daniel.gorsulowski@esd.eu>
|
||||||
|
|
|
@ -159,6 +159,8 @@ unsigned int mxc_get_clock(enum mxc_clock clk)
|
||||||
switch (clk) {
|
switch (clk) {
|
||||||
case MXC_ARM_CLK:
|
case MXC_ARM_CLK:
|
||||||
return imx_get_armclk();
|
return imx_get_armclk();
|
||||||
|
case MXC_I2C_CLK:
|
||||||
|
return imx_get_ahbclk()/2;
|
||||||
case MXC_UART_CLK:
|
case MXC_UART_CLK:
|
||||||
return imx_get_perclk1();
|
return imx_get_perclk1();
|
||||||
case MXC_FEC_CLK:
|
case MXC_FEC_CLK:
|
||||||
|
@ -380,3 +382,11 @@ void mx27_sd2_init_pins(void)
|
||||||
|
|
||||||
}
|
}
|
||||||
#endif /* CONFIG_MXC_MMC */
|
#endif /* CONFIG_MXC_MMC */
|
||||||
|
|
||||||
|
#ifndef CONFIG_SYS_DCACHE_OFF
|
||||||
|
void enable_caches(void)
|
||||||
|
{
|
||||||
|
/* Enable D-cache. I-cache is already enabled in start.S */
|
||||||
|
dcache_enable();
|
||||||
|
}
|
||||||
|
#endif /* CONFIG_SYS_DCACHE_OFF */
|
||||||
|
|
|
@ -26,6 +26,7 @@
|
||||||
|
|
||||||
enum mxc_clock {
|
enum mxc_clock {
|
||||||
MXC_ARM_CLK,
|
MXC_ARM_CLK,
|
||||||
|
MXC_I2C_CLK,
|
||||||
MXC_UART_CLK,
|
MXC_UART_CLK,
|
||||||
MXC_ESDHC_CLK,
|
MXC_ESDHC_CLK,
|
||||||
MXC_FEC_CLK,
|
MXC_FEC_CLK,
|
||||||
|
|
|
@ -364,7 +364,7 @@ struct iomuxc {
|
||||||
|
|
||||||
#define IOMUXC_GPR2_MODE_DISABLED 0
|
#define IOMUXC_GPR2_MODE_DISABLED 0
|
||||||
#define IOMUXC_GPR2_MODE_ENABLED_DI0 1
|
#define IOMUXC_GPR2_MODE_ENABLED_DI0 1
|
||||||
#define IOMUXC_GPR2_MODE_ENABLED_DI1 2
|
#define IOMUXC_GPR2_MODE_ENABLED_DI1 3
|
||||||
|
|
||||||
#define IOMUXC_GPR2_LVDS_CH1_MODE_OFFSET 2
|
#define IOMUXC_GPR2_LVDS_CH1_MODE_OFFSET 2
|
||||||
#define IOMUXC_GPR2_LVDS_CH1_MODE_MASK (3<<IOMUXC_GPR2_LVDS_CH1_MODE_OFFSET)
|
#define IOMUXC_GPR2_LVDS_CH1_MODE_MASK (3<<IOMUXC_GPR2_LVDS_CH1_MODE_OFFSET)
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -9,5 +9,5 @@ arch/arm/include/asm/arch-mxs/ - Header files for the Freescale i.MX28
|
||||||
board/denx/m28evk/ - M28EVK board specific files
|
board/denx/m28evk/ - M28EVK board specific files
|
||||||
include/configs/m28evk.h - M28EVK configuration file
|
include/configs/m28evk.h - M28EVK configuration file
|
||||||
|
|
||||||
Follow the instructions from doc/README.mx28_common to generate a bootable SD
|
Follow the instructions from doc/README.mxs to generate a bootable SD card or to
|
||||||
card or to boot from NAND flash.
|
boot from NAND flash.
|
|
@ -41,7 +41,6 @@ Note: The mx28evk board does not come with a NAND flash populated from the
|
||||||
factory. It comes with an empty slot (U23), which allows the insertion of a
|
factory. It comes with an empty slot (U23), which allows the insertion of a
|
||||||
48-pin TSOP flash device.
|
48-pin TSOP flash device.
|
||||||
|
|
||||||
Follow the instructions from doc/README.mx28_common to generate a bootable SD
|
Follow the instructions from doc/README.mxs to generate a bootable SD card.
|
||||||
card.
|
|
||||||
|
|
||||||
Insert the SD card in slot 0, power up the board and U-boot will boot.
|
Insert the SD card in slot 0, power up the board and U-boot will boot.
|
|
@ -23,7 +23,7 @@ include $(TOPDIR)/config.mk
|
||||||
|
|
||||||
LIB = $(obj)lib$(BOARD).o
|
LIB = $(obj)lib$(BOARD).o
|
||||||
|
|
||||||
COBJS := mx6qsabresd.o
|
COBJS := mx6sabresd.o
|
||||||
|
|
||||||
SRCS := $(COBJS:.o=.c)
|
SRCS := $(COBJS:.o=.c)
|
||||||
OBJS := $(addprefix $(obj),$(COBJS))
|
OBJS := $(addprefix $(obj),$(COBJS))
|
|
@ -17,12 +17,10 @@
|
||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <common.h>
|
|
||||||
#include <asm/io.h>
|
|
||||||
#include <asm/arch/clock.h>
|
#include <asm/arch/clock.h>
|
||||||
#include <asm/arch/imx-regs.h>
|
#include <asm/arch/imx-regs.h>
|
||||||
#include <asm/arch/iomux.h>
|
#include <asm/arch/iomux.h>
|
||||||
#include <asm/arch/mx6q_pins.h>
|
#include <asm/arch/mx6-pins.h>
|
||||||
#include <asm/errno.h>
|
#include <asm/errno.h>
|
||||||
#include <asm/gpio.h>
|
#include <asm/gpio.h>
|
||||||
#include <asm/imx-common/iomux-v3.h>
|
#include <asm/imx-common/iomux-v3.h>
|
||||||
|
@ -291,7 +289,6 @@ int board_late_init(void)
|
||||||
|
|
||||||
int checkboard(void)
|
int checkboard(void)
|
||||||
{
|
{
|
||||||
puts("Board: MX6Q-SabreSD\n");
|
puts("Board: MX6-SabreSD\n");
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
|
@ -22,6 +22,11 @@ To build U-Boot for the Wandboard Solo version:
|
||||||
$ make wandboard_solo_config
|
$ make wandboard_solo_config
|
||||||
$ make
|
$ make
|
||||||
|
|
||||||
|
To build U-Boot for the Wandboard Quad version:
|
||||||
|
|
||||||
|
$ make wandboard_quad_config
|
||||||
|
$ make
|
||||||
|
|
||||||
Flashing U-boot into the SD card
|
Flashing U-boot into the SD card
|
||||||
--------------------------------
|
--------------------------------
|
||||||
|
|
||||||
|
|
|
@ -48,7 +48,7 @@ DECLARE_GLOBAL_DATA_PTR;
|
||||||
|
|
||||||
int dram_init(void)
|
int dram_init(void)
|
||||||
{
|
{
|
||||||
gd->ram_size = CONFIG_DDR_MB * SZ_1M;
|
gd->ram_size = (phys_size_t)CONFIG_DDR_MB * 1024 * 1024;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -267,9 +267,10 @@ ima3-mx53 arm armv7 ima3-mx53 esg
|
||||||
vision2 arm armv7 vision2 ttcontrol mx5 vision2:IMX_CONFIG=board/ttcontrol/vision2/imximage_hynix.cfg
|
vision2 arm armv7 vision2 ttcontrol mx5 vision2:IMX_CONFIG=board/ttcontrol/vision2/imximage_hynix.cfg
|
||||||
cgtqmx6qeval arm armv7 cgtqmx6eval congatec mx6 cgtqmx6eval:IMX_CONFIG=board/freescale/imx/ddr/mx6q_4x_mt41j128.cfg,MX6Q
|
cgtqmx6qeval arm armv7 cgtqmx6eval congatec mx6 cgtqmx6eval:IMX_CONFIG=board/freescale/imx/ddr/mx6q_4x_mt41j128.cfg,MX6Q
|
||||||
mx6qarm2 arm armv7 mx6qarm2 freescale mx6 mx6qarm2:IMX_CONFIG=board/freescale/mx6qarm2/imximage.cfg
|
mx6qarm2 arm armv7 mx6qarm2 freescale mx6 mx6qarm2:IMX_CONFIG=board/freescale/mx6qarm2/imximage.cfg
|
||||||
mx6qsabreauto arm armv7 mx6qsabreauto freescale mx6 mx6qsabreauto:IMX_CONFIG=board/freescale/mx6qsabreauto/imximage.cfg
|
mx6qsabreauto arm armv7 mx6qsabreauto freescale mx6 mx6qsabreauto:IMX_CONFIG=board/freescale/mx6qsabreauto/imximage.cfg,MX6Q
|
||||||
mx6qsabrelite arm armv7 mx6qsabrelite freescale mx6 mx6qsabrelite:IMX_CONFIG=board/freescale/imx/ddr/mx6q_4x_mt41j128.cfg
|
mx6qsabrelite arm armv7 mx6qsabrelite freescale mx6 mx6qsabrelite:IMX_CONFIG=board/freescale/imx/ddr/mx6q_4x_mt41j128.cfg
|
||||||
mx6qsabresd arm armv7 mx6qsabresd freescale mx6 mx6qsabresd:IMX_CONFIG=board/freescale/imx/ddr/mx6q_4x_mt41j128.cfg
|
mx6dlsabresd arm armv7 mx6sabresd freescale mx6 mx6sabresd:IMX_CONFIG=board/boundary/nitrogen6x/nitrogen6dl.cfg,MX6DL
|
||||||
|
mx6qsabresd arm armv7 mx6sabresd freescale mx6 mx6sabresd:IMX_CONFIG=board/freescale/imx/ddr/mx6q_4x_mt41j128.cfg,MX6Q
|
||||||
mx6slevk arm armv7 mx6slevk freescale mx6 mx6slevk:IMX_CONFIG=board/freescale/mx6slevk/imximage.cfg,MX6SL
|
mx6slevk arm armv7 mx6slevk freescale mx6 mx6slevk:IMX_CONFIG=board/freescale/mx6slevk/imximage.cfg,MX6SL
|
||||||
titanium arm armv7 titanium freescale mx6 titanium:IMX_CONFIG=board/freescale/titanium/imximage.cfg
|
titanium arm armv7 titanium freescale mx6 titanium:IMX_CONFIG=board/freescale/titanium/imximage.cfg
|
||||||
vf610twr arm armv7 vf610twr freescale vf610 vf610twr:IMX_CONFIG=board/freescale/vf610twr/imximage.cfg
|
vf610twr arm armv7 vf610twr freescale vf610 vf610twr:IMX_CONFIG=board/freescale/vf610twr/imximage.cfg
|
||||||
|
@ -281,6 +282,7 @@ nitrogen6q2g arm armv7 nitrogen6x boundar
|
||||||
nitrogen6s arm armv7 nitrogen6x boundary mx6 nitrogen6x:IMX_CONFIG=board/boundary/nitrogen6x/nitrogen6s.cfg,MX6S,DDR_MB=512
|
nitrogen6s arm armv7 nitrogen6x boundary mx6 nitrogen6x:IMX_CONFIG=board/boundary/nitrogen6x/nitrogen6s.cfg,MX6S,DDR_MB=512
|
||||||
nitrogen6s1g arm armv7 nitrogen6x boundary mx6 nitrogen6x:IMX_CONFIG=board/boundary/nitrogen6x/nitrogen6s1g.cfg,MX6S,DDR_MB=1024
|
nitrogen6s1g arm armv7 nitrogen6x boundary mx6 nitrogen6x:IMX_CONFIG=board/boundary/nitrogen6x/nitrogen6s1g.cfg,MX6S,DDR_MB=1024
|
||||||
wandboard_dl arm armv7 wandboard - mx6 wandboard:IMX_CONFIG=board/boundary/nitrogen6x/nitrogen6dl.cfg,MX6DL,DDR_MB=1024
|
wandboard_dl arm armv7 wandboard - mx6 wandboard:IMX_CONFIG=board/boundary/nitrogen6x/nitrogen6dl.cfg,MX6DL,DDR_MB=1024
|
||||||
|
wandboard_quad arm armv7 wandboard - mx6 wandboard:IMX_CONFIG=board/boundary/nitrogen6x/nitrogen6q2g.cfg,MX6Q,DDR_MB=2048
|
||||||
wandboard_solo arm armv7 wandboard - mx6 wandboard:IMX_CONFIG=board/boundary/nitrogen6x/nitrogen6s.cfg,MX6S,DDR_MB=512
|
wandboard_solo arm armv7 wandboard - mx6 wandboard:IMX_CONFIG=board/boundary/nitrogen6x/nitrogen6s.cfg,MX6S,DDR_MB=512
|
||||||
omap3_overo arm armv7 overo - omap3
|
omap3_overo arm armv7 overo - omap3
|
||||||
omap3_pandora arm armv7 pandora - omap3
|
omap3_pandora arm armv7 pandora - omap3
|
||||||
|
|
|
@ -1,12 +1,15 @@
|
||||||
Booting U-boot on a MX28 processor
|
Booting U-boot on a MXS processor
|
||||||
==================================
|
=================================
|
||||||
|
|
||||||
This document describes the MX28 U-Boot port. This document mostly
|
This document describes the MXS U-Boot port. This document mostly covers topics
|
||||||
covers topics related to making the module/board bootable.
|
related to making the module/board bootable.
|
||||||
|
|
||||||
Terminology
|
Terminology
|
||||||
-----------
|
-----------
|
||||||
|
|
||||||
|
The term "MXS" refers to a family of Freescale SoCs that is composed by MX23
|
||||||
|
and MX28.
|
||||||
|
|
||||||
The dollar symbol ($) introduces a snipped of shell code. This shall be typed
|
The dollar symbol ($) introduces a snipped of shell code. This shall be typed
|
||||||
into the unix command prompt in U-Boot source code root directory.
|
into the unix command prompt in U-Boot source code root directory.
|
||||||
|
|
||||||
|
@ -17,16 +20,16 @@ Contents
|
||||||
--------
|
--------
|
||||||
|
|
||||||
1) Prerequisites
|
1) Prerequisites
|
||||||
2) Compiling U-Boot for a MX28 based board
|
2) Compiling U-Boot for a MXS based board
|
||||||
3) Installation of U-Boot for a MX28 based board to SD card
|
3) Installation of U-Boot for a MXS based board to SD card
|
||||||
4) Installation of U-Boot into NAND flash
|
4) Installation of U-Boot into NAND flash on a MX28 based board
|
||||||
|
|
||||||
1) Prerequisites
|
1) Prerequisites
|
||||||
----------------
|
----------------
|
||||||
|
|
||||||
To make a MX28 based board bootable, some tools are necessary. The first one
|
To make a MXS based board bootable, some tools are necessary. The first one is
|
||||||
is the "elftosb" tool distributed by Freescale Semiconductor. The other one
|
the "elftosb" tool distributed by Freescale Semiconductor. The other one is the
|
||||||
is the "mxsboot" tool found in U-Boot source tree.
|
"mxsboot" tool found in U-Boot source tree.
|
||||||
|
|
||||||
Firstly, obtain the elftosb archive from the following location:
|
Firstly, obtain the elftosb archive from the following location:
|
||||||
|
|
||||||
|
@ -60,18 +63,18 @@ copy the binary by hand:
|
||||||
Make sure the "elftosb" binary can be found in your $PATH, in this case this
|
Make sure the "elftosb" binary can be found in your $PATH, in this case this
|
||||||
means "/usr/local/bin/" has to be in your $PATH.
|
means "/usr/local/bin/" has to be in your $PATH.
|
||||||
|
|
||||||
2) Compiling U-Boot for a MX28 based board
|
2) Compiling U-Boot for a MXS based board
|
||||||
-------------------------------------------
|
-------------------------------------------
|
||||||
|
|
||||||
Compiling the U-Boot for a MX28 board is straightforward and done as compiling U-Boot
|
Compiling the U-Boot for a MXS board is straightforward and done as compiling
|
||||||
for any other ARM device. For cross-compiler setup, please refer to ELDK5.0
|
U-Boot for any other ARM device. For cross-compiler setup, please refer to
|
||||||
documentation. First, clean up the source code:
|
ELDK5.0 documentation. First, clean up the source code:
|
||||||
|
|
||||||
$ make mrproper
|
$ make mrproper
|
||||||
|
|
||||||
Next, configure U-Boot for a MX28 based board
|
Next, configure U-Boot for a MXS based board
|
||||||
|
|
||||||
$ make <mx28_based_board_name>_config
|
$ make <mxs_based_board_name>_config
|
||||||
|
|
||||||
Examples:
|
Examples:
|
||||||
|
|
||||||
|
@ -83,8 +86,16 @@ Examples:
|
||||||
|
|
||||||
$ make mx28evk_config
|
$ make mx28evk_config
|
||||||
|
|
||||||
|
3. For building U-boot for Freescale MX23EVK board:
|
||||||
|
|
||||||
|
$ make mx23evk_config
|
||||||
|
|
||||||
|
4. For building U-boot for Olimex MX23 Olinuxino board:
|
||||||
|
|
||||||
|
$ make mx23_olinuxino_config
|
||||||
|
|
||||||
Lastly, compile U-Boot and prepare a "BootStream". The "BootStream" is a special
|
Lastly, compile U-Boot and prepare a "BootStream". The "BootStream" is a special
|
||||||
type of file, which the i.MX28 CPU can boot. This is handled by the following
|
type of file, which MXS CPUs can boot. This is handled by the following
|
||||||
command:
|
command:
|
||||||
|
|
||||||
$ make u-boot.sb
|
$ make u-boot.sb
|
||||||
|
@ -96,18 +107,16 @@ The code produces "u-boot.sb" file. This file needs to be augmented with a
|
||||||
proper header to allow successful boot from SD or NAND. Adding the header is
|
proper header to allow successful boot from SD or NAND. Adding the header is
|
||||||
discussed in the following chapters.
|
discussed in the following chapters.
|
||||||
|
|
||||||
3) Installation of U-Boot for a MX28 based board to SD card
|
3) Installation of U-Boot for a MXS based board to SD card
|
||||||
-----------------------------------------------------------
|
----------------------------------------------------------
|
||||||
|
|
||||||
To boot a MX28 based board from SD, set the boot mode DIP switches according
|
To boot a MXS based board from SD, set the boot mode DIP switches according to
|
||||||
to i.MX28 manual chapter 12.2.1 (Table 12-2), PORT=SSP0, SD/MMC master on
|
to MX28 manual, section 12.2.1 (Table 12-2) or MX23 manual, section 35.1.2
|
||||||
SSP0, 3.3V.
|
(Table 35-3).
|
||||||
|
|
||||||
|
The SD card used to boot U-Boot must contain a DOS partition table, which in
|
||||||
An SD card the i.MX28 CPU can use to boot U-Boot must contain a DOS partition
|
turn carries a partition of special type and which contains a special header.
|
||||||
table, which in turn carries a partition of special type and which contains a
|
The rest of partitions in the DOS partition table can be used by the user.
|
||||||
special header. The rest of partitions in the DOS partition table can be used
|
|
||||||
by the user.
|
|
||||||
|
|
||||||
To prepare such partition, use your favourite partitioning tool. The partition
|
To prepare such partition, use your favourite partitioning tool. The partition
|
||||||
must have the following parameters:
|
must have the following parameters:
|
||||||
|
@ -141,17 +150,17 @@ case, we assume the first partition of the SD card is /dev/mmcblk0p1:
|
||||||
|
|
||||||
$ dd if=u-boot.sd of=/dev/mmcblk0p1
|
$ dd if=u-boot.sd of=/dev/mmcblk0p1
|
||||||
|
|
||||||
Last step is to insert the card into MX28 based board and boot.
|
Last step is to insert the card into the MXS based board and boot.
|
||||||
|
|
||||||
NOTE: If the user needs to adjust the start sector, the "mxsboot" tool contains
|
NOTE: If the user needs to adjust the start sector, the "mxsboot" tool contains
|
||||||
a "-p" switch for that purpose. The "-p" switch takes the sector number as
|
a "-p" switch for that purpose. The "-p" switch takes the sector number as
|
||||||
an argument.
|
an argument.
|
||||||
|
|
||||||
4) Installation of U-Boot into NAND flash
|
4) Installation of U-Boot into NAND flash on a MX28 based board
|
||||||
-----------------------------------------
|
---------------------------------------------------------------
|
||||||
|
|
||||||
To boot a MX28 based board from NAND, set the boot mode DIP switches according to i.MX28
|
To boot a MX28 based board from NAND, set the boot mode DIP switches according
|
||||||
manual chapter 12.2.1 (Table 12-2), PORT=GPMI, NAND 1.8 V.
|
to MX28 manual section 12.2.1 (Table 12-2), PORT=GPMI, NAND 1.8 V.
|
||||||
|
|
||||||
There are two possibilities when preparing an image writable to NAND flash.
|
There are two possibilities when preparing an image writable to NAND flash.
|
||||||
|
|
||||||
|
@ -214,7 +223,7 @@ There are two possibilities when preparing an image writable to NAND flash.
|
||||||
--------------------------------------------
|
--------------------------------------------
|
||||||
There is a slight possibility of the user wanting to adjust the
|
There is a slight possibility of the user wanting to adjust the
|
||||||
STRIDE and COUNT options of the NAND boot. For description of these,
|
STRIDE and COUNT options of the NAND boot. For description of these,
|
||||||
see i.MX28 manual section 12.12.1.2 and 12.12.1.3.
|
see MX28 manual section 12.12.1.2 and 12.12.1.3.
|
||||||
|
|
||||||
The update scripts take this possibility into account. In case the
|
The update scripts take this possibility into account. In case the
|
||||||
user changes STRIDE by blowing fuses, the user also has to change
|
user changes STRIDE by blowing fuses, the user also has to change
|
||||||
|
|
|
@ -447,10 +447,13 @@ static int ahci_exec_ata_cmd(struct ahci_probe_ent *probe_ent,
|
||||||
if (buf && buf_len)
|
if (buf && buf_len)
|
||||||
sg_count = ahci_fill_sg(probe_ent, port, buf, buf_len);
|
sg_count = ahci_fill_sg(probe_ent, port, buf, buf_len);
|
||||||
opts = (sizeof(struct sata_fis_h2d) >> 2) | (sg_count << 16);
|
opts = (sizeof(struct sata_fis_h2d) >> 2) | (sg_count << 16);
|
||||||
if (is_write)
|
if (is_write) {
|
||||||
opts |= 0x40;
|
opts |= 0x40;
|
||||||
|
flush_cache((ulong)buf, buf_len);
|
||||||
|
}
|
||||||
ahci_fill_cmd_slot(pp, cmd_slot, opts);
|
ahci_fill_cmd_slot(pp, cmd_slot, opts);
|
||||||
|
|
||||||
|
flush_cache((int)(pp->cmd_slot), AHCI_PORT_PRIV_DMA_SZ);
|
||||||
writel_with_flush(1 << cmd_slot, &(port_mmio->ci));
|
writel_with_flush(1 << cmd_slot, &(port_mmio->ci));
|
||||||
|
|
||||||
if (waiting_for_cmd_completed((u8 *)&(port_mmio->ci),
|
if (waiting_for_cmd_completed((u8 *)&(port_mmio->ci),
|
||||||
|
@ -458,8 +461,12 @@ static int ahci_exec_ata_cmd(struct ahci_probe_ent *probe_ent,
|
||||||
printf("timeout exit!\n");
|
printf("timeout exit!\n");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
invalidate_dcache_range((int)(pp->cmd_slot),
|
||||||
|
(int)(pp->cmd_slot)+AHCI_PORT_PRIV_DMA_SZ);
|
||||||
debug("ahci_exec_ata_cmd: %d byte transferred.\n",
|
debug("ahci_exec_ata_cmd: %d byte transferred.\n",
|
||||||
pp->cmd_slot->status);
|
pp->cmd_slot->status);
|
||||||
|
if (!is_write)
|
||||||
|
invalidate_dcache_range((ulong)buf, (ulong)buf+buf_len);
|
||||||
|
|
||||||
return buf_len;
|
return buf_len;
|
||||||
}
|
}
|
||||||
|
@ -468,7 +475,8 @@ static void ahci_set_feature(u8 dev, u8 port)
|
||||||
{
|
{
|
||||||
struct ahci_probe_ent *probe_ent =
|
struct ahci_probe_ent *probe_ent =
|
||||||
(struct ahci_probe_ent *)sata_dev_desc[dev].priv;
|
(struct ahci_probe_ent *)sata_dev_desc[dev].priv;
|
||||||
struct sata_fis_h2d h2d, *cfis = &h2d;
|
struct sata_fis_h2d h2d __aligned(ARCH_DMA_MINALIGN);
|
||||||
|
struct sata_fis_h2d *cfis = &h2d;
|
||||||
|
|
||||||
memset(cfis, 0, sizeof(struct sata_fis_h2d));
|
memset(cfis, 0, sizeof(struct sata_fis_h2d));
|
||||||
cfis->fis_type = SATA_FIS_TYPE_REGISTER_H2D;
|
cfis->fis_type = SATA_FIS_TYPE_REGISTER_H2D;
|
||||||
|
@ -615,7 +623,8 @@ static void dwc_ahsata_identify(int dev, u16 *id)
|
||||||
{
|
{
|
||||||
struct ahci_probe_ent *probe_ent =
|
struct ahci_probe_ent *probe_ent =
|
||||||
(struct ahci_probe_ent *)sata_dev_desc[dev].priv;
|
(struct ahci_probe_ent *)sata_dev_desc[dev].priv;
|
||||||
struct sata_fis_h2d h2d, *cfis = &h2d;
|
struct sata_fis_h2d h2d __aligned(ARCH_DMA_MINALIGN);
|
||||||
|
struct sata_fis_h2d *cfis = &h2d;
|
||||||
u8 port = probe_ent->hard_port_no;
|
u8 port = probe_ent->hard_port_no;
|
||||||
|
|
||||||
memset(cfis, 0, sizeof(struct sata_fis_h2d));
|
memset(cfis, 0, sizeof(struct sata_fis_h2d));
|
||||||
|
@ -645,7 +654,8 @@ static u32 dwc_ahsata_rw_cmd(int dev, u32 start, u32 blkcnt,
|
||||||
{
|
{
|
||||||
struct ahci_probe_ent *probe_ent =
|
struct ahci_probe_ent *probe_ent =
|
||||||
(struct ahci_probe_ent *)sata_dev_desc[dev].priv;
|
(struct ahci_probe_ent *)sata_dev_desc[dev].priv;
|
||||||
struct sata_fis_h2d h2d, *cfis = &h2d;
|
struct sata_fis_h2d h2d __aligned(ARCH_DMA_MINALIGN);
|
||||||
|
struct sata_fis_h2d *cfis = &h2d;
|
||||||
u8 port = probe_ent->hard_port_no;
|
u8 port = probe_ent->hard_port_no;
|
||||||
u32 block;
|
u32 block;
|
||||||
|
|
||||||
|
@ -675,7 +685,8 @@ void dwc_ahsata_flush_cache(int dev)
|
||||||
{
|
{
|
||||||
struct ahci_probe_ent *probe_ent =
|
struct ahci_probe_ent *probe_ent =
|
||||||
(struct ahci_probe_ent *)sata_dev_desc[dev].priv;
|
(struct ahci_probe_ent *)sata_dev_desc[dev].priv;
|
||||||
struct sata_fis_h2d h2d, *cfis = &h2d;
|
struct sata_fis_h2d h2d __aligned(ARCH_DMA_MINALIGN);
|
||||||
|
struct sata_fis_h2d *cfis = &h2d;
|
||||||
u8 port = probe_ent->hard_port_no;
|
u8 port = probe_ent->hard_port_no;
|
||||||
|
|
||||||
memset(cfis, 0, sizeof(struct sata_fis_h2d));
|
memset(cfis, 0, sizeof(struct sata_fis_h2d));
|
||||||
|
@ -692,7 +703,8 @@ static u32 dwc_ahsata_rw_cmd_ext(int dev, u32 start, lbaint_t blkcnt,
|
||||||
{
|
{
|
||||||
struct ahci_probe_ent *probe_ent =
|
struct ahci_probe_ent *probe_ent =
|
||||||
(struct ahci_probe_ent *)sata_dev_desc[dev].priv;
|
(struct ahci_probe_ent *)sata_dev_desc[dev].priv;
|
||||||
struct sata_fis_h2d h2d, *cfis = &h2d;
|
struct sata_fis_h2d h2d __aligned(ARCH_DMA_MINALIGN);
|
||||||
|
struct sata_fis_h2d *cfis = &h2d;
|
||||||
u8 port = probe_ent->hard_port_no;
|
u8 port = probe_ent->hard_port_no;
|
||||||
u64 block;
|
u64 block;
|
||||||
|
|
||||||
|
@ -728,7 +740,8 @@ u32 dwc_ahsata_rw_ncq_cmd(int dev, u32 start, lbaint_t blkcnt,
|
||||||
{
|
{
|
||||||
struct ahci_probe_ent *probe_ent =
|
struct ahci_probe_ent *probe_ent =
|
||||||
(struct ahci_probe_ent *)sata_dev_desc[dev].priv;
|
(struct ahci_probe_ent *)sata_dev_desc[dev].priv;
|
||||||
struct sata_fis_h2d h2d, *cfis = &h2d;
|
struct sata_fis_h2d h2d __aligned(ARCH_DMA_MINALIGN);
|
||||||
|
struct sata_fis_h2d *cfis = &h2d;
|
||||||
u8 port = probe_ent->hard_port_no;
|
u8 port = probe_ent->hard_port_no;
|
||||||
u64 block;
|
u64 block;
|
||||||
|
|
||||||
|
@ -769,7 +782,8 @@ void dwc_ahsata_flush_cache_ext(int dev)
|
||||||
{
|
{
|
||||||
struct ahci_probe_ent *probe_ent =
|
struct ahci_probe_ent *probe_ent =
|
||||||
(struct ahci_probe_ent *)sata_dev_desc[dev].priv;
|
(struct ahci_probe_ent *)sata_dev_desc[dev].priv;
|
||||||
struct sata_fis_h2d h2d, *cfis = &h2d;
|
struct sata_fis_h2d h2d __aligned(ARCH_DMA_MINALIGN);
|
||||||
|
struct sata_fis_h2d *cfis = &h2d;
|
||||||
u8 port = probe_ent->hard_port_no;
|
u8 port = probe_ent->hard_port_no;
|
||||||
|
|
||||||
memset(cfis, 0, sizeof(struct sata_fis_h2d));
|
memset(cfis, 0, sizeof(struct sata_fis_h2d));
|
||||||
|
@ -912,7 +926,9 @@ int scan_sata(int dev)
|
||||||
u8 port = probe_ent->hard_port_no;
|
u8 port = probe_ent->hard_port_no;
|
||||||
block_dev_desc_t *pdev = &(sata_dev_desc[dev]);
|
block_dev_desc_t *pdev = &(sata_dev_desc[dev]);
|
||||||
|
|
||||||
id = (u16 *)malloc(ATA_ID_WORDS * 2);
|
id = (u16 *)memalign(ARCH_DMA_MINALIGN,
|
||||||
|
roundup(ARCH_DMA_MINALIGN,
|
||||||
|
(ATA_ID_WORDS * 2)));
|
||||||
if (!id) {
|
if (!id) {
|
||||||
printf("id malloc failed\n\r");
|
printf("id malloc failed\n\r");
|
||||||
return -1;
|
return -1;
|
||||||
|
|
|
@ -128,8 +128,8 @@ static s32 spi_cfg_mxc(struct mxc_spi_slave *mxcs, unsigned int cs,
|
||||||
unsigned int max_hz, unsigned int mode)
|
unsigned int max_hz, unsigned int mode)
|
||||||
{
|
{
|
||||||
u32 clk_src = mxc_get_clock(MXC_CSPI_CLK);
|
u32 clk_src = mxc_get_clock(MXC_CSPI_CLK);
|
||||||
s32 pre_div = 0, post_div = 0, i, reg_ctrl, reg_config;
|
s32 reg_ctrl, reg_config;
|
||||||
u32 ss_pol = 0, sclkpol = 0, sclkpha = 0;
|
u32 ss_pol = 0, sclkpol = 0, sclkpha = 0, pre_div = 0, post_div = 0;
|
||||||
struct cspi_regs *regs = (struct cspi_regs *)mxcs->base;
|
struct cspi_regs *regs = (struct cspi_regs *)mxcs->base;
|
||||||
|
|
||||||
if (max_hz == 0) {
|
if (max_hz == 0) {
|
||||||
|
@ -147,26 +147,20 @@ static s32 spi_cfg_mxc(struct mxc_spi_slave *mxcs, unsigned int cs,
|
||||||
reg_ctrl |= MXC_CSPICTRL_EN;
|
reg_ctrl |= MXC_CSPICTRL_EN;
|
||||||
reg_write(®s->ctrl, reg_ctrl);
|
reg_write(®s->ctrl, reg_ctrl);
|
||||||
|
|
||||||
/*
|
|
||||||
* The following computation is taken directly from Freescale's code.
|
|
||||||
*/
|
|
||||||
if (clk_src > max_hz) {
|
if (clk_src > max_hz) {
|
||||||
pre_div = DIV_ROUND_UP(clk_src, max_hz);
|
pre_div = (clk_src - 1) / max_hz;
|
||||||
if (pre_div > 16) {
|
/* fls(1) = 1, fls(0x80000000) = 32, fls(16) = 5 */
|
||||||
post_div = pre_div / 16;
|
post_div = fls(pre_div);
|
||||||
pre_div = 15;
|
if (post_div > 4) {
|
||||||
}
|
post_div -= 4;
|
||||||
if (post_div != 0) {
|
if (post_div >= 16) {
|
||||||
for (i = 0; i < 16; i++) {
|
|
||||||
if ((1 << i) >= post_div)
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
if (i == 16) {
|
|
||||||
printf("Error: no divider for the freq: %d\n",
|
printf("Error: no divider for the freq: %d\n",
|
||||||
max_hz);
|
max_hz);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
post_div = i;
|
pre_div >>= post_div;
|
||||||
|
} else {
|
||||||
|
post_div = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -137,7 +137,7 @@ void *video_hw_init(void)
|
||||||
/* Suck display configuration from "videomode" variable */
|
/* Suck display configuration from "videomode" variable */
|
||||||
penv = getenv("videomode");
|
penv = getenv("videomode");
|
||||||
if (!penv) {
|
if (!penv) {
|
||||||
printf("MXSFB: 'videomode' variable not set!");
|
puts("MXSFB: 'videomode' variable not set!\n");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -30,7 +30,7 @@
|
||||||
#define CONFIG_MXC_USB_PORTSC (PORT_PTS_UTMI | PORT_PTS_PTW)
|
#define CONFIG_MXC_USB_PORTSC (PORT_PTS_UTMI | PORT_PTS_PTW)
|
||||||
#define CONFIG_MXC_USB_FLAGS 0
|
#define CONFIG_MXC_USB_FLAGS 0
|
||||||
|
|
||||||
#include "mx6qsabre_common.h"
|
#include "mx6sabre_common.h"
|
||||||
|
|
||||||
#define CONFIG_SYS_FSL_USDHC_NUM 2
|
#define CONFIG_SYS_FSL_USDHC_NUM 2
|
||||||
#if defined(CONFIG_ENV_IS_IN_MMC)
|
#if defined(CONFIG_ENV_IS_IN_MMC)
|
||||||
|
|
|
@ -18,7 +18,6 @@
|
||||||
#define __MX6QSABRE_COMMON_CONFIG_H
|
#define __MX6QSABRE_COMMON_CONFIG_H
|
||||||
|
|
||||||
#define CONFIG_MX6
|
#define CONFIG_MX6
|
||||||
#define CONFIG_MX6Q
|
|
||||||
|
|
||||||
#include "mx6_common.h"
|
#include "mx6_common.h"
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
#define CONFIG_DEFAULT_FDT_FILE "imx6q-sabresd.dtb"
|
#define CONFIG_DEFAULT_FDT_FILE "imx6q-sabresd.dtb"
|
||||||
#define PHYS_SDRAM_SIZE (1u * 1024 * 1024 * 1024)
|
#define PHYS_SDRAM_SIZE (1u * 1024 * 1024 * 1024)
|
||||||
|
|
||||||
#include "mx6qsabre_common.h"
|
#include "mx6sabre_common.h"
|
||||||
|
|
||||||
#define CONFIG_SYS_FSL_USDHC_NUM 3
|
#define CONFIG_SYS_FSL_USDHC_NUM 3
|
||||||
#if defined(CONFIG_ENV_IS_IN_MMC)
|
#if defined(CONFIG_ENV_IS_IN_MMC)
|
|
@ -276,8 +276,6 @@
|
||||||
#define CONFIG_OF_LIBFDT
|
#define CONFIG_OF_LIBFDT
|
||||||
#define CONFIG_CMD_BOOTZ
|
#define CONFIG_CMD_BOOTZ
|
||||||
|
|
||||||
#define CONFIG_SYS_DCACHE_OFF
|
|
||||||
|
|
||||||
#ifndef CONFIG_SYS_DCACHE_OFF
|
#ifndef CONFIG_SYS_DCACHE_OFF
|
||||||
#define CONFIG_CMD_CACHE
|
#define CONFIG_CMD_CACHE
|
||||||
#endif
|
#endif
|
||||||
|
@ -287,4 +285,8 @@
|
||||||
#define CONFIG_CMD_TIME
|
#define CONFIG_CMD_TIME
|
||||||
#define CONFIG_SYS_ALT_MEMTEST
|
#define CONFIG_SYS_ALT_MEMTEST
|
||||||
|
|
||||||
|
#define CONFIG_CMD_BOOTZ
|
||||||
|
#define CONFIG_SUPPORT_RAW_INITRD
|
||||||
|
#define CONFIG_CMD_FS_GENERIC
|
||||||
|
|
||||||
#endif /* __CONFIG_H */
|
#endif /* __CONFIG_H */
|
||||||
|
|
|
@ -83,13 +83,101 @@
|
||||||
|
|
||||||
#define CONFIG_BOOTDELAY 3
|
#define CONFIG_BOOTDELAY 3
|
||||||
|
|
||||||
|
#define CONFIG_LOADADDR 0x82000000
|
||||||
#define CONFIG_SYS_TEXT_BASE 0x3f008000
|
#define CONFIG_SYS_TEXT_BASE 0x3f008000
|
||||||
|
|
||||||
|
#define CONFIG_EXTRA_ENV_SETTINGS \
|
||||||
|
"script=boot.scr\0" \
|
||||||
|
"uimage=uImage\0" \
|
||||||
|
"console=ttyLP1\0" \
|
||||||
|
"fdt_high=0xffffffff\0" \
|
||||||
|
"initrd_high=0xffffffff\0" \
|
||||||
|
"fdt_file=vf610-twr.dtb\0" \
|
||||||
|
"fdt_addr=0x81000000\0" \
|
||||||
|
"boot_fdt=try\0" \
|
||||||
|
"ip_dyn=yes\0" \
|
||||||
|
"mmcdev=" __stringify(CONFIG_SYS_MMC_ENV_DEV) "\0" \
|
||||||
|
"mmcpart=1\0" \
|
||||||
|
"mmcroot=/dev/mmcblk0p2 rootwait rw\0" \
|
||||||
|
"update_sd_firmware_filename=u-boot.imx\0" \
|
||||||
|
"update_sd_firmware=" \
|
||||||
|
"if test ${ip_dyn} = yes; then " \
|
||||||
|
"setenv get_cmd dhcp; " \
|
||||||
|
"else " \
|
||||||
|
"setenv get_cmd tftp; " \
|
||||||
|
"fi; " \
|
||||||
|
"if mmc dev ${mmcdev}; then " \
|
||||||
|
"if ${get_cmd} ${update_sd_firmware_filename}; then " \
|
||||||
|
"setexpr fw_sz ${filesize} / 0x200; " \
|
||||||
|
"setexpr fw_sz ${fw_sz} + 1; " \
|
||||||
|
"mmc write ${loadaddr} 0x2 ${fw_sz}; " \
|
||||||
|
"fi; " \
|
||||||
|
"fi\0" \
|
||||||
|
"mmcargs=setenv bootargs console=${console},${baudrate} " \
|
||||||
|
"root=${mmcroot}\0" \
|
||||||
|
"loadbootscript=" \
|
||||||
|
"fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \
|
||||||
|
"bootscript=echo Running bootscript from mmc ...; " \
|
||||||
|
"source\0" \
|
||||||
|
"loaduimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${uimage}\0" \
|
||||||
|
"loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}\0" \
|
||||||
|
"mmcboot=echo Booting from mmc ...; " \
|
||||||
|
"run mmcargs; " \
|
||||||
|
"if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
|
||||||
|
"if run loadfdt; then " \
|
||||||
|
"bootm ${loadaddr} - ${fdt_addr}; " \
|
||||||
|
"else " \
|
||||||
|
"if test ${boot_fdt} = try; then " \
|
||||||
|
"bootm; " \
|
||||||
|
"else " \
|
||||||
|
"echo WARN: Cannot load the DT; " \
|
||||||
|
"fi; " \
|
||||||
|
"fi; " \
|
||||||
|
"else " \
|
||||||
|
"bootm; " \
|
||||||
|
"fi;\0" \
|
||||||
|
"netargs=setenv bootargs console=${console},${baudrate} " \
|
||||||
|
"root=/dev/nfs " \
|
||||||
|
"ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp\0" \
|
||||||
|
"netboot=echo Booting from net ...; " \
|
||||||
|
"run netargs; " \
|
||||||
|
"if test ${ip_dyn} = yes; then " \
|
||||||
|
"setenv get_cmd dhcp; " \
|
||||||
|
"else " \
|
||||||
|
"setenv get_cmd tftp; " \
|
||||||
|
"fi; " \
|
||||||
|
"${get_cmd} ${uimage}; " \
|
||||||
|
"if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
|
||||||
|
"if ${get_cmd} ${fdt_addr} ${fdt_file}; then " \
|
||||||
|
"bootm ${loadaddr} - ${fdt_addr}; " \
|
||||||
|
"else " \
|
||||||
|
"if test ${boot_fdt} = try; then " \
|
||||||
|
"bootm; " \
|
||||||
|
"else " \
|
||||||
|
"echo WARN: Cannot load the DT; " \
|
||||||
|
"fi; " \
|
||||||
|
"fi; " \
|
||||||
|
"else " \
|
||||||
|
"bootm; " \
|
||||||
|
"fi;\0"
|
||||||
|
|
||||||
|
#define CONFIG_BOOTCOMMAND \
|
||||||
|
"mmc dev ${mmcdev}; if mmc rescan; then " \
|
||||||
|
"if run loadbootscript; then " \
|
||||||
|
"run bootscript; " \
|
||||||
|
"else " \
|
||||||
|
"if run loaduimage; then " \
|
||||||
|
"run mmcboot; " \
|
||||||
|
"else run netboot; " \
|
||||||
|
"fi; " \
|
||||||
|
"fi; " \
|
||||||
|
"else run netboot; fi"
|
||||||
|
|
||||||
/* Miscellaneous configurable options */
|
/* Miscellaneous configurable options */
|
||||||
#define CONFIG_SYS_LONGHELP /* undef to save memory */
|
#define CONFIG_SYS_LONGHELP /* undef to save memory */
|
||||||
#define CONFIG_SYS_HUSH_PARSER /* use "hush" command parser */
|
#define CONFIG_SYS_HUSH_PARSER /* use "hush" command parser */
|
||||||
#define CONFIG_SYS_PROMPT_HUSH_PS2 "> "
|
#define CONFIG_SYS_PROMPT_HUSH_PS2 "> "
|
||||||
#define CONFIG_SYS_PROMPT "Vybrid U-Boot > "
|
#define CONFIG_SYS_PROMPT "=> "
|
||||||
#undef CONFIG_AUTO_COMPLETE
|
#undef CONFIG_AUTO_COMPLETE
|
||||||
#define CONFIG_SYS_CBSIZE 256 /* Console I/O Buffer Size */
|
#define CONFIG_SYS_CBSIZE 256 /* Console I/O Buffer Size */
|
||||||
#define CONFIG_SYS_PBSIZE \
|
#define CONFIG_SYS_PBSIZE \
|
||||||
|
@ -101,8 +189,7 @@
|
||||||
#define CONFIG_SYS_MEMTEST_START 0x80010000
|
#define CONFIG_SYS_MEMTEST_START 0x80010000
|
||||||
#define CONFIG_SYS_MEMTEST_END 0x87C00000
|
#define CONFIG_SYS_MEMTEST_END 0x87C00000
|
||||||
|
|
||||||
#define CONFIG_SYS_LOAD_ADDR 0x80010000
|
#define CONFIG_SYS_LOAD_ADDR CONFIG_LOADADDR
|
||||||
|
|
||||||
#define CONFIG_SYS_HZ 1000
|
#define CONFIG_SYS_HZ 1000
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -103,6 +103,8 @@
|
||||||
|
|
||||||
#if defined(CONFIG_MX6DL)
|
#if defined(CONFIG_MX6DL)
|
||||||
#define CONFIG_DEFAULT_FDT_FILE "imx6dl-wandboard.dtb"
|
#define CONFIG_DEFAULT_FDT_FILE "imx6dl-wandboard.dtb"
|
||||||
|
#elif defined(CONFIG_MX6Q)
|
||||||
|
#define CONFIG_DEFAULT_FDT_FILE "imx6q-wandboard.dtb"
|
||||||
#elif defined(CONFIG_MX6S)
|
#elif defined(CONFIG_MX6S)
|
||||||
#define CONFIG_DEFAULT_FDT_FILE "imx6s-wandboard.dtb"
|
#define CONFIG_DEFAULT_FDT_FILE "imx6s-wandboard.dtb"
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Reference in a new issue