Commit Graph

33354 Commits

Author SHA1 Message Date
Thomas Chou
a64be6124a nios2: convert ioremap to use dm cpu data
Convert ioremap() to use io_region_base in dm cpu global data.

Also remove three unused io functions, which have style issue
and are replaced by macros already.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
2015-10-23 07:37:20 +08:00
Thomas Chou
121e36dacd nios2: convert do_reset to use dm cpu data
Convert do_reset to use dm cpu data.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Simon Glass <sjg@chromium.org>
2015-10-23 07:37:20 +08:00
Thomas Chou
6368c3e75f nios2: remove asm/psr.h
Remove asm/psr.h, which is not used.
Also clean up asm/sections.h and unaligned.h.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Marek Vasut <marex@denx.de>
2015-10-23 07:37:20 +08:00
Thomas Chou
ca844dd8c5 nios2: convert altera sysid to driver model
Convert altera sysid to driver model with misc uclass.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Acked-by: Chin Liang See <clsee@altera.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2015-10-23 07:37:03 +08:00
Thomas Chou
4395e06eb9 dm: implement a Miscellaneous uclass
Implement a Miscellaneous uclass with generic read or
write operations. This class is used only for those
do not fit other more general classes.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Acked-by: Simon Glass <sjg@chromium.org>
2015-10-23 07:37:03 +08:00
Thomas Chou
2e2da4c67d serial: remove altera serial initializations
Both altera_jtag_serial_initialize() and
altera_serial_initialize() are no longer used after
they are converted to driver model.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Acked-by: Simon Glass <sjg@chromium.org>
Acked-by: Marek Vasut <marex@denx.de>
2015-10-23 07:37:03 +08:00
Thomas Chou
a54915d8a1 nios2: convert altera timer to driver model
Convert altera timer to driver model.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Acked-by: Chin Liang See <clsee@altera.com>
2015-10-23 07:37:03 +08:00
Thomas Chou
8f41b8785b timer: start a new timer after relocation
Start a new timer after relocation, just in case the
timer has been used in per-relocation.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Acked-by: Simon Glass <sjg@chromium.org>
2015-10-23 07:37:03 +08:00
Thomas Chou
c8a7ba9e6a dm: implement a Timer uclass
Implement a Timer uclass to work with lib/time.c.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Acked-by: Simon Glass <sjg@chromium.org>
2015-10-23 07:37:03 +08:00
Thomas Chou
bcae80e955 nios2: convert nios2 cpu to driver model
Convert nios2 cpu to driver model. The cpu parameters are
extracted from device tree and saved to global data structure.
We will use them to replace the custom_fpga.h .

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Simon Glass <sjg@chromium.org>
2015-10-23 07:37:03 +08:00
Thomas Chou
88d5ecf4b9 nios2 : convert altera_pio to driver model
Convert altera_pio to driver model.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Acked-by: Chin Liang See <clsee@altera.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2015-10-23 07:37:03 +08:00
Thomas Chou
d21275ef5e nios2: add clear and set bits macros
These macros can be used to clear and set multiple bits
in a register using a single call.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Marek Vasut <marex@denx.de>
Acked-by: Chin Liang See <clsee@altera.com>
2015-10-23 07:37:03 +08:00
Thomas Chou
15a56f9cb7 spi : convert altera_spi to driver model
Convert altera_spi to driver model

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Jagan Teki <jteki@openedev.com>
2015-10-23 07:36:56 +08:00
Thomas Chou
da2f838d8a nios2: convert altera_uart to driver model
Convert altera_uart to driver model.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Marek Vasut <marex@denx.de>
2015-10-23 07:36:51 +08:00
Thomas Chou
220e8021af nios2: convert altera_jtag_uart to driver model
Convert altera_jtag_uart to driver model.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Acked-by: Marek Vasut <marex@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
2015-10-23 07:36:37 +08:00
Thomas Chou
37e24499b9 nios2: map physical address to uncached virtual address
Add ioremap() to map physical address to uncached virtual
address. We need this to convert the reg address from the
device tree.

The order of headers inclusion in interrupts.c is changed
because common.h will include board header that contains
IO_REGION_BASE.

