2022-06-07 17:11:14 +03:00
// SPDX-License-Identifier: GPL-2.0-only
[ARM] add Marvell 78xx0 ARM SoC support
The Marvell Discovery Duo (MV78xx0) is a family of ARM SoCs featuring
(depending on the model) one or two Feroceon CPU cores with 512K of L2
cache and VFP coprocessors running at (depending on the model) between
800 MHz and 1.2 GHz, and features a DDR2 controller, two PCIe
interfaces that can each run either in x4 or quad x1 mode, three USB
2.0 interfaces, two 3Gb/s SATA II interfaces, a SPI interface, two
TWSI interfaces, a crypto accelerator, IDMA/XOR engines, a SPI
interface, four UARTs, and depending on the model, two or four gigabit
ethernet interfaces.
This patch adds basic support for the platform, and allows booting
on the MV78x00 development board, with functional UARTs, SATA, PCIe,
GigE and USB ports.
Signed-off-by: Stanislav Samsonov <samsonov@marvell.com>
Signed-off-by: Lennert Buytenhek <buytenh@marvell.com>
2008-06-23 00:45:10 +04:00
/*
* arch / arm / mach - mv78xx0 / irq . c
*
* MV78xx0 IRQ handling .
*/
2011-07-26 13:53:52 +04:00
# include <linux/gpio.h>
[ARM] add Marvell 78xx0 ARM SoC support
The Marvell Discovery Duo (MV78xx0) is a family of ARM SoCs featuring
(depending on the model) one or two Feroceon CPU cores with 512K of L2
cache and VFP coprocessors running at (depending on the model) between
800 MHz and 1.2 GHz, and features a DDR2 controller, two PCIe
interfaces that can each run either in x4 or quad x1 mode, three USB
2.0 interfaces, two 3Gb/s SATA II interfaces, a SPI interface, two
TWSI interfaces, a crypto accelerator, IDMA/XOR engines, a SPI
interface, four UARTs, and depending on the model, two or four gigabit
ethernet interfaces.
This patch adds basic support for the platform, and allows booting
on the MV78x00 development board, with functional UARTs, SATA, PCIe,
GigE and USB ports.
Signed-off-by: Stanislav Samsonov <samsonov@marvell.com>
Signed-off-by: Lennert Buytenhek <buytenh@marvell.com>
2008-06-23 00:45:10 +04:00
# include <linux/kernel.h>
2008-10-20 03:51:04 +04:00
# include <linux/irq.h>
2012-09-11 16:27:20 +04:00
# include <linux/io.h>
2015-12-03 00:27:04 +03:00
# include <asm/exception.h>
2012-08-29 19:16:55 +04:00
# include <plat/orion-gpio.h>
2008-08-09 15:44:58 +04:00
# include <plat/irq.h>
2015-12-03 00:27:06 +03:00
# include "bridge-regs.h"
[ARM] add Marvell 78xx0 ARM SoC support
The Marvell Discovery Duo (MV78xx0) is a family of ARM SoCs featuring
(depending on the model) one or two Feroceon CPU cores with 512K of L2
cache and VFP coprocessors running at (depending on the model) between
800 MHz and 1.2 GHz, and features a DDR2 controller, two PCIe
interfaces that can each run either in x4 or quad x1 mode, three USB
2.0 interfaces, two 3Gb/s SATA II interfaces, a SPI interface, two
TWSI interfaces, a crypto accelerator, IDMA/XOR engines, a SPI
interface, four UARTs, and depending on the model, two or four gigabit
ethernet interfaces.
This patch adds basic support for the platform, and allows booting
on the MV78x00 development board, with functional UARTs, SATA, PCIe,
GigE and USB ports.
Signed-off-by: Stanislav Samsonov <samsonov@marvell.com>
Signed-off-by: Lennert Buytenhek <buytenh@marvell.com>
2008-06-23 00:45:10 +04:00
# include "common.h"
2012-06-27 15:40:04 +04:00
static int __initdata gpio0_irqs [ 4 ] = {
IRQ_MV78XX0_GPIO_0_7 ,
IRQ_MV78XX0_GPIO_8_15 ,
IRQ_MV78XX0_GPIO_16_23 ,
IRQ_MV78XX0_GPIO_24_31 ,
} ;
2008-10-20 03:51:04 +04:00
2015-12-03 00:27:04 +03:00
static void __iomem * mv78xx0_irq_base = IRQ_VIRT_BASE ;
static asmlinkage void
__exception_irq_entry mv78xx0_legacy_handle_irq ( struct pt_regs * regs )
{
u32 stat ;
stat = readl_relaxed ( mv78xx0_irq_base + IRQ_CAUSE_LOW_OFF ) ;
stat & = readl_relaxed ( mv78xx0_irq_base + IRQ_MASK_LOW_OFF ) ;
if ( stat ) {
unsigned int hwirq = __fls ( stat ) ;
handle_IRQ ( hwirq , regs ) ;
return ;
}
stat = readl_relaxed ( mv78xx0_irq_base + IRQ_CAUSE_HIGH_OFF ) ;
stat & = readl_relaxed ( mv78xx0_irq_base + IRQ_MASK_HIGH_OFF ) ;
if ( stat ) {
unsigned int hwirq = 32 + __fls ( stat ) ;
handle_IRQ ( hwirq , regs ) ;
return ;
}
stat = readl_relaxed ( mv78xx0_irq_base + IRQ_CAUSE_ERR_OFF ) ;
stat & = readl_relaxed ( mv78xx0_irq_base + IRQ_MASK_ERR_OFF ) ;
if ( stat ) {
unsigned int hwirq = 64 + __fls ( stat ) ;
handle_IRQ ( hwirq , regs ) ;
return ;
}
}
[ARM] add Marvell 78xx0 ARM SoC support
The Marvell Discovery Duo (MV78xx0) is a family of ARM SoCs featuring
(depending on the model) one or two Feroceon CPU cores with 512K of L2
cache and VFP coprocessors running at (depending on the model) between
800 MHz and 1.2 GHz, and features a DDR2 controller, two PCIe
interfaces that can each run either in x4 or quad x1 mode, three USB
2.0 interfaces, two 3Gb/s SATA II interfaces, a SPI interface, two
TWSI interfaces, a crypto accelerator, IDMA/XOR engines, a SPI
interface, four UARTs, and depending on the model, two or four gigabit
ethernet interfaces.
This patch adds basic support for the platform, and allows booting
on the MV78x00 development board, with functional UARTs, SATA, PCIe,
GigE and USB ports.
Signed-off-by: Stanislav Samsonov <samsonov@marvell.com>
Signed-off-by: Lennert Buytenhek <buytenh@marvell.com>
2008-06-23 00:45:10 +04:00
void __init mv78xx0_init_irq ( void )
{
2012-09-11 16:27:20 +04:00
orion_irq_init ( 0 , IRQ_VIRT_BASE + IRQ_MASK_LOW_OFF ) ;
orion_irq_init ( 32 , IRQ_VIRT_BASE + IRQ_MASK_HIGH_OFF ) ;
orion_irq_init ( 64 , IRQ_VIRT_BASE + IRQ_MASK_ERR_OFF ) ;
2008-10-20 03:51:04 +04:00
2015-12-03 00:27:04 +03:00
set_handle_irq ( mv78xx0_legacy_handle_irq ) ;
2008-10-20 03:51:04 +04:00
/*
2010-12-14 14:54:03 +03:00
* Initialize gpiolib for GPIOs 0 - 31. ( The GPIO interrupt mask
* registers for core # 1 are at an offset of 0x18 from those of
* core # 0. )
2008-10-20 03:51:04 +04:00
*/
2021-12-14 17:06:56 +03:00
orion_gpio_init ( 0 , 32 , GPIO_VIRT_BASE , mv78xx0_core_index ( ) ? 0x18 : 0 ,
2012-06-27 15:40:04 +04:00
IRQ_MV78XX0_GPIO_START , gpio0_irqs ) ;
[ARM] add Marvell 78xx0 ARM SoC support
The Marvell Discovery Duo (MV78xx0) is a family of ARM SoCs featuring
(depending on the model) one or two Feroceon CPU cores with 512K of L2
cache and VFP coprocessors running at (depending on the model) between
800 MHz and 1.2 GHz, and features a DDR2 controller, two PCIe
interfaces that can each run either in x4 or quad x1 mode, three USB
2.0 interfaces, two 3Gb/s SATA II interfaces, a SPI interface, two
TWSI interfaces, a crypto accelerator, IDMA/XOR engines, a SPI
interface, four UARTs, and depending on the model, two or four gigabit
ethernet interfaces.
This patch adds basic support for the platform, and allows booting
on the MV78x00 development board, with functional UARTs, SATA, PCIe,
GigE and USB ports.
Signed-off-by: Stanislav Samsonov <samsonov@marvell.com>
Signed-off-by: Lennert Buytenhek <buytenh@marvell.com>
2008-06-23 00:45:10 +04:00
}