Commit Graph

27013 Commits

Author SHA1 Message Date
Simon Glass
76f90f3020 x86: Tidy up global descriptor table setup
This code is a little muddled, so tidy it up. Make sure that we put the
GDT in the right place and set it up properly.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2014-11-21 07:24:09 +01:00
Simon Glass
3c00695ee1 x86: Invalidate TLB as early as possible
We should invalidate the TLB right at the start to ensure that we don't get
false address translations even though paging is disabled.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2014-11-21 07:24:09 +01:00
Simon Glass
85d87328ea x86: Remove board_init16() call which is not used
This allows a board to do very early init, but no boards need to do this.
We may as well drop this feature.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2014-11-21 07:24:08 +01:00
Simon Glass
bc48806161 x86: Remove REALMODE_BASE which is no longer used
This was missed when the real mode support was dropped. Remove it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2014-11-21 07:24:08 +01:00
Simon Glass
933cdbb479 fdt: Try to use fdt_address_cells()/fdt_size_cells()
Use these new functions where possible. They default to a value of 2 so we
cannot use them in some places where we need a default value of 1.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@ti.com>
2014-11-21 04:43:18 +01:00
Simon Glass
2640387148 fdt: Add a function to decode a named memory region
Permit decoding of a named memory region from the device tree. This allows
easy run-time configuration of the address of on-chip SRAM, SDRAM, etc.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@ti.com>
2014-11-21 04:43:18 +01:00
Simon Glass
41f09bbe59 fdt: Change fdt_pack_reg() to static and fix types
This function is only called within this file so make it static. Also
fix its argument types to be consistent with its caller.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Anatolij Gustschin <agust@denx.de>
Reviewed-by: Tom Rini <trini@ti.com>
2014-11-21 04:43:18 +01:00
Simon Glass
c654b5172a fdt: Add ft_system_setup() function for system device tree additions
Add an additional function for adding information to the device tree before
booting. This permits additions which are not board-specific.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Anatolij Gustschin <agust@denx.de>
Reviewed-by: Tom Rini <trini@ti.com>
2014-11-21 04:43:18 +01:00
Simon Glass
6f4dbc21e4 fdt: Tidy up error handling in image_setup_libfdt()
The message about needing to reset should be printed no matter what error
is printed. Also, an error should always be printed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Anatolij Gustschin <agust@denx.de>
Reviewed-by: Tom Rini <trini@ti.com>
2014-11-21 04:43:17 +01:00
Simon Glass
f3cc44f984 fdt: Enhance flashmap function to deal with region properties
Flash regions can optionally be compressed or hashed. Add the ability to
read this information from the flashmap.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Anatolij Gustschin <agust@denx.de>
Reviewed-by: Tom Rini <trini@ti.com>
2014-11-21 04:43:17 +01:00
Simon Glass
76489832b2 fdt: Use the correct return types for fdtdec_decode_region()
Use the correct FDT data types for this function. Also add more debugging.

Acked-by: Anatolij Gustschin <agust@denx.de>
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@ti.com>
2014-11-21 04:43:17 +01:00
Simon Glass
a9e8e29101 fdt: Export the fdt_find_or_add_subnode() function
This function is useful for ensuring that a node exists. Export it so it
can be used more widely.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Anatolij Gustschin <agust@denx.de>
Reviewed-by: Tom Rini <trini@ti.com>
2014-11-21 04:43:17 +01:00
Simon Glass
4ba98dc269 fdt: Report failure of ft_board_setup()
Since this function can fail, print a message when it does.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Anatolij Gustschin <agust@denx.de>
Reviewed-by: Tom Rini <trini@ti.com>
2014-11-21 04:43:17 +01:00
Simon Glass
e895a4b06f fdt: Allow ft_board_setup() to report failure
This function can fail if the device tree runs out of space. Rather than
silently booting with an incomplete device tree, allow the failure to be
detected.

Unfortunately this involves changing a lot of places in the code. I have
not changed behvaiour to return an error where one is not currently
returned, to avoid unexpected breakage.

