Commit Graph

358 Commits

Author SHA1 Message Date
Simon Glass 401d1c4f5d common: Drop asm/global_data.h from common header
Move this out of the common header and include it only where needed.  In
a number of cases this requires adding "struct udevice;" to avoid adding
another large header or in other cases replacing / adding missing header
files that had been pulled in, very indirectly.   Finally, we have a few
cases where we did not need to include <asm/global_data.h> at all, so
remove that include.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>
2021-02-02 15:33:42 -05:00
Greg Gallagher 9119800591 board: atmel: Add SAMA5D27 giant board
Giant board is a tiny SBC based on the Adafruit Feather form factor,
created by groboards it contains a SAMA5D2 processor (SAMA5D27),
128 MB of RAM and a microSD card for storage.

Signed-off-by: Greg Gallagher <greg@embeddedgreg.com>
2021-01-22 15:09:59 +02:00
Eugen Hristev a07d2a1121 board: atmel: sama7g5ek: add support for MAC address retreival
Obtain two MAC addresses from the two EEPROMs and configure the two
available Ethernet interfaces accordingly.

Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com>
2021-01-07 09:44:16 +02:00
Eugen Hristev 0f8904b82d configs: sama7g5: add mmc config for sdmmc0
Add new config for storing environment from sdmmc0.
Also clean-up sama7g5ek_emmc1 to point to the proper mmc device.

Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com>
2021-01-07 09:44:16 +02:00
Eugen Hristev 1d463d6735 board: atmel: sama7g5ek: add initial support for sama7g5ek
Add initial support for sama7g5 evaluation kit board.

Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com>
2021-01-07 09:44:15 +02:00
Eugen Hristev 68d3ec599e board: atmel: common: introduce at91_set_eth1addr for second interface
We already have a function to retrieve the mac address from one EEPROM.
For boards with a second Ethernet interface, however, we would
require another EEPROM with a second unique MAC address.
Introduce at91_set_eth1addr which will look for a second EEPROM
and set the 'eth1addr' variable with the obtained MAC address.

Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com>
2020-09-22 11:27:18 +03:00
Simon Glass 411e9eb88c w1: Drop dm.h header file
This header file should not be included in other header files. Remove it
and use a forward declaration instead.

Signed-off-by: Simon Glass <sjg@chromium.org>
2020-08-03 22:19:54 -04:00
Masahiro Yamada b75d8dc564 treewide: convert bd_t to struct bd_info by coccinelle
The Linux coding style guide (Documentation/process/coding-style.rst)
clearly says:

  It's a **mistake** to use typedef for structures and pointers.

Besides, using typedef for structures is annoying when you try to make
headers self-contained.

Let's say you have the following function declaration in a header:

  void foo(bd_t *bd);

This is not self-contained since bd_t is not defined.

To tell the compiler what 'bd_t' is, you need to include <asm/u-boot.h>

  #include <asm/u-boot.h>
  void foo(bd_t *bd);

Then, the include direcective pulls in more bloat needlessly.

If you use 'struct bd_info' instead, it is enough to put a forward
declaration as follows:

  struct bd_info;
  void foo(struct bd_info *bd);

Right, typedef'ing bd_t is a mistake.

I used coccinelle to generate this commit.

The semantic patch that makes this change is as follows:

  <smpl>
  @@
  typedef bd_t;
  @@
  -bd_t
  +struct bd_info
  </smpl>

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2020-07-17 09:30:13 -04:00
Tom Rini c27178ba36 First set of u-boot-atmel fixes for 2020.07 cycle
-----BEGIN PGP SIGNATURE-----
 
 iQFQBAABCgA6FiEEqxhEmNJ6d7ZdeFLIHrMeAg6sL8gFAl7YxFMcHGV1Z2VuLmhy
 aXN0ZXZAbWljcm9jaGlwLmNvbQAKCRAesx4CDqwvyJnICACR6Q6OclfIuM0A3ubV
 GV48+iVz55eZnrZFKkbALBNjwTsshLpdZ/7Lr4zPD5e/FmrbJ+RONd0B6E38fSJk
 Rq1ZwMyuR6yv+LAb9+La36tGqD9bCFewqBpR5LQNOdjE+fG66rrWxksMME1jOIr5
 FLpFkk3lmEUloQumHDCQUgzXC/TUWpedgxpT15l1nR/Ovkh/MPvggIdS2zMWw92J
 oA9shaNTVLd//W9icduXagNtRMsjscmf/zTZFCYgBRjUZgiPW+HnitWg7jqbYIuY
 AqmNBZIrC6OuZ7W447g1rMGwbwQ5T9vbydp6PpHVqPvTt3D8OZ9h1+Hwwie7u9O1
 CPaV
 =xLcT
 -----END PGP SIGNATURE-----

