1196 Commits

Author SHA1 Message Date
Martijn Scheepers
7d8e551380 h1502r11 config as default 2019-12-09 13:19:25 +01:00
Martijn Scheepers
6ab19be0dc update pmc location 2019-12-09 09:19:57 +01:00
Martijn Scheepers
ebed1fcba2 Merge branch 'master' of https://github.com/linux4sam/at91bootstrap 2019-12-09 08:59:26 +01:00
Eugen Hristev
888c3a1e8a driver: at91_slowclk: fix sam9x60 oscsel bit
SAM9X60 has another bit as slow clock selector (OSCSEL).
Fix the defines accordingly.
SAM9X60 does not have a bit to disable the internal RC slow clock (it is
always enabled).
Thus the function for this feature should not be available.

Reported-by: Ilie Galan <ilie.galan@microchip.com>
Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com>
2019-11-29 15:06:07 +02:00
Eugen Hristev
c685e79cf1 Makefile: prepare 3.9.1-rc1
Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com>
2019-11-28 11:59:36 +02:00
Cristian Birsan
fa0fdceab9 defconfig: sama5d2_icp-bsr: backup + self refresh support
Add defconfigs to enable support of the backup + self refresh support on
sama5d2_icp boards.

Tested-by: Ilie Galan <ilie.galan@microchip.com>
Signed-off-by: Cristian Birsan <cristian.birsan@microchip.com>
2019-11-25 09:40:59 +02:00
Eugen Hristev
889ed2c7fc Makefile: prepare 3.9.0
Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com>
2019-10-22 13:33:51 +03:00
Eugen Hristev
7b42a8e27a Makefile: prepare 3.9.0-rc5
Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com>
2019-10-16 14:28:14 +03:00
Eugen Hristev
69e8f73659 sam9x60: adapt PMC_PLL_ACR to datasheet
Datasheet recommends different values for UPLL and PLLA analog control
register.
Adapt accordingly.

Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com>
2019-10-11 17:06:12 +03:00
Eugen Hristev
13ef0f786a Makefile: prepare 3.9.0-rc4
Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com>
2019-10-09 16:30:00 +03:00
Claudiu Beznea
0d61b6daa7 board: sama5d27_wlsom1_ek: add config for BSR
Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
2019-10-09 15:57:25 +03:00
Claudiu Beznea
83e11c526d driver: ddramc: add bsr support for lpddr2 memories with sama5d2
Reuse ddr3_sdram_bkp_init() to reprogram LPDDR2 memories with SAMA5D2.
Rename the function into ddr3_lpddr2_sdram_bkp_init().

Tested-by: Nicolas Ferre <nicolas.ferre@microchip.com>
Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com>
Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
2019-10-09 15:56:52 +03:00
Eugen Hristev
a5cbe08e84 board: sam9x60ek: wilc power sequence
After board init, do the wilc power sequence for WILC initialization.

Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com>
2019-10-08 16:48:28 +03:00
Eugen Hristev
7d8b3d62b0 Merge pull request #100 from florolf/fix-overconsumption-erratum-check
board: sama5d27_som1_ek: fix over-consumption erratum check
2019-10-02 15:47:55 +03:00
Florian Larysch
817a7d867f sama5d27_som1_ek: fix over-consumption erratum check
at91_sdhc_hw_init checks whether the over-consumption erratum fix is in
place by evaluating the SDMMC_CALCR register. However, the check is a
bitwise OR, which results in the condition always being true. Use a
bitwise AND to check if the ALWYSON bit is set.

Signed-off-by: Florian Larysch <florian.larysch@grandcentrix.net>
2019-10-02 13:12:43 +02:00
Eugen Hristev
016e63841e board: sama5d27_wlsom1_ek: fix QSPI mode
On some boards, the QSPI is not booting correctly in MODE0
MODE3 is the correct operating mode.

Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com>
2019-09-19 16:10:28 +03:00
Eugen Hristev
7a2d6bad0b board: sam9x60_sdr_sip_eb: fix MPDDR bit selected by error
This bit should not be selected for SDRAMC controller.
It is only for DDR memories.

Fixes: 7c62e974cc ("board: sam9x60_sdr_sip_eb: introduce SAM9X60 SDR SIP Engineering board")
Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com>
2019-09-13 16:49:44 +03:00
Eugen Hristev
98145e69e4 Makefile: prepare 3.9.0-rc2
Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com>
2019-09-13 09:07:32 +03:00
Christian Hack
409fb89724 lib: memcpy: fix memcpy and memset to standard return pointers
as per K&R etc. memcpy should return a pointer to destination not
destination + size.
This makes GCC 8.2.0+ get confused when using at91bootstrap memcpy
instead of it's own lib's memcpy implementation