Eventually it would be nice to allow boards to register functions to be
called to update the device tree. This would avoid all the many functions
to do this. However it's not clear yet if this should be done using driver
model or with a linker list. This work is left for later.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Anatolij Gustschin <agust@denx.de>
2014-11-21 04:43:15 +01:00
Masahiro Yamada
111396ccb9 linux/kernel.h: add typechecking to roundup macro
This commit replaces roundup macro with the one from Linux Kernel.

DEFINE_ALIGN_BUFFER must be fixed because typechecking can not
be used in this context.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
2014-11-20 11:28:25 -05:00
Masahiro Yamada
48c7ea3966 linux/kernel.h: import more macros
These macros seem to be useful for U-Boot too (or at least
harmless).  Imported from Linux 3.18-rc2.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
2014-11-20 11:28:25 -05:00
Masahiro Yamada
cba1da495d include: move various macros to include/linux/kernel.h
U-Boot has imported various utility macros from Linux
scattering them to various places without consistency.

In include/common.h are min, max, min3, max3, ARRAY_SIZE, ALIGN,
container_of, DIV_ROUND_UP, etc.
In include/linux/compat.h are min_t, max_t, round_up, round_down,
etc.
We also have duplicated defines of min_t in some *.c files.

Moreover, we are suffering from too cluttered include/common.h.

This commit moves various macros that originate in
include/linux/kernel.h of Linux to their original position.

Note:
This commit simply moves the macros; the macros roundup,
min, max, min2, max3, ARRAY_SIZE are different
from those of Linux at this point.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
2014-11-20 11:28:25 -05:00
Masahiro Yamada
9e57a1c3ad include/common.h: remove DIV_ROUND definition
All the references of DIV_ROUND have been replaced with
DIV_ROUND_CLOSEST.  Remove DIV_ROUND.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
2014-11-20 11:28:25 -05:00
Masahiro Yamada
4515992fc7 replace DIV_ROUND with DIV_ROUND_CLOSEST
The Linux-compatible macro DIV_ROUND_CLOSEST is a bit more flexible
and safer than DIV_ROUND.

For example,
  foo = DIV_ROUND_CLOSEST(x, y++)
works expectedly, but
  foo = DIV_ROUND(x, y++)
does not. (y is incremented twice.)

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
2014-11-20 11:28:25 -05:00
Masahiro Yamada
3fd968e931 ARM: remove CONFIG_ARM1136 defines
CONFIG_CPU_ARM1136 was introduced into Kconfig by commit 2e07c249a6
(kconfig: arm: introduce symbol for ARM CPUs).

This commit removes all the defines of CONFIG_ARM1136 and replaces
the only reference in arch/arm/lib/cache.c with CONFIG_CPU_ARM1136.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
2014-11-20 11:28:25 -05:00
Masahiro Yamada
5d7b131d41 ARM: remove CONFIG_ARM926EJS defines
CONFIG_CPU_ARM926EJS was introduced into Kconfig by commit 2e07c249a6
(kconfig: arm: introduce symbol for ARM CPUs).

This commit removes all the defines of CONFIG_ARM926EJS and replaces
the only reference in arch/arm/lib/cache.c with CONFIG_CPU_ARM926EJS.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
2014-11-20 11:28:25 -05:00
Masahiro Yamada
f2168440de ARM: remove CONFIG_ARM920T defines
CONFIG_CPU_ARM920T was introduced into Kconfig by commit 2e07c249a6
(kconfig: arm: introduce symbol for ARM CPUs).

This commit removes all the defines of CONFIG_ARM920T and replaces the
only reference in drivers/usb/host/ohci-hcd.c with CONFIG_CPU_ARM920T.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
2014-11-20 11:28:25 -05:00
Masahiro Yamada
7c8f61f80c ARM: remove CONFIG_ARM1176 defines
CONFIG_ARM1176 is defined for some boards but not referenced at all.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
2014-11-20 11:28:25 -05:00
Masahiro Yamada
3fcfe80377 ARM: remove CONFIG_ARMV7 defines
Some (not all) of ARMv7 boards define CONFIG_ARMV7, which is useless.
Besides, it is never referenced.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Acked-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
2014-11-20 11:28:24 -05:00
Ye.Li
593243d3a2 imx: imx6q/dlsabreauto: Add PMIC Pfuze100 support
Add the pfuze100 initialization in power_init_board for imx6q/dl
sabreauto board.

