Piotr Dymacz [Sun, 20 Mar 2016 16:30:51 +0000 (17:30 +0100)]
Add more information about DDR timing values and print them in board info
Piotr Dymacz [Sun, 20 Mar 2016 16:12:32 +0000 (17:12 +0100)]
Be consistent with register names in common QC/A header
Piotr Dymacz [Sun, 20 Mar 2016 16:05:51 +0000 (17:05 +0100)]
Use BIT() macro in common QC/A header
Piotr Dymacz [Sun, 20 Mar 2016 16:00:21 +0000 (17:00 +0100)]
Restore workaround for AR9331 hang at boot issue
It looks that we really need it, so restore workaround
from original Atheros (Q)SDK. In future we should try
to find better way to deal with this problem.
Piotr Dymacz [Sun, 20 Mar 2016 14:09:33 +0000 (15:09 +0100)]
Add new, common setup code for QC/A WiSoC DDR controllers
In old code, based on Qualcomm/Atheros (Q)SDK, most of the
DDR controller related registers where setup with static
values, based on selected PLL/clocks configuration or
chosen board type.
New setup code is universal and configures DDR controller
based on real hardware state (clocks, memory type).
For now, the code doesn't support SDRAM memory type,
as I don't have access to any QC/A based platform with
such type of memory chip. But it seems, that newer QC/A
WiSoCs don't support it (excluding QCA953x v1?) anyway.
New code contains also fixed DQS delay tap controller tune
for AR93xx WiSoCs, which for now is used only for AR933x,
as it turned out that DDR BITS is available also on AR934x.
In old code, tune routine starts with some hardcoded values,
which leads to an assumption that this starting value is
inside working tap range. As it turned out after some tests,
this assumption is wrong and on some real hardware platforms
gives wrong delay tap values, outside correct/working range.
New code was tested on many different QC/A platforms, but
will need changes and fixes in future, mostly because of
missing (at the moment) descriptions of DDR BIST registers.
Piotr Dymacz [Thu, 17 Mar 2016 20:51:18 +0000 (21:51 +0100)]
For AR933x always return 16-bit DDR width
Piotr Dymacz [Mon, 14 Mar 2016 00:10:52 +0000 (01:10 +0100)]
Add DDR_FSM_WAIT_CONTROL register address in common QC/A header
Piotr Dymacz [Mon, 14 Mar 2016 00:09:38 +0000 (01:09 +0100)]
Setup AHB master tout in QCA95xx low level init, as it's done for AR933x
Piotr Dymacz [Sun, 13 Mar 2016 23:18:46 +0000 (00:18 +0100)]
Add DDR_BURST{,2} register defines in common QC/A header
Piotr Dymacz [Sun, 13 Mar 2016 21:57:04 +0000 (22:57 +0100)]
Add functions which return DDR width and CAS latency, use them in printing board info
Piotr Dymacz [Sun, 13 Mar 2016 21:43:07 +0000 (22:43 +0100)]
Calculate SPI clock only if needed in qca_clocks.c
Piotr Dymacz [Sun, 13 Mar 2016 21:41:46 +0000 (22:41 +0100)]
Adjust qca_dram.h after last changes in bit fields define names
Piotr Dymacz [Sun, 13 Mar 2016 21:39:36 +0000 (22:39 +0100)]
Add and fix DRAM register defines and two func prototypes in common QC/A header
Piotr Dymacz [Sun, 13 Mar 2016 10:48:28 +0000 (11:48 +0100)]
Cosmetic changes and fixes in qca_clocks.c
Piotr Dymacz [Thu, 10 Mar 2016 22:25:01 +0000 (23:25 +0100)]
Move DDR_RD_DATA_THIS_CYCLE reg setup in new AR933x dram init code before timing setup
Piotr Dymacz [Thu, 10 Mar 2016 17:19:08 +0000 (18:19 +0100)]
Add some bootstrap register related defines in common QC/A header
Piotr Dymacz [Thu, 10 Mar 2016 17:15:07 +0000 (18:15 +0100)]
Move up DDR_RD_DATA_THIS_CYCLE register setup in new AR933x dram init code
Piotr Dymacz [Wed, 9 Mar 2016 01:25:42 +0000 (02:25 +0100)]
Introduce new DRAM related init code for QC/A (for now AR933x)
Piotr Dymacz [Sun, 6 Mar 2016 15:02:51 +0000 (16:02 +0100)]
Include workaround for AR933x PLL init from old code, should fix problem with hang on start/restart
Piotr Dymacz [Fri, 4 Mar 2016 01:12:21 +0000 (02:12 +0100)]
Add QC/A DRAM related reg defines, function prototypes and use defines from soc_common.h for memory types
Piotr Dymacz [Thu, 3 Mar 2016 14:30:51 +0000 (15:30 +0100)]
Change GPIO_RST_BUTTON_* define names
Piotr Dymacz [Thu, 3 Mar 2016 13:05:27 +0000 (14:05 +0100)]
Change DEFAULT_FLASH_SIZE_IN_MB define name, use 4 by default, throw error on not supported value
Piotr Dymacz [Thu, 3 Mar 2016 12:57:16 +0000 (13:57 +0100)]
Change BOARD_CUSTOM_STRING define name, add default value if not defined
Piotr Dymacz [Thu, 3 Mar 2016 11:44:17 +0000 (12:44 +0100)]
Minor changes in common spi_flash.c
Piotr Dymacz [Wed, 2 Mar 2016 22:36:29 +0000 (23:36 +0100)]
Add support for TP-Link TL-WR841N v9 (QCA953x based)
Piotr Dymacz [Wed, 2 Mar 2016 22:33:50 +0000 (23:33 +0100)]
Fix ap143 Makefile
Piotr Dymacz [Wed, 2 Mar 2016 17:19:37 +0000 (18:19 +0100)]
Fix logic mistake in QC/A low level GPIO init
Piotr Dymacz [Wed, 2 Mar 2016 14:47:01 +0000 (15:47 +0100)]
Use 'CN' instead of 'CH' for indicate that device is for China market, plus minor fixes in Makefiles
Piotr Dymacz [Wed, 2 Mar 2016 14:24:03 +0000 (15:24 +0100)]
Include repository status (-{clean,dirty}) in version string
Piotr Dymacz [Wed, 2 Mar 2016 01:32:28 +0000 (02:32 +0100)]
Use CONFIG_TPLINK_IMAGE_HEADER define to select TP-Link img header, plus minor changes in Makefile
Piotr Dymacz [Tue, 1 Mar 2016 20:54:04 +0000 (21:54 +0100)]
Add original U-Boot image for TP-Link TL-WR841N v9
Piotr Dymacz [Tue, 1 Mar 2016 10:45:27 +0000 (11:45 +0100)]
Move reset_button_status function to common qca file
Piotr Dymacz [Mon, 29 Feb 2016 23:21:04 +0000 (00:21 +0100)]
Remove old and not used anymore code for QCA953x low level init
Piotr Dymacz [Sun, 28 Feb 2016 22:48:00 +0000 (23:48 +0100)]
Configure LSUART TX pin in low level GPIO init even if input/output masks are not defined
Piotr Dymacz [Tue, 23 Feb 2016 08:57:49 +0000 (09:57 +0100)]
Adjust apu143.h config file for new PLL/clock and GPIO configuration code, minor changes for WR820
Piotr Dymacz [Sun, 21 Feb 2016 13:18:40 +0000 (14:18 +0100)]
Adjust db12x.h config file for new PLL/clock configuration code
Piotr Dymacz [Sun, 21 Feb 2016 11:43:43 +0000 (12:43 +0100)]
Adjust ap121.h config file for new PLL/clock configuration code
Piotr Dymacz [Sun, 21 Feb 2016 11:40:15 +0000 (12:40 +0100)]
Remove old and unused ar933x header file
Piotr Dymacz [Sun, 21 Feb 2016 09:45:04 +0000 (10:45 +0100)]
Add cmd_qcaclk to Makefile
Piotr Dymacz [Sun, 21 Feb 2016 09:40:44 +0000 (10:40 +0100)]
Add new setclk/clearclk custom commands for QC/A
New code is universal, supports not only AR933x, but also
new QCA95xx and AR934x WiSoCs.
Piotr Dymacz [Sun, 21 Feb 2016 09:29:34 +0000 (10:29 +0100)]
Introduce new low level init code for AR934x/QCA95xx and AR933x
New code is simpler, more universal and supports:
- clock configuration stored in FLASH
- non-fractional PLL/clocks configuration
- recovery mode (sets safe clocks when recovery button is pressed)
This was tested on many different QC/A WiSoCs and platforms,
including new QCA95xx chips.
Code for AR933x still needs some additional work. The original code
from Atheros SDK is very buggy and includes lot of (still) unknown
parts, like "pmu setup", "meas", etc. It seems that most of that
is related with radio configuration.
Piotr Dymacz [Sun, 21 Feb 2016 09:22:41 +0000 (10:22 +0100)]
Remove platform related code from start{_bootstrap}.S code, we will have it new low level init code
Piotr Dymacz [Sun, 21 Feb 2016 09:18:09 +0000 (10:18 +0100)]
Don't use dash in defines
Piotr Dymacz [Sun, 21 Feb 2016 09:13:36 +0000 (10:13 +0100)]
Remove old code of setclk and clearclk custom commands
Piotr Dymacz [Sun, 21 Feb 2016 01:30:33 +0000 (02:30 +0100)]
Add GPIO_FUNCTION_2 register defines, setup GPIO11/12 if needed in low level init code for AR933x
Piotr Dymacz [Sat, 20 Feb 2016 01:17:26 +0000 (02:17 +0100)]
Fix CPU PLL dither register definitions; add some other needed defines in common QCA header file
Piotr Dymacz [Fri, 19 Feb 2016 12:54:18 +0000 (13:54 +0100)]
Introduce new, low level GPIO initialization code
New code is universal and allows to predefine several config options:
- JTAG enable
- bitmasks for GPIOs set as inputs and outputs
- bitmasks for GPIO driven LEDs (active in low and hi)
- bitmasks for initial values on configured GPIOs
- LSUART GPIO lines
Code was tested on all supported WiSoCs: AR933x, AR934x and QCA95xx.
This commit removes also old GPIO related code and adds needed
bitmasks definitions in ap121 and db12x configs.
Piotr Dymacz [Thu, 18 Feb 2016 10:48:49 +0000 (11:48 +0100)]
Fix AR933x GPIO related register bit fields in QC/A SOC common header file, add magic value for 'PLL configuration inside FLASH' flag
Piotr Dymacz [Mon, 15 Feb 2016 13:13:57 +0000 (14:13 +0100)]
Add some information about the author and clean up code in u-boot/common/command.c
Piotr Dymacz [Sat, 13 Feb 2016 19:41:27 +0000 (20:41 +0100)]
Add RTC related registers in QC/A SOC common header file
Piotr Dymacz [Thu, 11 Feb 2016 17:54:59 +0000 (18:54 +0100)]
Add original U-Boot images for two more AR9331 based devices
Piotr Dymacz [Thu, 11 Feb 2016 17:01:49 +0000 (18:01 +0100)]
Fix wrong U-Boot bin images file permissions
Piotr Dymacz [Thu, 11 Feb 2016 16:59:32 +0000 (17:59 +0100)]
Add original U-Boot images for two new GL-iNet devices: GL-AR150 and GL-AR300
Piotr Dymacz [Thu, 11 Feb 2016 14:45:35 +0000 (15:45 +0100)]
Add original U-Boot image for Wallys DR531
Piotr Dymacz [Tue, 15 Dec 2015 13:17:34 +0000 (14:17 +0100)]
Fix printing clock values lower than 100 MHz
Piotr Dymacz [Tue, 15 Dec 2015 11:45:53 +0000 (12:45 +0100)]
Allow to define particular stop character for autoboot
This would be useful for boards which share serial console with some
other device, like MCU, which may unintentionally interrupt boot process.
It is fast and simple solution, for future we should restore functionality
from original U-Boot code, with string stop sequences.
Piotr Dymacz [Mon, 14 Dec 2015 12:07:50 +0000 (13:07 +0100)]
Add some missing field defines in SPI FLASH related register
Piotr Dymacz [Thu, 10 Dec 2015 14:48:12 +0000 (15:48 +0100)]
Use macros for bit fiels definition in QC/A common header file
Piotr Dymacz [Thu, 10 Dec 2015 14:33:14 +0000 (15:33 +0100)]
Allow to use bit mask in asm code
Piotr Dymacz [Thu, 10 Dec 2015 13:54:52 +0000 (14:54 +0100)]
Fix wrong DPLL2 in SRIF area register definitions for QCA953x
As usual... you should not trust QC/A datasheets!
They are so buggy and contain lot of copy&paste mistakes.
DPLL2 register in SRIF for QCA953x seems to be totally different
than in other QCA95xx WiSOCs. Happily, definitions in original code
from SDK seem to be correct, so we will use it instead.
Clock settings based on setting default and SRIF PLL was confirmed on scope.
Piotr Dymacz [Thu, 3 Dec 2015 08:05:44 +0000 (09:05 +0100)]
Update default SPI divider value for QCA953x
Piotr Dymacz [Wed, 2 Dec 2015 23:56:53 +0000 (00:56 +0100)]
Include new FLASH common code file also in ap143 Makefile
Piotr Dymacz [Wed, 2 Dec 2015 18:30:07 +0000 (19:30 +0100)]
Fix SPI clock calculation in setclk command, use new QC/A clocks calculation function
Piotr Dymacz [Wed, 2 Dec 2015 18:24:56 +0000 (19:24 +0100)]
Include new FLASH common code file in Makefiles
Piotr Dymacz [Wed, 2 Dec 2015 18:14:58 +0000 (19:14 +0100)]
Update printing FLASH info in common code, allow to print info about more FLASH banks
Piotr Dymacz [Wed, 2 Dec 2015 18:08:27 +0000 (19:08 +0100)]
Add new file with FLASH related common code for all QCA boards
Piotr Dymacz [Wed, 2 Dec 2015 17:57:42 +0000 (18:57 +0100)]
Include new QC/A SPI FLASH driver in Makefile
Piotr Dymacz [Wed, 2 Dec 2015 16:27:17 +0000 (17:27 +0100)]
Remove from cmd_custom.c include of already removed header file
Piotr Dymacz [Wed, 2 Dec 2015 16:23:15 +0000 (17:23 +0100)]
Refactor FLASH related code
Add more information fields in FLASH description structure, add list of supported chips,
move some defines related with SPI NOR FLASH to flash.h, clean and reformat code.
Piotr Dymacz [Wed, 2 Dec 2015 16:11:14 +0000 (17:11 +0100)]
Remove old, flash related code from Atheros
Piotr Dymacz [Wed, 2 Dec 2015 01:07:46 +0000 (02:07 +0100)]
Add SFDP support in new QC/A SPI driver
SFDP (serial FLASH discoverable parameters) allows to get useful information
about FLASH parameters and we will use it for unknown chip, to get basic data
like size, erase sector size and corresponding erase command.
Plus, some other minor changes:
- remove defines (we will keep it in flash.h)
- use provided sector erase command
Piotr Dymacz [Tue, 24 Nov 2015 12:38:35 +0000 (13:38 +0100)]
Remove infinite loop from new QC/A SPI driver
It seems that we really don't need and don't want this loop here.
In case of missing FLASH chip, we should get 0x0 from SPI shift in register after the command, because other chips are silent during their CS high.
What's more, it seems that the access to SPI shift in register is somehow locked until the SOC shifts out all previously programmed bits.
That is only a theory after some tests on scope and still needs more tests.
Piotr Dymacz [Mon, 23 Nov 2015 17:35:58 +0000 (18:35 +0100)]
Add missing copyright/license info
Piotr Dymacz [Sun, 22 Nov 2015 21:51:58 +0000 (22:51 +0100)]
Add initial version of new QC/A SPI FLASH driver
Instead of using so called bit banging/blasting mode, as the old one driver from Atheros SDK does, this driver utilizes SPI shift registers.
With this approach, we need to only setup one register and let the built-in SPI controller do the rest.
SPI shift registers and how they work exactly are not described very well in QC/A WiSoCs datasheets, so som things had to be tested in practice.
This driver has been already successfully tested on all supported platforms, including:
- Atheros AR933x (SPI shift registers are not mentioned in its datasheet!)
- Atheros AR9341/4
- Qualcomm Atheros QCA953x
Tests on scope showed that with this driver, clock for SPI is the same as the one set in SPI_CONTROL register (depends on platform, between 25 and 30 MHz).
With old driver, clock was around 4-6 MHz, which means that new driver may drastically increase SPI operations speed.
In practical tests, for operations like sector erase, time needed by chip to finish the operation, is more significant, so there is no difference at all.
Comparison for other operations, like page program, has not been done yet.
Piotr Dymacz [Mon, 16 Nov 2015 11:46:31 +0000 (12:46 +0100)]
WIP: clean little bit ap143.h
Piotr Dymacz [Mon, 16 Nov 2015 11:16:40 +0000 (12:16 +0100)]
Add support for LED and button in TL-WR820N
Piotr Dymacz [Mon, 16 Nov 2015 11:06:06 +0000 (12:06 +0100)]
Drop executable file attrib for original U-Boot images
Piotr Dymacz [Mon, 16 Nov 2015 11:01:42 +0000 (12:01 +0100)]
Add original U-Boot image for TP-Link TL-WR820N v1 for China market
Piotr Dymacz [Mon, 16 Nov 2015 11:00:47 +0000 (12:00 +0100)]
Update .gitignore: track original u-boot images
Piotr Dymacz [Mon, 16 Nov 2015 02:15:39 +0000 (03:15 +0100)]
Include all files from TP-Link GPL sources needed to make TL-WR820N based on QCA953x compile and work... we will clean this mess later
Piotr Dymacz [Mon, 16 Nov 2015 02:14:18 +0000 (03:14 +0100)]
Add initial definition for TL-WR820N CH in U-Boot Makefile
Piotr Dymacz [Mon, 16 Nov 2015 02:11:57 +0000 (03:11 +0100)]
Remove not used anymore config CONFIG_HORNET_1_1_WAR
Piotr Dymacz [Mon, 16 Nov 2015 02:10:56 +0000 (03:10 +0100)]
Remove old configs CONFIG_AR7240 and CONFIG_AR7100
Piotr Dymacz [Mon, 16 Nov 2015 01:52:17 +0000 (02:52 +0100)]
Add TL-WR820N CH definition in top level Makefile
Piotr Dymacz [Mon, 16 Nov 2015 01:49:20 +0000 (02:49 +0100)]
Rework start(_bootstrap).S files
Piotr Dymacz [Mon, 16 Nov 2015 01:16:51 +0000 (02:16 +0100)]
More cleans, this time with AR934x low level related code and forgotten changes in Makefile for AR933x low level code
Piotr Dymacz [Mon, 16 Nov 2015 01:08:18 +0000 (02:08 +0100)]
Clean mess with AR933x low level related code
Piotr Dymacz [Mon, 16 Nov 2015 00:03:21 +0000 (01:03 +0100)]
Add qca_gpio_init.S file with lowlevel initialization of GPIO, for platforms based on QC/A SOCs
Piotr Dymacz [Sun, 15 Nov 2015 23:14:49 +0000 (00:14 +0100)]
Add GPIO MUX related definitions in qca_soc_common.h header file, plus some minor fixes
Piotr Dymacz [Sun, 15 Nov 2015 23:13:28 +0000 (00:13 +0100)]
Adjust QC/A SOC related code to the new bitmask SOC_TYPE values
Piotr Dymacz [Sun, 15 Nov 2015 23:11:24 +0000 (00:11 +0100)]
Don't include linux/bitops.h header in ASM code
Piotr Dymacz [Sun, 15 Nov 2015 16:07:00 +0000 (17:07 +0100)]
Fix wrong bitwise operators used for SOC_TYPE defines
Piotr Dymacz [Sun, 15 Nov 2015 14:12:11 +0000 (15:12 +0100)]
Use new bitmask for SOC_TYPE in QC/A common registers definition header
Piotr Dymacz [Sun, 15 Nov 2015 14:02:26 +0000 (15:02 +0100)]
Use bitmasks for SOC types and SOC families selection
That will allow us to not only select specific SOC,
like QCA9558, but also the family, ex. QCA955x
Piotr Dymacz [Sat, 14 Nov 2015 20:43:00 +0000 (21:43 +0100)]
Rework code related with CPU reset, plus minor fixes
Piotr Dymacz [Sat, 14 Nov 2015 19:18:15 +0000 (20:18 +0100)]
Add bit fields definitions for RST_RESET register in QC/A common register definition header, plus some minor fixes
Piotr Dymacz [Sat, 14 Nov 2015 01:15:33 +0000 (02:15 +0100)]
Fix definitions for QCA953x revisions
Piotr Dymacz [Sat, 14 Nov 2015 14:25:56 +0000 (15:25 +0100)]
Add support for reading MIPS CPU type and print it during booting
Piotr Dymacz [Fri, 13 Nov 2015 02:07:23 +0000 (03:07 +0100)]
Remove old serial and clock drivers, we don't need them anymore
Piotr Dymacz [Fri, 13 Nov 2015 02:04:40 +0000 (03:04 +0100)]
Adjust code in ar7240_flash.c to work after last changes
It's really ugly and need to be rewritten soon... for now, keep it as it is