In the future, the IO_REGION_BASE should be decided from
the device tree.
tree

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Acked-by: Marek Vasut <marex@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
2015-10-23 07:29:11 +08:00
Thomas Chou
ac45c9cba1 nios2: enable malloc() pool before relocation
Enable malloc() pool before relocation, because this is needed
to use serial uclass.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Marek Vasut <marex@denx.de>
2015-10-23 07:28:50 +08:00
Thomas Chou
3e468e6896 nios2: call board_init_f_mem
We will need CONFIG_SYS_MALLOC_F_LEN to use serial uclass.
So we shall undefine CONFIG_SYS_GENERIC_GLOBAL_DATA, and
call board_init_f_mem() to allocates early malloc() memory
with size of CONFIG_SYS_MALLOC_F_LEN in board_f.c.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Marek Vasut <marex@denx.de>
2015-10-23 07:28:50 +08:00
Thomas Chou
34243804d6 nios2: zap version_string
There is a weak version_string[] at common/cmd_version.c .
Remove the one in start.S.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Acked-by: Marek Vasut <marex@denx.de>
2015-10-23 07:28:50 +08:00
Thomas Chou
651389a055 nios2: zap dly_clks
The dly_clks() in start.S is no use after switching to
generic timer. Remove it.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Acked-by: Marek Vasut <marex@denx.de>
2015-10-23 07:28:50 +08:00
Thomas Chou
e6500f86a6 nios2: Split timer code into timer.c
Move the timer code from interrupts.c into timer.c . Eliminate the
installation of timer interrupt handler, which is no longer used.

Signed-off-by: Marek Vasut <marex@denx.de>
Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
2015-10-23 07:28:50 +08:00
Thomas Chou
fea7f3aa3e nios2: Switch to generic timer
Zap almost all of the ad-hoc timer code from interrupts.c and
use the code in lib/time.c instead.

Signed-off-by: Marek Vasut <marex@denx.de>
Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
2015-10-23 07:28:50 +08:00
Thomas Chou
51068bcfc9 nios2: enable Driver Model
Enable the Driver Model config. The driver subsystems
are not enabled until we enable each of them.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Acked-by: Marek Vasut <marex@denx.de>
2015-10-23 07:28:50 +08:00
Thomas Chou
e6e2c15d48 nios2: enable device tree control of U-Boot
This patch adds device tree control of U-Boot to nios2 boards.
The example dts is taken from Linux kernel.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Marek Vasut <marex@denx.de>
2015-10-23 07:28:38 +08:00
Thomas Chou
1226dfdadd nios2: define _end in link script
Since commit 44c6e6591c
"rename _end to __bss_end__" , the _end was removed.
But we need it now for separated device tree control,
ie, CONFIG_OF_SEPARATE .

The _end is used by fdtdec_setup() to find the blob.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Acked-by: Marek Vasut <marex@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
2015-10-23 07:28:38 +08:00
Thomas Chou
355483e102 nios2: remove gp assignments in link script
Since we don't use gp for small data with option "-G0",
we use gp as global data pointer. The _gp location is
not needed.

The ALIGN(16) was for gp only. It is removed, so that we
can get correct address of dtb in u-boot-dtb.bin image.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Marek Vasut <marex@denx.de>
2015-10-23 07:28:38 +08:00
Thomas Chou
e900298ea4 nios2: enlarge the code relocation range
As we will use u-boot-dtb.bin, the code relocation range
should be adjusted to accommodate the additional dtb.
It might be overkilled to look into dtb header to find the
dtb size, so we will simply use CONFIG_SYS_MONITOR_LEN.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
2015-10-23 07:28:38 +08:00
Thomas Chou
4192b8c358 nios2: BSS should be cleared only after board_init_f
As dtb in u-boot-dtb.bin overlapped the BSS section,
we should delay the clearing of BSS until dtb is relocated
in board_init_f().

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Acked-by: Marek Vasut <marex@denx.de>
2015-10-23 07:28:37 +08:00
Thomas Chou
b6c180928c nios2: move altera_pio_init to board_early_init_r
As altera_pio_init() uses BSS, it should be moved to
board_early_init_r().

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Acked-by: Marek Vasut <marex@denx.de>
2015-10-23 07:28:37 +08:00
Thomas Chou
a03377b62f nios2: permit device tree control of U-Boot
Enable this in the Kconfig so that nios2 boards can use device
tree to configure U-Boot.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Marek Vasut <marex@denx.de>
2015-10-23 07:28:37 +08:00
Thomas Chou
25ea166112 nios2: enable CONFIG_NET_RANDOM_ETHADDR
Enable CONFIG_NET_RANDOM_ETHADDR to generate a random MAC address
when ETHADDR is not set.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Cc: Joe Hershberger <joe.hershberger@ni.com>
2015-10-23 07:28:37 +08:00
Thomas Chou
ca1d80c02f nios2: move command line configuration to Kconfig
This patch moves command line configuration from board header
file to board defconfig in the way of Kconfig. The change passed
savedefconfig.