Signed-off-by: Ye.Li <B37916@freescale.com>
2014-11-20 10:52:32 +01:00
Ye.Li
1f98e31bc0 imx: mx6sxsabresd: Use the pfuze common init function
Modify the pfuze init for mx6sxsabresd to use the shared
"pfuze_common_init" function. And move this initialization to
power_init_board.

Signed-off-by: Ye.Li <B37916@freescale.com>
2014-11-20 10:51:45 +01:00
Ye.Li
f0fabb7945 imx: mx6sabresd: Use the pfuze common init function
Modify the pfuze init for mx6sabresd to use the shared
"pfuze_common_init" function. And move this initialization to
power_init_board.

Signed-off-by: Ye.Li <B37916@freescale.com>
2014-11-20 10:51:45 +01:00
Ye.Li
5051ff5fb0 imx: mx6sabre common: Factorize the Pfuze init function
Since the Pfuze initializations are similar on various mx6 SABRE
boards. Factorize the initialization to a common function in file
board/freescale/common/pfuze.c. So that all SABRE boards BSP can
share the function.

Signed-off-by: Ye.Li <B37916@freescale.com>
2014-11-20 10:50:20 +01:00
Ye.Li
36523e9b0a power: pfuze100: Update definitions for buck regulators
Add definitions for buck regulators (SW1A/B/C) registers and voltage
values.

Signed-off-by: Ye.Li <B37916@freescale.com>
Reviewed-by: Przemyslaw Marczak <p.marczak@samsung.com>
2014-11-20 10:50:20 +01:00
Ye.Li
d0fbca2a3a imx: mx6sxsabresd: Add board support for USDHC2 and USDHC3
Add full support for USDHC2, USDHC3, USDHC4 on mx6sx sabresd board.
The default boot socket is USDHC4, so the MMC environment device and
mmcdev variable are set to this device.

Signed-off-by: Ye.Li <B37916@freescale.com>
2014-11-20 10:45:14 +01:00
Ye.Li
a3d6e38617 mmc: fsl_esdhc: Update esdhc driver for iMX6SX
The reset value of "uSDHCx_INT_STATUS_EN" register is changed to 0
on iMX6SX. So the fsl_esdhc driver must update to set the register,
otherwise no state can be detected.

Signed-off-by: Ye.Li <B37916@freescale.com>
2014-11-20 10:44:42 +01:00
Fabio Estevam
ae80eecceb mx6sabresd: Access SRC_SBMR1 register via structure
In U-boot it is preferred to access the register via structure pointer, so
convert it such style.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
2014-11-20 10:30:21 +01:00
Markus Niebel
b6d7810e5c tqma6: use imx_ddr_size
Signed-off-by: Markus Niebel <Markus.Niebel@tq-group.com>
2014-11-20 10:30:21 +01:00
Markus Niebel
fd53ec5baf tqma6: add warning on failed setup_i2c
setup_i2c has a return value. Use it to give feedback
on error.

Signed-off-by: Markus Niebel <Markus.Niebel@tq-group.com>
2014-11-20 10:30:21 +01:00
Markus Niebel
8cc65d383e tqma6: add missing include
Add include needed to have prototype for board_spi_cs_gpio

Signed-off-by: Markus Niebel <Markus.Niebel@tq-group.com>
2014-11-20 10:30:21 +01:00
Markus Niebel
528354681a tqma6: (cosmetic) remove CONFIG_FLASH_SECTOR_SIZE
This is nowhere documented and only used
by two other boards. Replace it with
TQMA6_SPI_FLASH_SECTOR_SIZE.

