summaryrefslogtreecommitdiffstats
path: root/drivers/bcma/driver_mips.c
Commit message (Collapse)AuthorAgeFilesLines
* bcma: fix buffer size caused crash in bcma_core_mips_print_irq()Rafał Miłecki2018-05-121-1/+1
| | | | | | | | | | | | | | | Used buffer wasn't big enough to hold whole strings. Example output of this function is: [ 0.180892] bcma: bus0: core 0x0800, irq: 2(S)* 3 4 5 6 D I [ 0.180948] bcma: bus0: core 0x0812, irq: 2(S) 3* 4 5 6 D I [ 0.180998] bcma: bus0: core 0x082d, irq: 2(S) 3 4* 5 6 D I [ 0.181046] bcma: bus0: core 0x082c, irq: 2(S) 3 4 5 6 D I* which means we need to store up to 24 chars. Fixes: 758f7e06063a8 ("bcma: Use bcma_debug and not pr_cont in MIPS driver") Signed-off-by: Rafał Miłecki <rafal@milecki.pl> Cc: stable@vger.kernel.org # v4.15+ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* bcma: Use bcma_debug and not pr_cont in MIPS driverJoe Perches2017-10-271-4/+7
| | | | | | | | | | | | | | | Commit 66cc04424960 ("bcma: use bcma_debug and pr_cont in MIPS driver") converted a printk(KERN_DEBUG to bcma_debug. bcma_debug is guarded by a #define DEBUG via pr_debug. This means that the bcma_debug will generally not be emitted but any pr_cont following the bcma_debug will be emitted. Correct this by removing the uses of pr_cont by using a temporary. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* bcma: use bcma_debug and pr_cont in MIPS driverRafał Miłecki2017-10-171-3/+4
| | | | | | | | | Using bcma_debug gives a device-specific prefix for messages and pr_cont is a common helper for continuing a line. Signed-off-by: Rafał Miłecki <rafal@milecki.pl> Acked-By: Hauke Mehrtens <hauke@hauke-m.de> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* Revert "bcma: init serial console directly from ChipCommon code"Rafał Miłecki2017-01-171-0/+3
| | | | | | | | | | | | | | | | This reverts commit 4c81acab3816 ("bcma: init serial console directly from ChipCommon code") as it broke IRQ assignment. Getting IRQ with bcma_core_irq helper on SoC requires MIPS core to be set. It happens *after* ChipCommon initialization so we can't do this so early. This fixes a user reported regression. It wasn't critical as serial was still somehow working but lack of IRQs was making in unreliable. Fixes: 4c81acab3816 ("bcma: init serial console directly from ChipCommon code") Reported-by: Felix Fietkau <nbd@nbd.name> Cc: stable@vger.kernel.org # 4.6+ Signed-off-by: Rafał Miłecki <rafal@milecki.pl> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* bcma: move flash detection code to ChipCommon core driverRafał Miłecki2016-03-071-25/+2Star
| | | | | | | | | | Flashes are attached and accessible through ChipCommon core, they aren't connected to MIPS one. Moreover some new ARM devices (e.g. BCM47189) may have serial flash accessibility using ChipCommon registers as well. To support them we can't keep this code in MIPS core driver. Signed-off-by: Rafał Miłecki <zajec5@gmail.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* bcma: move parallel flash support to separated fileRafał Miłecki2016-03-071-34/+1Star
| | | | | | | | | | | This follows the way of handling other flashes and cleans code a bit. As next task we will want to move flash code to ChipCommon driver as: 1) Flash controllers are accesible using ChipCommon registers 2) This code isn't MIPS specific This change prepares bcma for that. Signed-off-by: Rafał Miłecki <zajec5@gmail.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* bcma: drop unneeded fields from bcma_pflash structRafał Miłecki2016-03-071-7/+4Star
| | | | | | | | Most of info stored in this struct wasn't really used anywhere as we put all that data in platform data & resource as well. Signed-off-by: Rafał Miłecki <zajec5@gmail.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* bcma: init serial console directly from ChipCommon codeRafał Miłecki2016-02-061-3/+0Star
| | | | | | | | | | | UART is connected to and controlled over ChipCommon core. It doesn't have much to do with MIPS core (where we initialize it currently) except just existing on embedded systemms. There isn't point of such cross-core initialization (and we needed #ifdef anyway) so just handle it in ChipCommon. Signed-off-by: Rafał Miłecki <zajec5@gmail.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* MIPS: BCM47xx: Move NVRAM header to the include/linux/.Rafał Miłecki2015-04-011-1/+1
| | | | | | | | | | | | | | | | | | There are two reasons for having this header in the common place: 1) Simplifying drivers that read NVRAM entries. We will be able to safely call bcm47xx_nvram_* functions without #ifdef-s. 2) Getting NVRAM driver out of MIPS arch code. This is needed to support BCM5301X arch which also requires this NVRAM driver. Patch for that will follow once we get is reviewed. Signed-off-by: Rafał Miłecki <zajec5@gmail.com> Acked-by: Hauke Mehrtens <hauke@hauke-m.de> Cc: linux-mips@linux-mips.org Cc: Arnd Bergmann <arnd@arndb.de> Cc: Paul Walmsley <paul@pwsan.com> Cc: linux-soc@vger.kernel.org Patchwork: https://patchwork.linux-mips.org/patch/8619/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
* Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linusLinus Torvalds2014-12-121-2/+11
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Pull MIPS updates from Ralf Baechle: "This is an unusually large pull request for MIPS - in parts because lots of patches missed the 3.18 deadline but primarily because some folks opened the flood gates. - Retire the MIPS-specific phys_t with the generic phys_addr_t. - Improvments for the backtrace code used by oprofile. - Better backtraces on SMP systems. - Cleanups for the Octeon platform code. - Cleanups and fixes for the Loongson platform code. - Cleanups and fixes to the firmware library. - Switch ATH79 platform to use the firmware library. - Grand overhault to the SEAD3 and Malta interrupt code. - Move the GIC interrupt code to drivers/irqchip - Lots of GIC cleanups and updates to the GIC code to use modern IRQ infrastructures and features of the kernel. - OF documentation updates for the GIC bindings - Move GIC clocksource driver to drivers/clocksource - Merge GIC clocksource driver with clockevent driver. - Further updates to bring the GIC clocksource driver up to date. - R3000 TLB code cleanups - Improvments to the Loongson 3 platform code. - Convert pr_warning to pr_warn. - Merge a bunch of small lantiq and ralink fixes that have been staged/lingering inside the openwrt tree for a while. - Update archhelp for IP22/IP32 - Fix a number of issues for Loongson 1B. - New clocksource and clockevent driver for Loongson 1B. - Further work on clk handling for Loongson 1B. - Platform work for Broadcom BMIPS. - Error handling cleanups for TurboChannel. - Fixes and optimization to the microMIPS support. - Option to disable the FTLB. - Dump more relevant information on machine check exception - Change binfmt to allow arch to examine PT_*PROC headers - Support for new style FPU register model in O32 - VDSO randomization. - BCM47xx cleanups - BCM47xx reimplement the way the kernel accesses NVRAM information. - Random cleanups - Add support for ATH25 platforms - Remove pointless locking code in some PCI platforms. - Some improvments to EVA support - Minor Alchemy cleanup" * 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus: (185 commits) MIPS: Add MFHC0 and MTHC0 instructions to uasm. MIPS: Cosmetic cleanups of page table headers. MIPS: Add CP0 macros for extended EntryLo registers MIPS: Remove now unused definition of phys_t. MIPS: Replace use of phys_t with phys_addr_t. MIPS: Replace MIPS-specific 64BIT_PHYS_ADDR with generic PHYS_ADDR_T_64BIT PCMCIA: Alchemy Don't select 64BIT_PHYS_ADDR in Kconfig. MIPS: lib: memset: Clean up some MIPS{EL,EB} ifdefery MIPS: iomap: Use __mem_{read,write}{b,w,l} for MMIO MIPS: <asm/types.h> fix indentation. MAINTAINERS: Add entry for BMIPS multiplatform kernel MIPS: Enable VDSO randomization MIPS: Remove a temporary hack for debugging cache flushes in SMTC configuration MIPS: Remove declaration of obsolete arch_init_clk_ops() MIPS: atomic.h: Reformat to fit in 79 columns MIPS: Apply `.insn' to fixup labels throughout MIPS: Fix microMIPS LL/SC immediate offsets MIPS: Kconfig: Only allow 32-bit microMIPS builds MIPS: signal.c: Fix an invalid cast in ISA mode bit handling MIPS: mm: Only build one microassembler that is suitable ...
| * MIPS: BCM47XX: Make bcma init NVRAM instead of bcm47xx polling itRafał Miłecki2014-11-241-2/+11
| | | | | | | | | | | | | | | | | | | | | | This drops ssb/bcma dependency and will allow us to make it a standalone driver. Signed-off-by: Rafał Miłecki <zajec5@gmail.com> Cc: linux-mips@linux-mips.org Cc: Hauke Mehrtens <hauke@hauke-m.de> Patchwork: https://patchwork.linux-mips.org/patch/8233/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
* | bcma: make it possible to specify a IRQ num in bcma_core_irq()Hauke Mehrtens2014-11-111-9/+2Star
|/ | | | | | | | | This moves bcma_core_irq() to main.c and add a extra parameter with a number so that we can return different irq number for devices with more than one. Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* bcma: get info about flash type SoC booted fromRafał Miłecki2014-09-041-0/+62
| | | | | | | | | There is an ongoing work on cleaning MIPS's nvram support so it could be re-used on other platforms (bcm53xx to say precisely). This will require a bit of extra logic in bcma this patch implements. Signed-off-by: Rafał Miłecki <zajec5@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* bcma_mips: add a const qualifierArtem Bityutskiy2013-04-051-1/+1
| | | | | | | | Be a bit stricter and add few more 'const' qualifiers. Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Cc: "Rafał Miłecki" <zajec5@gmail.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
* bcma: register platform device for parallel flashRafał Miłecki2013-01-301-5/+33
| | | | Signed-off-by: John W. Linville <linville@tuxdriver.com>
* bcma: fix bcm4716/bcm4748 i2s irqflagNathan Hintz2013-01-141-0/+28
| | | | | | | | | | The default irqflag assignment for the I2S core on some Broadcom 4716/4748 devices is invalid and needs to be corrected (from the Broadcom SDK). Signed-off-by: Nathan Hintz <nlhintz@hotmail.com> Acked-by: Hauke Mehrtens <hauke@hauke-m.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* bcma: return the mips irq number in bcma_core_irqNathan Hintz2013-01-111-3/+9
| | | | | | | | | | The irq signal numbers that are send by the cpu are increased by 2 from the number programmed into the mips core by bcma. Return the irq number on which the irqs are send in bcma_core_irq() now. Signed-off-by: Nathan Hintz <nlhintz@hotmail.com> Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* bcma: fix compile errorHauke Mehrtens2013-01-111-1/+1
| | | | | | | | | | | | | | | | | | | | This error was introduced in: commit e3f05a42faac627d8704c76c1927e09b22443b7b Author: Hauke Mehrtens <hauke@hauke-m.de> Date: Fri Jan 4 00:51:21 2013 +0100 bcma: mips: explicit assign IRQ numbers CC drivers/bcma/driver_mips.o drivers/bcma/driver_mips.c: In function 'bcma_core_mips_init': drivers/bcma/driver_mips.c:302:4: error: implicit declaration of function 'bcma_core_irq' [-Werror=implicit-function-declaration] cc1: some warnings being treated as errors make[6]: *** [drivers/bcma/driver_mips.o] Error 1 Reported-by: Rafał Miłecki <zajec5@gmail.com> Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* bcma: mips: rename oldirqflag to irqinitmaskHauke Mehrtens2013-01-071-4/+4
| | | | | | | The new name better matches the use of this variable. Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* bcma: mips: remove assigned_irqs from structureHauke Mehrtens2013-01-071-2/+0Star
| | | | | | | This member is not needed any more. Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* bcma: mips: show also disabled IRQsHauke Mehrtens2013-01-071-5/+12
| | | | | | | | | Some cores do not have a IRQ assigned and some do not support when an IRQ is assigned to them, this is now handled and printed out in the code. Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* bcma: mips: make some info messages debug messagesHauke Mehrtens2013-01-071-5/+5
| | | | | Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* bcma: mips: explicit assign IRQ numbersHauke Mehrtens2013-01-071-28/+56
| | | | | | | | | | | | The assignment of the IRQs to the cores of the chips by iterating over the cores is complicated and causes problems with SoC like the BCM4706 with two GMAC core where just one should get a dedicated IRQ number. Now the code assigns the same IRQs to the cores as the code from the Broadcom SDK does. If the SoC is not know the current assigned IRQs are only read out and an error message is printed. Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* bcma: mips: fix clearing device IRQRafał Miłecki2012-12-101-1/+1
| | | | | | | | | | | | We were using wrong IRQ number so clearing wasn't working at all. Depending on a platform this could result in a one device having two interrupts assigned. On BCM4706 this resulted in all IRQs being broken. Cc: Hauke Mehrtens <hauke@hauke-m.de> Cc: stable@vger.kernel.org Signed-off-by: Rafał Miłecki <zajec5@gmail.com> Acked-by: Hauke Mehrtens <hauke@hauke-m.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* bcma: unify naming schema for clock functionsRafał Miłecki2012-12-101-1/+1
| | | | Signed-off-by: John W. Linville <linville@tuxdriver.com>
* bcma: extract drv_cc in bcma_core_mips_flash_detect()Hauke Mehrtens2012-10-191-11/+12
| | | | | | | This makes the code more readable Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* bcma: add and use constants for the flash windowsHauke Mehrtens2012-10-191-2/+2
| | | | | Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* bcma: mark pflash as present when availableHauke Mehrtens2012-10-191-0/+1
| | | | | Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* bcma: just do the necessary things in early register on SoCsHauke Mehrtens2012-10-191-7/+19
| | | | | | | | | | | | Some parts of the initialization for chip common and the pcie core are accessing the sprom struct, but it is not initialized at that stage. Just do the necessary thing in the early register on SoCs and not the complete initialization to read out the nvram from the flash chip. After it is possible to read out the nvram, the sprom should be parsed from it and the full initialization of the cores should be run. Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* bcma: fix regression in interrupt assignment on mipsHauke Mehrtens2012-07-261-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | The wrong interrupts where assigned to the cores in bcma_core_mips_init(). This caused at least my serial console not to response to any input. This was caused by this patch which changed the order of the cores in the list: commit c334e25c9f3a95f2bd6b79fedc5170f17245b1c7 Author: Rafał Miłecki <zajec5@gmail.com> Date: Wed Jul 11 12:37:00 2012 +0200 bcma: add new cores at the end of list This should be fixed properly later so that the correct interrupt numbers are assigned to the cores independently from the ordering of the list. This patch restores the old behavior again. I will look into the problem more deeply later. I also changed the order of the list with the cores and their assigned interrupt number which gets printed to the log. Now they are printed in the same order like all the other lists of cores and like it was done before the patch which changed the order. Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* bcma: add place for flash memory supportRafał Miłecki2012-07-171-3/+12
| | | | | Signed-off-by: Rafał Miłecki <zajec5@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* bcma: use custom printing functionsRafał Miłecki2012-07-091-8/+8
| | | | | | | | | Having bus number printed makes it much easier to anaylze logs on systems with more buses. For example Netgear WNDR4500 has 3 AMBA buses in total, which makes standard log really messy. Signed-off-by: Rafał Miłecki <zajec5@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* bcma: add constants for chip idsHauke Mehrtens2012-07-091-4/+4
| | | | | | | | | The chip IDs are used all over bcma and no constants where defined. This patch adds the constants and makes bcma use them. Acked-by: Arend van Spriel <arend@broadcom.com> Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* bcma: get CPU clockHauke Mehrtens2011-08-081-0/+12
| | | | | | | | | Add method to return the clock of the CPU. This is needed by the arch code to calculate the mips_hpt_frequency. Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> Acked-by: Ralf Baechle <ralf@linux-mips.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* bcma: add serial console supportHauke Mehrtens2011-08-081-0/+1
| | | | | | | | This adds support for serial console to bcma, when operating on an SoC. Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> Acked-by: Ralf Baechle <ralf@linux-mips.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* bcma: add mips driverHauke Mehrtens2011-08-081-0/+243
This adds a mips driver to bcma. This is only found on embedded devices. For now the driver just initializes the irqs used on this system. Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> Acked-by: Ralf Baechle <ralf@linux-mips.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>