Merge tag 'u-boot-atmel-fixes-2020.07-a' of https://gitlab.denx.de/u-boot/custodians/u-boot-atmel

First set of u-boot-atmel fixes for 2020.07 cycle

This set includes just two small commits that fix a build warning and
add a missing serial node.
2020-06-04 10:21:51 -04:00
Simon Glass 691d719db7 common: Drop init.h from common header
Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>
2020-05-18 17:33:33 -04:00
Simon Glass 90526e9fba common: Drop net.h from common header
Move this header out of the common header. Network support is used in
quite a few places but it still does not warrant blanket inclusion.

Note that this net.h header itself has quite a lot in it. It could be
split into the driver-mode support, functions, structures, checksumming,
etc.

Signed-off-by: Simon Glass <sjg@chromium.org>
2020-05-18 17:33:31 -04:00
Simon Glass b79fdc7697 common: Drop flash.h from common header
Move this uncommon header out of the common header.

Fix up some style problems in flash.h while we are here.

Signed-off-by: Simon Glass <sjg@chromium.org>
2020-05-18 14:53:28 -04:00
Josef Lusticky ef5a7438ac board: atmel: Fix compiler warning 'board_usb_hw_init()' not used
Wrap definition of board_usb_hw_init() around with #ifdef CONFIG_CMD_USB
to avoid warning: 'board_usb_hw_init' defined but not used
[-Wunused-function] when compiling without CONFIG_CMD_USB.

This patch makes sama5d27_som1_ek, sama5d2_ptc_ek and sama5d2_xplained
consistent with other boards that use the same #ifdef to avoid the warning.

Cc: Eugen Hristev <eugen.hristev@microchip.com>
Cc: Ludovic Desroches <ludovic.desroches@microchip.com>
Signed-off-by: Josef Lusticky <josef@lusticky.cz>
Reviewed-by: Eugen Hristev <eugen.hristev@microchip.com>
2020-05-06 16:18:53 +03:00
Simon Glass 9b4a205f45 common: Move RAM-sizing functions to init.h
These functions relate to memory init so move them into the init
header.

Signed-off-by: Simon Glass <sjg@chromium.org>
2020-01-17 14:02:35 -05:00
Simon Glass 5e6267af31 common: Move reset_phy() to net.h
This is a network function so let's move it into that header.

Signed-off-by: Simon Glass <sjg@chromium.org>
2020-01-17 13:26:50 -05:00
Tudor Ambarus f10b4006a6 board: atmel: sama5d27_wlsom1_ek: Set ethaddr from spi-nor flash
The SST26VF064BEUI spi-nor flash is programmed at the factory with a
globally unique address stored in the SFDP vendor parameter table and
it is permanently writeprotected. Retrieve the EUI-48 address and set it
as ethaddr env.

Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
2019-12-17 09:49:05 +02:00
James Byrne 464b50a343 board: Remove unnecessary inclusion of micrel.h from boards
Several boards still unnecessarily included micrel.h but no longer
require it since the switch to Device Tree configuration.

Signed-off-by: James Byrne <james.byrne@origamienergy.com>
2019-12-03 10:17:25 +02:00
Simon Glass cb3ef6810a common: Move old EEPROM functions into a new header
These functions do not use driver model but are still used. Move them to a
new eeprom.h header file.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
2019-12-02 18:25:25 -05:00
Simon Glass 5255932f01 common: Move some board functions out of common.h
A number of board function belong in init.h with the others. Move them.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
2019-12-02 18:25:21 -05:00
Simon Glass 2189d5f1e8 Move strtomhz() to vsprintf.h
At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
2019-12-02 18:23:09 -05:00
Simon Glass c3e4430ef3 common: Drop global inclusion of status_led.h
This is only used by a few files so it should not be in the common header.
Move it out.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
2019-12-02 18:23:06 -05:00
Eugen Hristev 522bac826e board: sam9x60ek: add support for MAC address retrieval
Retrieve mac address from i2c eeprom at boot time.

Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com>
2019-10-24 13:01:57 +03:00
Eugen Hristev 34c53a9baa board: atmel: sam9x60ek: add support for PDA detection
Automatically detect PDA at boot.

Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com>
2019-10-08 09:16:11 +03:00
Tudor Ambarus eadb0db982 configs: Add sam9x60ek_qspiflash_defconfig
Boot from QSPI nor flash.