This fixes warnings such as : "CONFIG_SYS_HUSH_PARSER" redefined,
when "Use hush shell" is selected with menuconfig, etc.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
2015-10-23 07:28:37 +08:00
Mugunthan V N
9f13b6d147 ARM: AM335x: mux: change mmc0 cd pinmux from mmc0_sdcd to gpio
Currently omap_hsmmc driver doesn't use sdcd pin to detect
whether the card is present or not. Instead the same pin is used
as GPIO to detect card presence. So change the pin mux mode from
mmc0_sdcd to gpio0_6.

Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
2015-10-22 14:44:03 -04:00
Mugunthan V N
1ed0f85faf drivers: gpio: omap: add support for parsing additional gpio parameters
With DM_GPIO, gpio parameters like ACTIVE_(LOW/HIGH) are to be
parsed in xlate gpio drivers-ops. Since xlate is not implemented
in omap_gpio driver, the driver considers all gpio to be
ACTIVE_HIGH which is the default case and fails to return actual
gpio status for ACTIVE_LOW gpios. So adding .xlate ops to
omap_gpio.

Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2015-10-22 14:44:02 -04:00
Mugunthan V N
eae7ae1853 am437x: Add am57xx_evm_defconfig using CONFIG_DM
Import various DT files for am57xx-beagle-x15 from
Linux Kernel v4.2
Add config file for this board, enable DM, DM_GPIO,
DM_SERIAL and DM_MMC.

Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com>
2015-10-22 14:44:02 -04:00
Mugunthan V N
136b1013a2 ti_omap5_common: mmc: do not define DM_MMC for spl
Since spl doesn't support DM currently, do not define DM_MMC
for spl build.

Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com>

asdfsadf
2015-10-22 14:44:01 -04:00
Mugunthan V N
7a837bcf12 am437x: Add am437x_sk_evm_defconfig using CONFIG_DM
Import various DT files for am437x-sk-evm from Linux Kernel v4.2
Add config file for this board, enable DM, DM_GPIO, DM_SERIAL
and DM_MMC.

Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>
2015-10-22 14:44:01 -04:00
Mugunthan V N
48038c4acb am437x: Add am437x_gp_evm_defconfig using CONFIG_DM
Import various DT files for am4372, an43xx pinctrl and
am437x-gp-evm from Linux Kernel v4.2
Add config file for this board, enable DM, DM_GPIO, DM_SERIAL
and DM_MMC.

Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>
2015-10-22 14:44:00 -04:00
Mugunthan V N
8aff39e333 am43xx_evm: mmc: do not define DM_MMC for spl
Since spl doesn't support DM currently, do not define DM_MMC
for spl build.

Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com>
2015-10-22 14:43:59 -04:00
Mugunthan V N
2a429d23e8 am43xx_evm.h: : switch to CONFIG_OMAP_SERIAL for non-SPL DM_SERIAL
Tested on am437x gp evm and am437x sk evm

Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com>
2015-10-22 14:43:59 -04:00
Mugunthan V N
e5a098b5cc drivers: serial: serial_omap: add comaptibles for all ti platforms
Adding compatibles for am335x, am437x and dra7 platforms.

Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>
2015-10-22 14:43:58 -04:00
Mugunthan V N
3a64845e9d drivers: serial: serial_omap: populate default clock frequency when not found in dt
In some platforms like am437x, serial node is not populated with
clock-frequency node. So in that case have a default clock-clock
frequency.

Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>
2015-10-22 14:43:58 -04:00
Mugunthan V N
1778d7f3e6 defconfig: am335x: gp_evm: enable mmc driver model
enable mmc driver model for am335x gp_evm as omap_hsmmc
supports driver model

Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
2015-10-22 14:43:58 -04:00
Mugunthan V N
fb41cd8775 defconfig: am335x: bbb: enable mmc driver model
enable mmc driver model for am335x bbb as omap_hsmmc
supports driver model

Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
2015-10-22 14:43:57 -04:00
Mugunthan V N
a9d6a7e23a drivers: mmc: omap_hsmmc: convert driver to adopt device driver model
adopt omap_hsmmc driver to device driver model

Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com>
2015-10-22 14:43:57 -04:00
Mugunthan V N
6ae843632e am335x_evm: mmc: do not define DM_MMC for spl
Since spl doesn't support DM currently, do not define DM_MMC
for spl build.

Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
2015-10-22 14:22:29 -04:00
Mugunthan V N
11e1582506 omap_hsmmc: update struct hsmmc to accomodate base address from DT
Existing driver gets the actual omap hammc base address + 0x100
bytes as the first 0x100 bytes is not used by the driver. But
with DM conversion the base address from DT is different, to
accommodate the offset adding res0[0x100] to struct hsmmc.

Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
2015-10-22 14:22:28 -04:00
Mugunthan V N
e5520e188b dra7xx: Add dra74_evm_defconfig using CONFIG_DM
Import various DT files for dra7-evm from Linux Kernel v4.2
Add config file for this board, enable DM and DM_GPIO

Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
2015-10-22 14:22:28 -04:00
Lokesh Vutla
b9ca4ab453 ARM: k2g: Add config file
Add config file for k2g

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com>
Signed-off-by: Vitaly Andrianov <vitalya@ti.com>
2015-10-22 14:22:27 -04:00
Lokesh Vutla
2a9a842ebe ARM: dts: k2g: Add DT support
Add basic DT support for k2g evm.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
2015-10-22 14:22:26 -04:00