Signed-off-by: Christian Hack <christian.hack@ams-it.com.au>
Reviewed-by: Eugen Hristev <eugen.hristev@microchip.com>
2019-09-13 09:04:16 +03:00
Eugen Hristev
cae6f809a6 board: sama5d2: fix plla charge pump register
The field named ICP_PLLA[1:0] must be written to 0.
Even if its default value is 0, it is wrongly re-written to 0x3 by the ROMCode.
We must correct this before that the DDR initialization sequence is started.

Tested-by: Marco Cardellini <marco.cardellini@microchip.com>
Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com>
Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com>
2019-09-13 08:54:59 +03:00
Claudiu Beznea
ce0d89d1a2 include: arch: pmc-v1: fix macros values
Commit 1965938c10 introduced pmc-v1.h header. In v2 of the patch series
that was send internally the content of pmc-v1.h was preserved from what
was defined in v1 of the patch series (internally) related to SAMA5D2.
But the pmc-v1.h introduced by commit 1965938c10 should have been
preserved the content of what was in include/arch/at91_pmc/pmc.h.

Fixes: 1965938c10 ("include: arch: at91_pmc: introduce a new header for 1st PMC version")
Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
2019-09-12 12:57:14 +03:00
Claudiu Beznea
d15b9de0ba driver: pmc: pll-clk: remove unnecessary #ifdef
#ifdef PMC_PLLICPR is not needed anymore since the driver is selected
only by SoCs that supports it.

Fixes: 144f474721 ("driver: pmc: move pll code into its own file")
Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
2019-09-12 12:57:14 +03:00
Claudiu Beznea
bee0d231c8 driver: pmc: pll-clk: revert to using *ALT_MULA* macros
B/w v1 and v2 of internal patches the usage of *_ALT_* related macros
was restored but not for PLLA register. Revert it also for PLLA register.

Fixes: 144f474721 ("driver: pmc: move pll code into its own file")
Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
2019-09-12 12:57:14 +03:00
Eugen Hristev
9a0bafe0fe Makefile: prepare 3.9.0-rc1
Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com>
2019-09-09 17:26:32 +03:00
Eugen Hristev
f42a388003 board: sam9x60ek/eb: fix EBICSA DDR/NAND line mux
If we boot from nandflash, DDR will not work unless we specifically
configure nand lines to the real D16-D31 where it's connected.
RomCode will disable this bit if NAND is used.

Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com>
2019-09-09 17:26:32 +03:00
Eugen Hristev
f93ccc8883 board: sama5d27_wlsom1_ek: add support for QSPI boot
Add support and defconfig for booting from QSPI memory which
is available on the WLSOM cpu module on QSPI1 controller

Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com>
2019-09-09 17:26:32 +03:00
Eugen Hristev
b092906a4f board: sama5d27_wlsom1_ek: green led on at boot
At boot time, enable green led.

Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com>
2019-09-09 17:26:32 +03:00
Nicolas Ferre
97636ad69f sama5d27_wlsom1_ek: LPDDR2 config: add MR4R and COUNT CAL values
Add all timer values for MPDDRC_LPDDR2_LPDDR3_DDR3_CAL_MR4 register
on the LPDDR2 for the SiP.

Signed-off-by: Nicolas Ferre <nicolas.ferre@microchip.com>
2019-09-09 17:26:32 +03:00
Nicolas Ferre
0d63272f86 board: sama5d27_wlsom1_ek: introduce SAMA5D27 WLSOM1 EK
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>
2019-09-09 17:26:32 +03:00
Nicolas Ferre
a334e37774 at91_ddrsdrc.h: add MR4 Read bit field
Add the MR4 Read bit field in MPDDRC_LPDDR2_LPDDR3_DDR3_CAL_MR4 register
macro for writing this value.