The at91bootstrap, u-boot, u-boot env redundant, u-boot env,
device tree and kernel will reside in the QSPI nor flash.
The rootfs will reside in the NAND flash.

Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
2019-10-08 09:16:11 +03:00
Tudor Ambarus 33e8ecb0bd configs: Add sam9x60ek_nandflash_defconfig
Boot from nand flash.

Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
2019-10-08 09:16:11 +03:00
Tudor Ambarus 8ed15e4a3a board: sam9x60ek: Add NAND flash support
- EBI Chip Select Register is now in SFR,
- the pins are set to default values,
- timings are matching MT29F4G08BABWP's nand flash requirements.

Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
2019-10-08 09:16:11 +03:00
Sandeep Sheriker Mallikarjun 51422665de board: atmel: Add sam9x60ek board
Add new board SAM9X60-EK using the ARM926 SAM9X60 SoC.

Signed-off-by: Sandeep Sheriker Mallikarjun <sandeepsheriker.mallikarjun@microchip.com>
[tudor.ambarus@microchip.com:
- fix number of DRAM banks:
  One DDR2-SDRAM (W972GG6KB 2 Gbit = 16 Mbit x 16 x 8 banks]
- drop SPL related macros
- drop memtest macros
- drop CONFIG_SPI_BOOT, CONFIG_SYS_USE_DATAFLASH related macros
- drop inclusion of asm/arch/at91sam9_smc.h]
Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
2019-10-08 09:16:11 +03:00
Eugen Hristev cd8e876aa9 board: atmel: common: remove year from print message
Remove 2017 from being printed at boot video console.
This is outdated.
To avoid this situation, remove the year completely.

Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com>
2019-10-08 09:16:11 +03:00
Eugen Hristev a7b0bb63ba board: atmel: sama5d27_wlsom1_ek: start green led in SPL
When SPL boots, enable green led on the board.

Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com>
2019-10-08 09:16:11 +03:00
Eugen Hristev 2a09eb6340 board: atmel: sama5d2_wlsom1_ek: add qspi support and qspi boot config
Add support for qspi memory on board. Created boot support for QSPI
for both u-boot proper and SPL.

Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com>
2019-10-08 09:16:11 +03:00
Eugen Hristev c721c22a03 board: atmel: sama5d2_wlsom1_ek: add SPL support
Add support for SPL for this board: DRAM initialization, PMC initialization,
MMC boot.

Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com>
2019-10-08 09:16:11 +03:00
Nicolas Ferre 44b5c40be3 board: atmel: add sama5d27_wlsom1_ek board
Add support for the SAMA5D27-WLSOM1-EK. It's based on the Microchip
WireLess SoM which contains the SAMa5D27 LPDDR2 2Gbits SiP.

Signed-off-by: Nicolas Ferre <nicolas.ferre@microchip.com>
[eugen.hristev@microchip.com]: added u-boot specific dtsi and ported to 2019.10
Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com>
2019-10-08 09:16:11 +03:00
Simon Glass e7dcf5645f env: Drop environment.h header file where not needed
This header file is now only used by files that access internal
environment features. Drop it from various places where it is not needed.

Acked-by: Joe Hershberger <joe.hershberger@ni.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
2019-08-11 16:43:41 -04:00
Simon Glass 9fb625ce05 env: Move env_set() to env.h
Move env_set() over to the new header file.

