summaryrefslogtreecommitdiffstats
path: root/arch/mips/mach-ath79
Commit message (Collapse)AuthorAgeFilesLines
* MIPS: ath79: Use errno to get error code from open_and_lseek()Andrey Smirnov2019-03-111-2/+2
| | | | | | | | Open_and_lseek() return actual error code via errno, so change the code to use it instead of return value. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* MIPS: ath79: add spi and sram bootstrap helpersOleksij Rempel2019-01-244-0/+60
| | | | | | | | | | | | | | | | | | | | | | | | | At least some ath79 SoC have build in 32K RAM. It allow us to use lowlevel portion of barebox to bootstrap the system by using JTAG debugger (For example OpenOCD). Since ath79 has no reliable way to stop the CPU execution before reading SPI Flash, this can cause different issues. To avoid it, we need to flash a execution trap with software debug breakpoint to the flash. The workflow should be as follow: - After power on or reset the CPU will start execution of SPI flash. As soon as software debug breakpoint is executed, CPU will halt and notify OpenOCD about breakpoint event. - OpenOCD will load reduced barebox to SRAM and execute it. This part will do all needed low level initialization - PLL, RAM and trigger second breakpoint event. - OpenOCD will load full barebox version to the main RAM and start execution. It can be used for bring-up, so no regular flashing is needed. Signed-off-by: Oleksij Rempel <linux@rempel-privat.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* MIPS: update to GPL-2.0-or-later for files copyrighted by meOleksij Rempel2019-01-031-1/+1
| | | | | | Signed-off-by: Oleksij Rempel <linux@rempel-privat.de> Reviewed-by: Roland Hieber <r.hieber@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* MIPS: migrate all files to SPDXOleksij Rempel2019-01-037-69/+7
| | | | | | Signed-off-by: Oleksij Rempel <linux@rempel-privat.de> Reviewed-by: Roland Hieber <r.hieber@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* MIPS: remove HAS_NO_BOARD_HL_CODE supportOleksij Rempel2018-12-171-2/+0
| | | | | | | | With multiimage support it makes no more sense, every board should have Makefile and some lowlevel code. Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* MIPS: port all mach* to multiimageOleksij Rempel2018-12-175-11/+26
| | | | | Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* MIPS: ath79: provide driver for Atheros ART partitionOleksij Rempel2018-06-142-0/+113
| | | | | | | | | | this partition contains calibration data for WiFi and some board specific data, like MAC address. For now we care only about MAC. Signed-off-by: Oleksij Rempel <linux@rempel-privat.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* MIPS: ath79: fix different typosOleksij Rempel2018-03-021-2/+2
| | | | | | | | | the CONFIG typos was not real issue. The defconfig typo i detected only after clean compile. I hope we can migrate barebox MIPS to multiimage soon. Signed-off-by: Oleksij Rempel <linux@rempel-privat.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* MIPS: add initial 8devices-lima boardOleksij Rempel2018-02-131-0/+8
| | | | | | | | More information about this board can be found here: https://www.8devices.com/products/lima Signed-off-by: Oleksij Rempel <linux@rempel-privat.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* MIPS: add initial qca4531 supportOleksij Rempel2018-02-131-0/+70
| | | | | | | | | The QCA4531 is a two stream (2x2) 802.11b/g/n single-band programmable Wi-Fi System-on-Chip (SoC) for the Internet of Things (IoT). https://www.qualcomm.com/products/qca4531 Signed-off-by: Oleksij Rempel <linux@rempel-privat.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* MIPS: add support for DPTechnics DPT-Module v1Oleksij Rempel2018-01-051-0/+8
| | | | | | | | This product can be found here: https://dptechnics.com/en/products/dpt-module-v1.html Signed-off-by: Oleksij Rempel <linux@rempel-privat.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* MIPS: ath79: ar9331: add ar9331_pbl_generic_start macroOleksij Rempel2018-01-051-0/+35
| | | | | | | | Most of ar9331 boards have identical PBL. So we can sync the code to single macro. Signed-off-by: Oleksij Rempel <linux@rempel-privat.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* MIPS: ath79: ar9331: add generic RAM macroOleksij Rempel2018-01-052-3/+35
| | | | | | | | with this macro, we should be able to cover most of existing ar9331 based boards. Signed-off-by: Oleksij Rempel <linux@rempel-privat.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: ath79: add ag71xx Ethernet driverYegor Yefremov2017-09-181-0/+12
| | | | | | | Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com> Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Oleksij Rempel <linux@rempel-privat.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* MIPS: ath79: add TP-Link WDR4300 board supportOleksij Rempel2017-08-151-0/+10
| | | | | | | | | This provides low level initialization of pll and ddr2. Resulting binary should work from SRAM, DDR2 and SPI flash. If started from DDR2 RAM level initialization will skipped. Signed-off-by: Oleksij Rempel <linux@rempel-privat.de> Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
* MIPS: ath79: add initial QCA AR9344 SoC supportOleksij Rempel2017-08-155-158/+925
| | | | | | | | | | | | | | | | | | | | | According to the documentation: "The AR9344 is a highly integrated and feature-rich IEEE 802.11n 2x2 2.4/5 GHz System-on-a-Chip (SoC) for advanced WLAN platforms. It includes a MIPS 74Kc processor, PCI Express 1.1 Root Complex and Endpoint interfaces, five port IEEE 802.3 Fast Ethernet Switch with MAC/PHY, one MII/RMII/RGMII interface, one USB 2.0 MAC/PHY, and external memory interface for serial Flash, SDRAM, DDR1 or DDR2, I2S/SPDIF-Out audio interface, SLIC VOIP/PCM interface, two UARTs, and GPIOs that can be used for LED controls or other general purpose interface configurations. The AR9344 supports 802.11n operations up to 144 Mbps for 20 MHz and 300 Mbps for 40 MHz respectively, and 802.11a/b/g data rates. Additional features include Maximal Likelihood (ML) decoding, Low-Density Parity Check (LDPC), Maximal Ratio Combining (MRC), Tx Beamforming (TxBF), and On-Chip One-Time Programmable (OTP) memory." Signed-off-by: Oleksij Rempel <linux@rempel-privat.de> Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
* MIPS: ath79: provide CONFIG_SOC_QCA_AR9331 optionOleksij Rempel2017-08-151-0/+5
| | | | | | | | QCA AR9331 and QCA AR9344 have some similar part but different uart engines. We need this flag to provide common debug_ll support. Signed-off-by: Oleksij Rempel <linux@rempel-privat.de> Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
* MIPS: ath79: add barebox update handlerOleksij Rempel2017-08-152-0/+29
| | | | | | | | Most of ar93xx SoCs seem to work only with spi. spifash handler should be enough for now. Signed-off-by: Oleksij Rempel <linux@rempel-privat.de> Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
* MIPS: drop redundant debug_ll_outhexw macro definesAntony Pavlov2017-01-101-32/+0
| | | | | | | | | | | | The debug_ll_outhexw macro has no dependency on UART model so we can remove it from UART-dependent header files (debug_ll_ns16550.h and mach-ath79/.../debug_ll.h). On the other hand the only debug_ll_outhexw user is MIPS nmon monitor so we can move the debug_ll_outhexw macro to pbl_nmon.h. Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* MIPS: ath79: pbl: add pbl_ar9331_wmac_enable macroYegor Yefremov2016-06-282-0/+77
| | | | | | | | | | AR9331's WMAC module requires triple WMAC reset as also working RTC subsystem. The code is taken as is from upstream U-Boot repository. Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* MIPS: ath79: pbl: add pbl_ar9331_mdio_gpio_enable macroAntony Pavlov2016-03-091-0/+8
| | | | | Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* MIPS: ath79: pbl: import hornet_1_1_war routine from U-Boot_modAntony Pavlov2016-02-261-0/+43
| | | | | | | | | | | | | | | | U-Boot_mod is a popular bootloader for Atheros AR93xx chips, please see https://github.com/pepe2k/u-boot_mod for details. It's reasonable to import some lowlevel AR9331 initialization code from U-Boot_mod. AR9331 (Hornet) 1.1 currently needs an additional reset at 1st boot. This patch imports necessary code from u-boot_mod/u-boot/cpu/mips/start_bootstrap.S. Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Reviewed-by: Yegor Yefremov <yegorslists@googlemail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* MIPS: ath79: pbl: import AR9331 CP0 init routine from U-Boot_modAntony Pavlov2016-02-261-0/+44
| | | | | | | | | | | | | | | U-Boot_mod is a popular bootloader for Atheros AR93xx chips, please see https://github.com/pepe2k/u-boot_mod for details. It's reasonable to import some lowlevel AR9331 initialization code from U-Boot_mod. This patch imports AR9331 MIPS24K coprocessor0 initialization code from u-boot_mod/u-boot/cpu/mips/start_bootstrap.S. Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Reviewed-by: Yegor Yefremov <yegorslists@googlemail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* MIPS: ath79: add pbl_ar9331_ddr1_config macroAntony Pavlov2015-11-031-0/+43
| | | | | | | | | | | | | | | | See also u-boot_mod/u-boot/cpu/mips/ar7240/hornet_ddr_init.S See also this openocd commit: commit f59d2d9ecfee8899df531b87b7acaa468725f238 Author: Oleksij Rempel <linux@rempel-privat.de> Date: Fri Jan 30 13:05:31 2015 +0100 tcl/target|board: add config Atheros ar9331 Signed-off-by: Oleksij Rempel <linux@rempel-privat.de> Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* MIPS: ath79: add black-swift board supportAntony Pavlov2015-11-031-0/+6
| | | | | | | | | | | Black Swift is a tiny coin-sized embedded computer based on AR9331 SoC. See http://www.black-swift.com/ for details. See also Black Swift kickstarter page: https://www.kickstarter.com/projects/1133560316/black-swift-tiny-wireless-computer Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* MIPS: ath79: add debug_ll_ar9331_init macroAntony Pavlov2015-11-031-0/+29
| | | | | Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* MIPS: ath79: add pbl_ar9331_uart_enable macroAntony Pavlov2015-11-032-0/+10
| | | | | | Signed-off-by: Oleksij Rempel <linux@rempel-privat.de> Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* MIPS: ath79: add pbl_ar9331_ddr2_config macroAntony Pavlov2015-11-032-0/+109
| | | | | | | | See also u-boot_mod/u-boot/cpu/mips/ar7240/hornet_ddr_init.S Signed-off-by: Oleksij Rempel <linux@rempel-privat.de> Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* MIPS: ath79: add pbl_ar9331_pll macroOleksij Rempel2015-11-032-0/+44
| | | | | | Signed-off-by: Oleksij Rempel <linux@rempel-privat.de> Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* gpio: add ath79-gpio driver for Atheros MIPS SoCsAntony Pavlov2015-09-231-0/+17
| | | | | | | This driver is based on linux-4.2 driver. Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* MIPS: mach-ath79: make ar71xx_regs.h assembler-tolerantAntony Pavlov2015-09-212-4/+5
| | | | | Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* restart: replace reset_cpu with registered restart handlersSascha Hauer2015-08-271-3/+12
| | | | | | | | | | | | | | | | | | | | | | This replaces the reset_cpu() function which every SoC or board must provide with registered handlers. This makes it possible to have multiple reset functions for boards which have multiple ways to reset the machine. Also boards which have no way at all to reset the machine no longer have to provide a dummy reset_cpu() function. The problem this solves is that some machines have external PMICs or similar to reset the system which have to be preferred over the internal SoC reset, because the PMIC can reset not only the SoC but also the external devices. To pick the right way to reset a machine each handler has a priority. The default priority is 100 and all currently existing restart handlers are registered with this priority. of_get_restart_priority() allows to retrieve the priority from the device tree which makes it possible for boards to give certain restart handlers a higher priority in order to use this one instead of the default one. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Abolish cpu_read* and cpu_write* accessorsMasahiro Yamada2015-05-201-2/+2
| | | | | | | | | | | | | | Commit 2e6a88f2101d (add cpu native ordered io accessors) introduced these macros and then commit be57f20cdd7d (Fix big endian MMIO primitives) figured out they are equivalent to __raw_{read,write}*. They turned out unnecessary after all. Anyway, most source files use __raw_read* and __raw_write*. Let's replace a few remaining references and abolish them. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* MIPS: tplink-mr3020: enable nmonAntony Pavlov2015-05-051-0/+1
| | | | | Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* MIPS: mach-ath79: debug_ll.h: add assembler routinesAntony Pavlov2015-05-051-5/+131
| | | | | Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* MIPS: tplink-mr3020: enable PBL and compressionOleksij Rempel2015-05-051-0/+2
| | | | | | Signed-off-by: Oleksij Rempel <linux@rempel-privat.de> Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* MIPS: ath79: add tplink-mr3020 board supportAntony Pavlov2014-03-281-0/+8
| | | | | | | | | | | | | | | | This board support code can be used for TP-LINK WR703 too. TP-LINK WR703 is very similar to TP-LINK MR3020, there are some non-essential differences: * WR703 is smaller and cheaper; * WR703 has only one led, but MR3020 has five leds; * MR3020 uses mini-USB connector, WR703 uses micro-USB connector. See https://forum.openwrt.org/viewtopic.php?id=45159 for details. Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* MIPS: ath79: add DEBUG_LL support for Atheros AR933xAntony Pavlov2014-03-281-0/+56
| | | | | Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* MIPS: add Atheros ar933x family supportDu Huanpeng2014-03-285-0/+137
Use the mach-ath79 name for compatibility with linux kernel. Signed-off-by: Du Huanpeng <u74147@gmail.com> Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Oleksij Rempel <linux@rempel-privat.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>