Signed-off-by: Nicolas Ferre <nicolas.ferre@microchip.com>
2019-09-09 17:26:32 +03:00
Nicolas Ferre
ad2ca69d94 at91_ddrsdrc.h: add ADJ_REF Adjust Refresh Rate bit
Signed-off-by: Nicolas Ferre <nicolas.ferre@microchip.com>
2019-09-09 17:26:32 +03:00
Eugen Hristev
7c62e974cc board: sam9x60_sdr_sip_eb: introduce SAM9X60 SDR SIP Engineering board
This board features the SAM9X60 SDR SIP with 8MB of external RAM.

Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com>
2019-09-09 17:26:32 +03:00
Eugen Hristev
4f10aa88f5 driver: memory: add 8MB support
Add support for CONFIG_RAM_8MB

Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com>
2019-09-09 17:26:32 +03:00
Eugen Hristev
b6c878d119 driver: sdramc: update with new IP version
Add register CFR1 and extra fields with are present in the latest IP version

Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com>
2019-09-09 17:26:32 +03:00
Eugen Hristev
d5687b8ac8 board: sam9x60_ddr2_sip_eb: introduce SAM9X60 DDR2 SIP Engineering board
This board features the SAM9X60 DDR2 SIP with 128MB of external RAM.

Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com>
2019-09-09 17:26:32 +03:00
Eugen Hristev
4f28d7ed05 board: sam9x60ek: add defconfig for qspi linux boot
add defconfig for booting linux+dt from qspi

Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com>
2019-09-09 17:26:32 +03:00
Tudor Ambarus
83a9d29971 pmc: add qspi system clock
The QSPI controller has 2 clocks, both mandatory: the qspi
peripheral clock and the qspi system clock. Add the qspi system
clock.

Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
2019-09-09 17:26:32 +03:00
Tudor Ambarus
52d4da9ed3 board: sam9x60ek: add sam9x60ekdf_qspi_uboot_defconfig
Boot from qspi.

Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
2019-09-09 17:26:32 +03:00
Tudor Ambarus
fe5255c44d board: sam9x60ek: fix spi-nor flash clock polarity and phase
The inactive state value of QSCK is logic level zero
Data is captured on the leading edge of QSCK and changed
on the following edge of QSCK.

Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
2019-09-09 17:26:32 +03:00
Tudor Ambarus
b110a2bf42 board: sam9x60ek: enable qspi controller
The sam9x60 qspi controller uses 2 clocks, one for the peripheral register
access, the other for the qspi core and phy. Both are mandatory.

Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
2019-09-09 17:26:32 +03:00
Tudor Ambarus
745ad25e5c driver: at91_qspi: add support for sam9x60 qspi controller
It has dedicated registers to specify a read or a write instruction:
Read Instruction Code Register (RICR) and Write Instruction Code
Register (WICR). ICR/RICR/WICR have identical fields.

Even if the controller defines a dedicated bit for APB Transfer Type
(APBTFRTYP), there is no need to use it, since the driver now works only
with AHB transfers.

Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
[eugen.hristev@microchip.com]: converted this feature as Kconfig
Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com>
2019-09-09 17:26:32 +03:00
Tudor Ambarus
089fed8000 driver: at91_qspi: make sure ICR fields are correctly masked
Avoids setting of unneeded bits.

Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
2019-09-09 17:26:32 +03:00
Tudor Ambarus
92d87b2789 driver: qspi: exit loop with a timeout
qspi could loop forever when the expected interupts are not
raised. Break the loop with a timeout.

Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
2019-09-09 17:26:32 +03:00
Tudor Ambarus
5e6b9fd7d1 driver: qspi: fix typo, s/Memort/Memory
Fix comment typo.

Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
2019-09-09 17:26:32 +03:00
Eugen Hristev
db1a6da5d2 board: sam9x60ek: add nand flash linux load defconfig
Add sam9x60eknf_linux_image_dt_defconfig and resync
sam9x60eknf_uboot_defconfig

Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com>
2019-09-09 17:26:32 +03:00
Tudor Ambarus
f7bd5b5d14 configs: sam9x60eknf_uboot_defconfig: add nand config
Used savedefconfig.

Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
2019-09-09 17:26:32 +03:00
Tudor Ambarus
31116381a2 board: sam9x60ek: add nand 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-09-09 17:26:32 +03:00
Tudor Ambarus
e36f9ad6eb scripts: generate pmecc header for sam9x60's nand flash
MT29F4G08BABWP has:
- 2048 blocks
- block size: 256K
- page size: 4096 bytes
- oob size: 224
- bus width: 8 bit

Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
2019-09-09 17:26:32 +03:00
Tudor Ambarus
307d0cd9f5 driver: nandflash: add support for MT29F4G08BABWP
MT29F4G08BABWP nand flash has:
- 2048 blocks
- block size: 256K
- page size: 4096 bytes
- oob size: 224
- bus width: 8 bit

Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
2019-09-09 17:26:31 +03:00
Eugen Hristev
266c5620d5 board: sam9x60: add support for flexcom0 and twi
Enable flexcom support and TWI for flexcom0.
On this bus there is an EEPROM with board information

Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com>
2019-09-09 17:26:31 +03:00