Acked-by: Joe Hershberger <joe.hershberger@ni.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
2019-08-11 16:43:41 -04:00
Tudor Ambarus ff352ac853 configs: sama5d27_som1_ek: add qspiflash_defconfig
Add the default config file of QSPI media. The config is based on
sama5d27_som1_ek_mmc_defconfig.

Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
2019-07-09 09:26:43 +03:00
Tudor Ambarus 9ee8e7aec7 configs: sama5d2_xplained: add qspiflash_defconfig
Add the default config file of QSPI media. The config is based on
sama5d2_xplained_mmc_defconfig.

Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
2019-07-09 09:26:43 +03:00
Eugen Hristev ad371d8cd1 board: atmel: fix pda variable not being reset
In case someone detects a PDA and u-boot sets the 'pda' variable,
and the user does a saveenv, the pda is set in env, and if the
screen is removed, u-boot will still have in the env the 'pda'
variable, even if no screen is attached.
In order to fix this, we have to reset the 'pda' variable,
such that it's not just set if the screen is detected, but also unset
if no screen is detected.

Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com>
2019-06-27 09:47:49 +03:00
Eugen Hristev bc2d313d68 board: atmel: sama5d2_icp: enable green led on SPL completion
Enable the green led on SPL completion.
Red led has no pulldown and it will be lighted by default when the
board starts up.
If the PMIC is not configured to enable LDO2, the leds will not light.

Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com>
2019-05-15 09:34:22 +03:00
Eugen Hristev 2950c514e8 board: atmel: sama5d2_icp: standby disable on CAN transceivers in SPL
The 2 CAN transceivers have a STBDY pin which must be low in order to
operate.
This pin is tied to PB25.
Set it to 0 in bootstrap.
At a later time, this needs to be controlled by Linux power management
system, or requested by some driver as a gpio and tied to 0 during
CAN link up.

Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com>
2019-05-15 09:34:22 +03:00
Eugen Hristev 57fbd36c66 board: atmel: sama5d2_icp: add periph reset in SPL hw init
Some periphs on the board need to be reset by holding their reset GPIO down
for a specific time period.
On a warm reset, the periphs are not being reset by any reset pin and may be
in a wrong state.
Reset them in the SPL to make sure we are booting into the correct state
machine of the specific board periphs (KSZ eth switch, USB hub, HSIC eth,
Ethercat)

Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com>
2019-05-15 09:34:22 +03:00
Eugen Hristev f085452d85 board: atmel: add SAMA5D2 ICP board
The SAMA5D2 ICP Board features the SAMA5D27 SoC,
together with QSPI Flash, Wilc3000 wireless device and
EtherCat support.

Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com>
2019-04-18 09:43:22 +03:00
Eugen Hristev 61b4dbb0d0 board: at91sam9x5: add environment var for cpu type
When booting and CPU is detected from cpuid, we also need an environment
variable that will be used in boot commands to load the proper devicetree.

Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com>
2018-10-22 09:18:49 -04:00
Simon Glass 9949ee876d video: at91: Adjust vidconsole_position_cursor() to use char pos
At present this function uses pixels but it seems more useful for it to
position in terms of characters on the screen. This also matches the
comment to the function. Update this.

Unfortunately there is one user of this function (at91). Have a crack at
fixing this, since I cannot test it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Anatolij Gustschin <agust@denx.de>
2018-10-09 04:40:27 -06:00
Eugen Hristev 2f812824c5 MAINTAINERS: at91: update entry for at91 boards
Updated the maintainership for the at91 boards.

Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com>
2018-10-01 10:44:14 -04:00
Tom Rini 2c1e16b9d2 MAINTAINERS: Update some entries for missed boards
Signed-off-by: Tom Rini <trini@konsulko.com>
2018-09-30 13:00:37 -04:00
Eugen Hristev 95501d5242 board: sama5d4_xplained: add pda detect call at init time
Call the PDA detection mechanism at boot time so we can have
the pda environment variable ready for use.

Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com>
2018-09-28 20:22:41 -04:00
Eugen Hristev cc1bdd23c0 board: sama5d2_ptc_ek: add pda detect call at init time
Call the PDA detection mechanism at boot time so we can have
the pda environment variable ready for use.

Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com>
2018-09-28 20:22:40 -04:00
Eugen Hristev 67f551af89 board: sama5d27_som1_ek: add pda detect call at init time
Call the PDA detection mechanism at boot time so we can have
the pda environment variable ready for use.

Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com>
2018-09-28 20:22:40 -04:00
Eugen Hristev 59e43c3291 board: sama5d3_xplained: add pda detect call at init time
Call the PDA detection mechanism at boot time so we can have
the pda environment variable ready for use.

Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com>
2018-09-28 20:22:40 -04:00
Eugen Hristev 559ff9e875 board: sama5d2_xplained: add pda detect call at init time
Call the PDA detection mechanism at boot time so we can have
the pda environment variable ready for use.

Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com>
2018-09-28 20:22:39 -04:00