Signed-off-by: Markus Niebel <Markus.Niebel@tq-group.com>
2014-11-20 10:30:20 +01:00
Fabio Estevam
31b9023d84 mx6sabresd: Add mx6sabresd_spl_defconfig to MAINTAINERS entry
Let's add mx6sabresd_spl_defconfig entry into MAINTAINERS, so that we avoid
getting a warning that the mx6sabresd_spl is not maintained.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
2014-11-20 10:30:20 +01:00
Fabio Estevam
d7bc7e6031 mx6sxsabresd: Simplify the return value of setup_fec()
We can simply the return the value from enable_fec_anatop_clock() to make the
code smaller and simpler.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
2014-11-20 10:30:20 +01:00
Fabio Estevam
da5019e2b3 mx6slevk: Simplify the return value of setup_fec()
We can simply the return the value from enable_fec_anatop_clock() to make the
code smaller and simpler.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
2014-11-20 10:30:20 +01:00
Fabio Estevam
c9c41d0e2b mx6sabresd: State that only mx6q is supported in SPL
Make clear that current SPL code only supports the mx6q variant.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
2014-11-20 10:30:20 +01:00
Fabio Estevam
1769502b53 mx53loco: Fix error handling in board_mmc_init()
When an invalid USDHC port is passed we should return -EINVAL instead of 0.

Also, return the error immediately on fsl_esdhc_initialize() failure.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
2014-11-20 10:30:20 +01:00
Fabio Estevam
05beb8e012 wandboard: Fix error handling in board_mmc_init()
When an invalid USDHC port is passed we should return -EINVAL instead of 0.

Also, return the error immediately on fsl_esdhc_initialize() failure.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
2014-11-20 10:30:19 +01:00
Albert ARIBAUD
3cb4b713e1 tools/msximage.c: fix warning about nptr possibly uninitialized
Signed-off-by: Albert ARIBAUD <albert.u.boot@aribaud.net>
2014-11-20 10:30:19 +01:00
Fabio Estevam
cdbdde3f56 mx6qsabreauto: Add parallel NOR flash support
mx6sabreauto boards come with 32 MiB of parallel NOR flash.

Add support for it:

U-Boot 2015.01-rc1-18107-g1543636-dirty (Nov 14 2014 - 11:11:04)

CPU:   Freescale i.MX6Q rev1.2 at 792 MHz
Reset cause: POR
Board: MX6Q-Sabreauto revA
I2C:   ready
DRAM:  2 GiB
Flash: 32 MiB
NAND:  0 MiB

Due to pin conflict with I2C3, only define configure I2C3 IOMUX when flash is
not used.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
2014-11-20 10:30:19 +01:00
Fabio Estevam
573960aca5 mx6: add weim registers
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
2014-11-20 10:30:19 +01:00
Fabio Estevam
32c81ea65c imx: consolidate set_chipselect_size function
Move MX5 specific set_chipselect_size function into generic i.MX part,
such that MX6 based boards are able to use this function as well.

While doing this the iomuxc gpr member needed to be consolidated between
MX5 and MX6.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
2014-11-20 10:30:19 +01:00
Fabio Estevam
53b7f18044 mx6: Use a common SPL configuration file
Many boards use a minimal .cfg file in the SPL case.

Introduce spl_sd.cfg so that we can reuse it.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Acked-by: Stefano Babic <sbabic@denx.de>
2014-11-20 10:30:18 +01:00
Fabio Estevam
7d29acd9b7 novena: Move the DCD settings to spl code
mx6sabresd_spl.cfg configures CCM registers, GPR registers and CCM_CCOSR.

Move the configuration to the spl code.

CCM_CCOSR setting is no longer required to get audio functionality in the
kernel, so remove such setting.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Reviewed-by: Marek Vasut <marex@denx.de>
2014-11-20 10:30:11 +01:00
Fabio Estevam
e25fbe3fe5 gw_ventana: Move the DCD settings to spl code
mx6sabresd_spl.cfg configures CCM registers, GPR registers and CCM_CCOSR.

Move the configuration to the spl code.

CCM_CCOSR setting is no longer required to get audio functionality in the
kernel, so remove such setting.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
2014-11-20 10:13:54 +01:00
Fabio Estevam
6e9b6bb5a0 mx6sabresd: Move the DCD settings to spl code
mx6sabresd_spl.cfg configures CCM registers, GPR registers and CCM_CCOSR.

Move the configuration to the spl code.

CCM_CCOSR setting is no longer required to get audio functionality in the
kernel, so remove such setting.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
2014-11-20 10:13:54 +01:00