summaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-aspeed/include/mach
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-aspeed/include/mach')
-rw-r--r--arch/arm/mach-aspeed/include/mach/aspeed_serial.h61
-rw-r--r--arch/arm/mach-aspeed/include/mach/ast-uart-dma.h86
-rw-r--r--arch/arm/mach-aspeed/include/mach/ast1070_irqs.h142
-rw-r--r--arch/arm/mach-aspeed/include/mach/ast1070_platform.h100
-rw-r--r--arch/arm/mach-aspeed/include/mach/ast1520_irqs.h107
-rw-r--r--arch/arm/mach-aspeed/include/mach/ast1520_platform.h61
-rw-r--r--arch/arm/mach-aspeed/include/mach/ast2000_irqs.h64
-rw-r--r--arch/arm/mach-aspeed/include/mach/ast2000_platform.h40
-rw-r--r--arch/arm/mach-aspeed/include/mach/ast2100_irqs.h64
-rw-r--r--arch/arm/mach-aspeed/include/mach/ast2100_platform.h57
-rw-r--r--arch/arm/mach-aspeed/include/mach/ast2200_irqs.h65
-rw-r--r--arch/arm/mach-aspeed/include/mach/ast2200_platform.h55
-rw-r--r--arch/arm/mach-aspeed/include/mach/ast2300_irqs.h92
-rw-r--r--arch/arm/mach-aspeed/include/mach/ast2300_platform.h72
-rw-r--r--arch/arm/mach-aspeed/include/mach/ast2400_irqs.h96
-rw-r--r--arch/arm/mach-aspeed/include/mach/ast2400_platform.h79
-rw-r--r--arch/arm/mach-aspeed/include/mach/ast_gpio_irqs.h276
-rw-r--r--arch/arm/mach-aspeed/include/mach/ast_kcs.h147
-rw-r--r--arch/arm/mach-aspeed/include/mach/ast_lcd.h61
-rw-r--r--arch/arm/mach-aspeed/include/mach/ast_lpc_irqs.h34
-rw-r--r--arch/arm/mach-aspeed/include/mach/ast_pwm_techo.h13
-rw-r--r--arch/arm/mach-aspeed/include/mach/ast_spi.h14
-rw-r--r--arch/arm/mach-aspeed/include/mach/ast_video.h89
-rw-r--r--arch/arm/mach-aspeed/include/mach/ast_wdt.h11
-rw-r--r--arch/arm/mach-aspeed/include/mach/debug-macro.S21
-rw-r--r--arch/arm/mach-aspeed/include/mach/dma.h25
-rw-r--r--arch/arm/mach-aspeed/include/mach/entry-macro.S191
-rw-r--r--arch/arm/mach-aspeed/include/mach/ftgmac100_drv.h18
-rw-r--r--arch/arm/mach-aspeed/include/mach/gpio.h352
-rw-r--r--arch/arm/mach-aspeed/include/mach/hardware.h51
-rw-r--r--arch/arm/mach-aspeed/include/mach/io.h28
-rw-r--r--arch/arm/mach-aspeed/include/mach/irqs.h61
-rw-r--r--arch/arm/mach-aspeed/include/mach/memory.h48
-rw-r--r--arch/arm/mach-aspeed/include/mach/platform.h89
-rw-r--r--arch/arm/mach-aspeed/include/mach/system.h44
-rw-r--r--arch/arm/mach-aspeed/include/mach/time.h73
-rw-r--r--arch/arm/mach-aspeed/include/mach/timex.h21
-rw-r--r--arch/arm/mach-aspeed/include/mach/uncompress.h38
-rw-r--r--arch/arm/mach-aspeed/include/mach/vmalloc.h29
39 files changed, 2975 insertions, 0 deletions
diff --git a/arch/arm/mach-aspeed/include/mach/aspeed_serial.h b/arch/arm/mach-aspeed/include/mach/aspeed_serial.h
new file mode 100644
index 0000000..33bf333
--- /dev/null
+++ b/arch/arm/mach-aspeed/include/mach/aspeed_serial.h
@@ -0,0 +1,61 @@
+/*
+ * file : aspeed_serial.h
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+#ifndef ASM_ARM_HARDWARE_AST_SERIAL_H
+#define ASM_ARM_HARDWARE_AST_SERIAL_H
+
+#define UART_RBR 0x00 /* Receiver Buffer Register */
+#define UART_THR 0x00 /* Transmit Holding Register */
+#define UART_DLL 0x00 /* Divisor Latch Low Register */
+#define UART_DLH 0x04 /* Divisor Latch High Register */
+#define UART_IER 0x04 /* Interrupt Enable Register */
+#define UART_IIR 0x08 /* Interrupt Identity Register */
+#define UART_FCR 0x08 /* FIFO Control Register */
+#define UART_LCR 0x0C /* Line Control Register */
+#define UART_MCR 0x10 /* Modem Control Register */
+#define UART_LSR 0x14 /* Line Status Register */
+#define UART_MSR 0x18 /* Modem Status Register */
+#define UART_SCR 0x1C /* Scratch Register */
+
+/* Interrupt Enable Register */
+#define UART_IER_EMSI 0x08 /* Enable Modem Status Interrupt */
+#define UART_IER_ELSI 0x04 /* Enable Line Status Interrupt */
+#define UART_IER_ETEI 0x02 /* Enable Transmit Holding Empty Interrupt */
+#define UART_IER_ERDI 0X01 /* Enable Received Data Interrupt */
+
+/* FIFO Control Register */
+#define UART_FCR_XMITR 0x04 /* XMIT FIFO Reset */
+#define UART_FCR_RCVRR 0x02 /* RCVR FIFO Reset */
+#define UART_FCR_FIFOE 0x01 /* FIEO Enable */
+
+/* Line Control Register */
+#define UART_LCR_DLAB 0x80 /* Divisor Latch Address Bit */
+#define UART_LCR_BRK 0x40 /* Break Control */
+#define UART_LCR_EPS 0x10 /* Even Parity Select */
+#define UART_LCR_PEN 0x08 /* Parity Enable */
+#define UART_LCR_STOP 0x04 /* Stop Bit */
+#define UART_LCR_WLEN_MASK 0x03 /* bits per character mask */
+#define UART_LCR_WLEN_8 0x03 /* 8 bits per character */
+#define UART_LCR_WLEN_7 0x02 /* 7 bits per character */
+#define UART_LCR_WLEN_6 0x01 /* 6 bits per character */
+#define UART_LCR_WLEN_5 0x00 /* 5 bits per character */
+
+/* Line Status Register */
+#define UART_LSR_TEMT 0x40 /* Transmitter Empty */
+#define UART_LSR_THRE 0x20 /* Transmitter Holding Register Empty */
+#define UART_LSR_BE 0x10 /* Break Error */
+#define UART_LSR_FE 0x08 /* Framing Error */
+#define UART_LSR_PE 0x04 /* Parity Error */
+#define UART_LSR_OE 0x02 /* Overrun Error */
+#define UART_LSR_DR 0x01 /* Data Ready */
+#define UART_LSR_ANY (UART_LSR_BE|UART_LSR_FE|UART_LSR_PE|UART_LSR_OE)
+
+#endif
diff --git a/arch/arm/mach-aspeed/include/mach/ast-uart-dma.h b/arch/arm/mach-aspeed/include/mach/ast-uart-dma.h
new file mode 100644
index 0000000..2ac2b41
--- /dev/null
+++ b/arch/arm/mach-aspeed/include/mach/ast-uart-dma.h
@@ -0,0 +1,86 @@
+/********************************************************************************
+* File Name : ast-uart-dma.h
+*
+* Copyright (C) 2012-2020 ASPEED Technology Inc.
+* This program is free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by the Free Software Foundation;
+* either version 2 of the License, or (at your option) any later version.
+* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
+* without even the implied warranty of MERCHANTABILITY or
+* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+********************************************************************************/
+#ifndef AST_UART_DMA_H_INCLUDED
+#define AST_UART_DMA_H_INCLUDED
+
+
+#define DMA_BUFF_SIZE 0x1000 //4096
+
+struct ast_uart_dma_data {
+ u8 chip_no; //campain chip number
+ u8 dma_ch; //dma channel number
+};
+
+
+/* enum ast_uart_chan_op
+ *
+ * operation codes passed to the DMA code by the user, and also used
+ * to inform the current channel owner of any changes to the system state
+*/
+
+enum ast_uart_chan_op {
+ AST_UART_DMAOP_TRIGGER,
+ AST_UART_DMAOP_STOP,
+};
+
+struct ast1070_dma_ch;
+
+/* ast_uart_dma_cbfn_t * * buffer callback routine type */
+typedef void (*ast_uart_dma_cbfn_t)(struct ast1070_dma_ch *,void *dev_id, u16 len);
+
+struct uart_dma_desc {
+ u32 desc0;
+ u32 desc1;
+ u32 desc2;
+ u32 desc3;
+} __attribute__ ((aligned(16)));
+
+struct ast1070_dma_ch {
+ u8 ch_no;
+ u8 direction;
+ u8 enable;
+ u32 ctrl_offset;
+ u32 desc_offset;
+ void *priv;
+ struct uart_dma_desc *desc;
+ dma_addr_t desc_dma_addr; /* Mapped descr. table */
+ /* cdriver callbacks */
+ ast_uart_dma_cbfn_t callback_fn; /* buffer done callback */
+};
+
+#define AST1070_UART_DMA_CH 4
+
+struct ast1070_dma {
+ void __iomem *reg_base;
+ struct ast1070_dma_ch dma_tx_ch[AST1070_UART_DMA_CH];
+ struct ast1070_dma_ch dma_rx_ch[AST1070_UART_DMA_CH];
+};
+
+
+/* ast_uart_dma_request * * request a dma channel exclusivley */
+extern int ast_uart_rx_dma_request(u8 node, u8 channel, ast_uart_dma_cbfn_t rtn, void *id);
+extern int ast_uart_tx_dma_request(u8 node, u8 channel, ast_uart_dma_cbfn_t rtn, void *id);
+
+/* ast_uart_dma_ctrl * * change the state of the dma channel */
+extern int ast_uart_rx_dma_ctrl(u8 node, u8 ch, enum ast_uart_chan_op op);
+extern int ast_uart_tx_dma_ctrl(u8 node, u8 ch, enum ast_uart_chan_op op);
+
+extern int ast_uart_rx_dma_enqueue(u8 node, u8 ch, dma_addr_t rx_buff, u16 len);
+extern int ast_uart_tx_dma_enqueue(u8 node, u8 ch, dma_addr_t tx_buff, u16 len);
+
+
+
+#endif
+
diff --git a/arch/arm/mach-aspeed/include/mach/ast1070_irqs.h b/arch/arm/mach-aspeed/include/mach/ast1070_irqs.h
new file mode 100644
index 0000000..0774417
--- /dev/null
+++ b/arch/arm/mach-aspeed/include/mach/ast1070_irqs.h
@@ -0,0 +1,142 @@
+/*
+ * arch/arm/plat-aspeed/include/plat/irqs.h
+ *
+ * Copyright (C) 2012-2020 ASPEED Technology Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef _AST1070_IRQS_H_
+#define _AST1070_IRQS_H_ 1
+
+#define IRQ_C0_VIC_CHAIN IRQ_EXT0
+#define IRQ_C0_VIC_CHAIN_START (AST_VIC_NUM)
+
+#define IRQ_C1_VIC_CHAIN IRQ_EXT1
+#define IRQ_C1_VIC_CHAIN_START (IRQ_C0_VIC_CHAIN_START + AST_CVIC_NUM)
+
+#define IRQ_C2_VIC_CHAIN IRQ_EXT2
+#define IRQ_C2_VIC_CHAIN_START (IRQ_C1_VIC_CHAIN_START + AST_CVIC_NUM)
+
+#define IRQ_C3_VIC_CHAIN IRQ_EXT3
+#define IRQ_C3_VIC_CHAIN_START (IRQ_C2_VIC_CHAIN_START + AST_CVIC_NUM)
+
+#define AST_CVIC_NUM 25
+
+#define IRQ_C0_N1_KCS (IRQ_C0_VIC_CHAIN_START + 0)
+#define IRQ_C0_N1_UART (IRQ_C0_VIC_CHAIN_START + 1)
+#define IRQ_C0_N1_MAILBOX (IRQ_C0_VIC_CHAIN_START + 2)
+#define IRQ_C0_N1_PORT80 (IRQ_C0_VIC_CHAIN_START + 3)
+#define IRQ_C0_N1_RESET (IRQ_C0_VIC_CHAIN_START + 4)
+#define IRQ_C0_N2_KCS (IRQ_C0_VIC_CHAIN_START + 5)
+#define IRQ_C0_N2_UART (IRQ_C0_VIC_CHAIN_START + 6)
+#define IRQ_C0_N2_MAILBOX (IRQ_C0_VIC_CHAIN_START + 7)
+#define IRQ_C0_N2_PORT80 (IRQ_C0_VIC_CHAIN_START + 8)
+#define IRQ_C0_N2_RESET (IRQ_C0_VIC_CHAIN_START + 9)
+#define IRQ_C0_N3_KCS (IRQ_C0_VIC_CHAIN_START + 10)
+#define IRQ_C0_N3_UART (IRQ_C0_VIC_CHAIN_START + 11)
+#define IRQ_C0_N3_MAILBOX (IRQ_C0_VIC_CHAIN_START + 12)
+#define IRQ_C0_N3_PORT80 (IRQ_C0_VIC_CHAIN_START + 13)
+#define IRQ_C0_N3_RESET (IRQ_C0_VIC_CHAIN_START + 14)
+#define IRQ_C0_N4_KCS (IRQ_C0_VIC_CHAIN_START + 15)
+#define IRQ_C0_N4_UART (IRQ_C0_VIC_CHAIN_START + 16)
+#define IRQ_C0_N4_MAILBOX (IRQ_C0_VIC_CHAIN_START + 17)
+#define IRQ_C0_N4_PORT80 (IRQ_C0_VIC_CHAIN_START + 18)
+#define IRQ_C0_N4_RESET (IRQ_C0_VIC_CHAIN_START + 19)
+#define IRQ_C0_N1_UART_DMA (IRQ_C0_VIC_CHAIN_START + 20)
+#define IRQ_C0_N2_UART_DMA (IRQ_C0_VIC_CHAIN_START + 21)
+#define IRQ_C0_N3_UART_DMA (IRQ_C0_VIC_CHAIN_START + 22)
+#define IRQ_C0_N4_UART_DMA (IRQ_C0_VIC_CHAIN_START + 23)
+#define IRQ_C0_I2C (IRQ_C0_VIC_CHAIN_START + 24)
+
+#define IRQ_C1_N1_KCS (IRQ_C1_VIC_CHAIN_START + 0)
+#define IRQ_C1_N1_UART (IRQ_C1_VIC_CHAIN_START + 1)
+#define IRQ_C1_N1_MAILBOX (IRQ_C1_VIC_CHAIN_START + 2)
+#define IRQ_C1_N1_PORT80 (IRQ_C1_VIC_CHAIN_START + 3)
+#define IRQ_C1_N1_RESET (IRQ_C1_VIC_CHAIN_START + 4)
+#define IRQ_C1_N2_KCS (IRQ_C1_VIC_CHAIN_START + 5)
+#define IRQ_C1_N2_UART (IRQ_C1_VIC_CHAIN_START + 6)
+#define IRQ_C1_N2_MAILBOX (IRQ_C1_VIC_CHAIN_START + 7)
+#define IRQ_C1_N2_PORT80 (IRQ_C1_VIC_CHAIN_START + 8)
+#define IRQ_C1_N2_RESET (IRQ_C1_VIC_CHAIN_START + 9)
+#define IRQ_C1_N3_KCS (IRQ_C1_VIC_CHAIN_START + 10)
+#define IRQ_C1_N3_UART (IRQ_C1_VIC_CHAIN_START + 11)
+#define IRQ_C1_N3_MAILBOX (IRQ_C1_VIC_CHAIN_START + 12)
+#define IRQ_C1_N3_PORT80 (IRQ_C1_VIC_CHAIN_START + 13)
+#define IRQ_C1_N3_RESET (IRQ_C1_VIC_CHAIN_START + 14)
+#define IRQ_C1_N4_KCS (IRQ_C1_VIC_CHAIN_START + 15)
+#define IRQ_C1_N4_UART (IRQ_C1_VIC_CHAIN_START + 16)
+#define IRQ_C1_N4_MAILBOX (IRQ_C1_VIC_CHAIN_START + 17)
+#define IRQ_C1_N4_PORT80 (IRQ_C1_VIC_CHAIN_START + 18)
+#define IRQ_C1_N4_RESET (IRQ_C1_VIC_CHAIN_START + 19)
+#define IRQ_C1_N1_UART_DMA (IRQ_C1_VIC_CHAIN_START + 20)
+#define IRQ_C1_N2_UART_DMA (IRQ_C1_VIC_CHAIN_START + 21)
+#define IRQ_C1_N3_UART_DMA (IRQ_C1_VIC_CHAIN_START + 22)
+#define IRQ_C1_N4_UART_DMA (IRQ_C1_VIC_CHAIN_START + 23)
+#define IRQ_C1_I2C (IRQ_C1_VIC_CHAIN_START + 24)
+
+#define IRQ_C2_N1_KCS (IRQ_C2_VIC_CHAIN_START + 0)
+#define IRQ_C2_N1_UART (IRQ_C2_VIC_CHAIN_START + 1)
+#define IRQ_C2_N1_MAILBOX (IRQ_C2_VIC_CHAIN_START + 2)
+#define IRQ_C2_N1_PORT80 (IRQ_C2_VIC_CHAIN_START + 3)
+#define IRQ_C2_N1_RESET (IRQ_C2_VIC_CHAIN_START + 4)
+#define IRQ_C2_N2_KCS (IRQ_C2_VIC_CHAIN_START + 5)
+#define IRQ_C2_N2_UART (IRQ_C2_VIC_CHAIN_START + 6)
+#define IRQ_C2_N2_MAILBOX (IRQ_C2_VIC_CHAIN_START + 7)
+#define IRQ_C2_N2_PORT80 (IRQ_C2_VIC_CHAIN_START + 8)
+#define IRQ_C2_N2_RESET (IRQ_C2_VIC_CHAIN_START + 9)
+#define IRQ_C2_N3_KCS (IRQ_C2_VIC_CHAIN_START + 10)
+#define IRQ_C2_N3_UART (IRQ_C2_VIC_CHAIN_START + 11)
+#define IRQ_C2_N3_MAILBOX (IRQ_C2_VIC_CHAIN_START + 12)
+#define IRQ_C2_N3_PORT80 (IRQ_C2_VIC_CHAIN_START + 13)
+#define IRQ_C2_N3_RESET (IRQ_C2_VIC_CHAIN_START + 14)
+#define IRQ_C2_N4_KCS (IRQ_C2_VIC_CHAIN_START + 15)
+#define IRQ_C2_N4_UART (IRQ_C2_VIC_CHAIN_START + 16)
+#define IRQ_C2_N4_MAILBOX (IRQ_C2_VIC_CHAIN_START + 17)
+#define IRQ_C2_N4_PORT80 (IRQ_C2_VIC_CHAIN_START + 18)
+#define IRQ_C2_N4_RESET (IRQ_C2_VIC_CHAIN_START + 19)
+#define IRQ_C2_N1_UART_DMA (IRQ_C2_VIC_CHAIN_START + 20)
+#define IRQ_C2_N2_UART_DMA (IRQ_C2_VIC_CHAIN_START + 21)
+#define IRQ_C2_N3_UART_DMA (IRQ_C2_VIC_CHAIN_START + 22)
+#define IRQ_C2_N4_UART_DMA (IRQ_C2_VIC_CHAIN_START + 23)
+#define IRQ_C2_I2C (IRQ_C2_VIC_CHAIN_START + 24)
+
+#define IRQ_C3_N1_KCS (IRQ_C3_VIC_CHAIN_START + 0)
+#define IRQ_C3_N1_UART (IRQ_C3_VIC_CHAIN_START + 1)
+#define IRQ_C3_N1_MAILBOX (IRQ_C3_VIC_CHAIN_START + 2)
+#define IRQ_C3_N1_PORT80 (IRQ_C3_VIC_CHAIN_START + 3)
+#define IRQ_C3_N1_RESET (IRQ_C3_VIC_CHAIN_START + 4)
+#define IRQ_C3_N2_KCS (IRQ_C3_VIC_CHAIN_START + 5)
+#define IRQ_C3_N2_UART (IRQ_C3_VIC_CHAIN_START + 6)
+#define IRQ_C3_N2_MAILBOX (IRQ_C3_VIC_CHAIN_START + 7)
+#define IRQ_C3_N2_PORT80 (IRQ_C3_VIC_CHAIN_START + 8)
+#define IRQ_C3_N2_RESET (IRQ_C3_VIC_CHAIN_START + 9)
+#define IRQ_C3_N3_KCS (IRQ_C3_VIC_CHAIN_START + 10)
+#define IRQ_C3_N3_UART (IRQ_C3_VIC_CHAIN_START + 11)
+#define IRQ_C3_N3_MAILBOX (IRQ_C3_VIC_CHAIN_START + 12)
+#define IRQ_C3_N3_PORT80 (IRQ_C3_VIC_CHAIN_START + 13)
+#define IRQ_C3_N3_RESET (IRQ_C3_VIC_CHAIN_START + 14)
+#define IRQ_C3_N4_KCS (IRQ_C3_VIC_CHAIN_START + 15)
+#define IRQ_C3_N4_UART (IRQ_C3_VIC_CHAIN_START + 16)
+#define IRQ_C3_N4_MAILBOX (IRQ_C3_VIC_CHAIN_START + 17)
+#define IRQ_C3_N4_PORT80 (IRQ_C3_VIC_CHAIN_START + 18)
+#define IRQ_C3_N4_RESET (IRQ_C3_VIC_CHAIN_START + 19)
+#define IRQ_C3_N1_UART_DMA (IRQ_C3_VIC_CHAIN_START + 20)
+#define IRQ_C3_N2_UART_DMA (IRQ_C3_VIC_CHAIN_START + 21)
+#define IRQ_C3_N3_UART_DMA (IRQ_C3_VIC_CHAIN_START + 22)
+#define IRQ_C3_N4_UART_DMA (IRQ_C3_VIC_CHAIN_START + 23)
+#define IRQ_C3_I2C (IRQ_C3_VIC_CHAIN_START + 24)
+
+#endif
diff --git a/arch/arm/mach-aspeed/include/mach/ast1070_platform.h b/arch/arm/mach-aspeed/include/mach/ast1070_platform.h
new file mode 100644
index 0000000..feefd91
--- /dev/null
+++ b/arch/arm/mach-aspeed/include/mach/ast1070_platform.h
@@ -0,0 +1,100 @@
+/*
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef _AST1070_PLATFORM_H_
+#define _AST1070_PLATFORM_H_ 1
+
+#define AST_C0_BASE (AST_LPC_BRIDGE)
+
+#define AST_C0_UART0_BASE (AST_C0_BASE) /* Companion UART1 */
+#define AST_C0_UART1_BASE (AST_C0_BASE + 0x400) /* Companion UART2 */
+#define AST_C0_UART2_BASE (AST_C0_BASE + 0x800) /* Companion UART3 */
+#define AST_C0_UART3_BASE (AST_C0_BASE + 0xc00) /* Companion UART4 */
+#define AST_C0_LPC0_BASE (AST_C0_BASE + 0x1000) /* Companion LPC1 */
+#define AST_C0_LPC1_BASE (AST_C0_BASE + 0x1400) /* Companion LPC2 */
+#define AST_C0_LPC2_BASE (AST_C0_BASE + 0x1800) /* Companion LPC3 */
+#define AST_C0_LPC3_BASE (AST_C0_BASE + 0x1c00) /* Companion LPC4 */
+#define AST_C0_SCU_BASE (AST_C0_BASE + 0x2000) /* Companion SCU */
+#define AST_C0_VIC_BASE (AST_C0_BASE + 0x2400) /* Companion VIC */
+#define AST_C0_LPC_SLAVE_BASE (AST_C0_BASE + 0x2c00) /* Companion LPC SlLAVE */
+#define AST_C0_I2C_BASE (AST_C0_BASE + 0x3000) /* Companion I2C */
+#define AST_C0_SPI_BASE (AST_C0_BASE + 0x4000) /* Companion SPI */
+#define AST_C0_LPC_SPI_BASE (AST_C0_BASE + 0x4400) /* Companion LPC SPI */
+#define AST_C0_UART_DMA_BASE (AST_C0_BASE + 0x4800) /* Companion UART DMA */
+#define AST_C0_SPI_CONTROL_BASE (AST_C0_BASE + 0x4c00) /* Companion SPI CONTROL */
+#define AST_C0_SPI_SHADOW_SRAM_BASE (AST_C0_BASE + 0x5000) /* Companion SPI SHADOW SRAM */
+
+#define AST_C1_BASE (AST_LPC_BRIDGE + 0x10000)
+
+#define AST_C1_UART0_BASE (AST_C1_BASE) /* Companion UART1 */
+#define AST_C1_UART1_BASE (AST_C1_BASE + 0x400) /* Companion UART2 */
+#define AST_C1_UART2_BASE (AST_C1_BASE + 0x800) /* Companion UART3 */
+#define AST_C1_UART3_BASE (AST_C1_BASE + 0xc00) /* Companion UART4 */
+#define AST_C1_LPC0_BASE (AST_C1_BASE + 0x1000) /* Companion LPC1 */
+#define AST_C1_LPC1_BASE (AST_C1_BASE + 0x1400) /* Companion LPC2 */
+#define AST_C1_LPC2_BASE (AST_C1_BASE + 0x1800) /* Companion LPC3 */
+#define AST_C1_LPC3_BASE (AST_C1_BASE + 0x1c00) /* Companion LPC4 */
+#define AST_C1_SCU_BASE (AST_C1_BASE + 0x2000) /* Companion SCU */
+#define AST_C1_VIC_BASE (AST_C1_BASE + 0x2400) /* Companion VIC */
+#define AST_C1_LPC_SLAVE_BASE (AST_C1_BASE + 0x2c00) /* Companion LPC SlLAVE */
+#define AST_C1_I2C_BASE (AST_C1_BASE + 0x3000) /* Companion I2C */
+#define AST_C1_SPI_BASE (AST_C1_BASE + 0x4000) /* Companion SPI */
+#define AST_C1_LPC_SPI_BASE (AST_C1_BASE + 0x4400) /* Companion LPC SPI */
+#define AST_C1_UART_DMA_BASE (AST_C1_BASE + 0x4800) /* Companion UART DMA */
+#define AST_C1_SPI_CONTROL_BASE (AST_C1_BASE + 0x4c00) /* Companion SPI CONTROL */
+#define AST_C1_SPI_SHADOW_SRAM_BASE (AST_C1_BASE + 0x5000) /* Companion SPI SHADOW SRAM */
+
+#define AST_C2_BASE (AST_LPC_BRIDGE + 0x20000)
+
+#define AST_C2_UART0_BASE (AST_C2_BASE) /* Companion UART1 */
+#define AST_C2_UART1_BASE (AST_C2_BASE + 0x400) /* Companion UART2 */
+#define AST_C2_UART2_BASE (AST_C2_BASE + 0x800) /* Companion UART3 */
+#define AST_C2_UART3_BASE (AST_C2_BASE + 0xc00) /* Companion UART4 */
+#define AST_C2_LPC1_BASE (AST_C2_BASE + 0x1000) /* Companion LPC1 */
+#define AST_C2_LPC2_BASE (AST_C2_BASE + 0x1400) /* Companion LPC2 */
+#define AST_C2_LPC3_BASE (AST_C2_BASE + 0x1800) /* Companion LPC3 */
+#define AST_C2_LPC4_BASE (AST_C2_BASE + 0x1c00) /* Companion LPC4 */
+#define AST_C2_SCU_BASE (AST_C2_BASE + 0x2000) /* Companion SCU */
+#define AST_C2_VIC_BASE (AST_C2_BASE + 0x2400) /* Companion VIC */
+#define AST_C2_LPC_SLAVE_BASE (AST_C2_BASE + 0x2c00) /* Companion LPC SlLAVE */
+#define AST_C2_I2C_BASE (AST_C2_BASE + 0x3000) /* Companion I2C */
+#define AST_C2_SPI_BASE (AST_C2_BASE + 0x4000) /* Companion SPI */
+#define AST_C2_LPC_SPI_BASE (AST_C2_BASE + 0x4400) /* Companion LPC SPI */
+#define AST_C2_UART_DMA_BASE (AST_C2_BASE + 0x4800) /* Companion UART DMA */
+#define AST_C2_SPI_CONTROL_BASE (AST_C2_BASE + 0x4c00) /* Companion SPI CONTROL */
+#define AST_C2_SPI_SHADOW_SRAM_BASE (AST_C2_BASE + 0x5000) /* Companion SPI SHADOW SRAM */
+
+#define AST_C3_BASE (AST_LPC_BRIDGE + 0x30000)
+
+#define AST_C3_UART0_BASE (AST_C3_BASE) /* Companion UART1 */
+#define AST_C3_UART1_BASE (AST_C3_BASE + 0x400) /* Companion UART2 */
+#define AST_C3_UART2_BASE (AST_C3_BASE + 0x800) /* Companion UART3 */
+#define AST_C3_UART3_BASE (AST_C3_BASE + 0xc00) /* Companion UART4 */
+#define AST_C3_LPC0_BASE (AST_C3_BASE + 0x1000) /* Companion LPC1 */
+#define AST_C3_LPC1_BASE (AST_C3_BASE + 0x1400) /* Companion LPC2 */
+#define AST_C3_LPC2_BASE (AST_C3_BASE + 0x1800) /* Companion LPC3 */
+#define AST_C3_LPC3_BASE (AST_C3_BASE + 0x1c00) /* Companion LPC4 */
+#define AST_C3_SCU_BASE (AST_C3_BASE + 0x2000) /* Companion SCU */
+#define AST_C3_VIC_BASE (AST_C3_BASE + 0x2400) /* Companion VIC */
+#define AST_C3_LPC_SLAVE_BASE (AST_C3_BASE + 0x2c00) /* Companion LPC SlLAVE */
+#define AST_C3_I2C_BASE (AST_C3_BASE + 0x3000) /* Companion I2C */
+#define AST_C3_SPI_BASE (AST_C3_BASE + 0x4000) /* Companion SPI */
+#define AST_C3_LPC_SPI_BASE (AST_C3_BASE + 0x4400) /* Companion LPC SPI */
+#define AST_C3_UART_DMA_BASE (AST_C3_BASE + 0x4800) /* Companion UART DMA */
+#define AST_C3_SPI_CONTROL_BASE (AST_C3_BASE + 0x4c00) /* Companion SPI CONTROL */
+#define AST_C3_SPI_SHADOW_SRAM_BASE (AST_C3_BASE + 0x5000) /* Companion SPI SHADOW SRAM */
+
+#endif
diff --git a/arch/arm/mach-aspeed/include/mach/ast1520_irqs.h b/arch/arm/mach-aspeed/include/mach/ast1520_irqs.h
new file mode 100644
index 0000000..3ebc91b
--- /dev/null
+++ b/arch/arm/mach-aspeed/include/mach/ast1520_irqs.h
@@ -0,0 +1,107 @@
+/*
+ * arch/arm/plat-aspeed/include/plat/irqs.h
+ *
+ * Copyright (C) 2012-2020 ASPEED Technology Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef _AST1520_IRQS_H_
+#define _AST1520_IRQS_H_ 1
+
+
+#ifdef CONFIG_PCIE
+#define NR_IRQS (ARCH_NR_GPIOS +ARCH_NR_PCIE + AST_VIC_NUM)
+
+//--------------GPIO ---------------------------------------------------------------
+#define ARCH_NR_GPIOS (GPIO_PORT_NUM*8)
+#define IRQ_GPIO_CHAIN_START AST_VIC_NUM
+//------------------- ---------------------------------------------------------------
+
+#define ARCH_NR_PCIE 5
+#define IRQ_PCIE_CHAIN IRQ_PCIE
+#define IRQ_PCIE_CHAIN_START (ARCH_NR_GPIOS + AST_VIC_NUM)
+
+#define IRQ_PCIE_INTA (IRQ_PCIE_CHAIN_START)
+#define IRQ_PCIE_INTB (IRQ_PCIE_CHAIN_START + 1)
+#define IRQ_PCIE_INTC (IRQ_PCIE_CHAIN_START + 2)
+#define IRQ_PCIE_INTD (IRQ_PCIE_CHAIN_START + 3)
+#define IRQ_PCIE_MSI0 (IRQ_PCIE_INTD + 1) // support max 32 MSI
+
+#else
+#define NR_IRQS (AST_VIC_NUM + ARCH_NR_GPIOS)
+//--------------GPIO ---------------------------------------------------------------
+#define ARCH_NR_GPIOS (GPIO_PORT_NUM*8)
+#define IRQ_GPIO_CHAIN_START AST_VIC_NUM
+//------------------- ---------------------------------------------------------------
+#endif
+
+#define AST_VIC_NUM 51
+
+//#define IRQ_SDRAM_ECC 0
+//#define IRQ_MIC 1
+#define IRQ_MAC0 2 /* MAC 1 interrupt */
+//#define IRQ_MAC1 3 /* MAC 2 interrupt */
+#define IRQ_CRYPTO 4
+#define IRQ_USB20_HUB 5
+#define IRQ_EHCI 5
+#define IRQ_XDMA 6
+#define IRQ_VIDEO 7
+//#define IRQ_LPC 8
+#define IRQ_UART1 9 /* UART 1 interrupt */
+#define IRQ_UART0 10 /* UART 3 interrupt */
+//11 Reserved
+#define IRQ_I2C 12
+//#define IRQ_UDC11 13
+#define IRQ_UHCI 14
+//#define IRQ_PECI 15
+#define IRQ_TIMER0 16 /* TIMER 1 interrupt */
+#define IRQ_TIMER1 17 /* TIMER 2 interrupt */
+#define IRQ_TIMER2 18 /* TIMER 3 interrupt */
+//#define IRQ_SMC 19
+#define IRQ_GPIO 20
+#define IRQ_SCU 21
+#define IRQ_RTC 22
+//23 , 24 reserverd
+#define IRQ_CRT 25
+#define IRQ_SDHC 26
+#define IRQ_WDT 27
+#define IRQ_TACHO 28
+#define IRQ_2D 29
+#define IRQ_SYS_WAKEUP 30
+//#define IRQ_ADC 31
+#define IRQ_UART2 32 /* UART 2 interrupt */
+//#define IRQ_UART2 33 /* UART 3 interrupt */
+//#define IRQ_UART3 34 /* UART 4 interrupt */
+//#define IRQ_TIMER3 35 /* TIMER 4 interrupt */
+//#define IRQ_TIMER4 36
+//#define IRQ_TIMER5 37
+//#define IRQ_TIMER6 38
+//#define IRQ_TIMER7 39 /* TIMER 8 interrupt */
+//#define IRQ_SGPIO_MASTER 40
+//#define IRQ_SGPIO_SLAVE 41
+#define IRQ_PCIE 41
+
+#define IRQ_MCTP 42
+//#define IRQ_JTAG 43
+#define IRQ_PS2 44
+#define IRQ_CPU1 45
+//#define IRQ_MAILBOX 46
+#define IRQ_EXT0_GPIOL1 47
+#define IRQ_EXT1_GPIOL3 48
+#define IRQ_EXT2_GPIOM3 49
+#define IRQ_EXT3_GPIOM3 50
+
+#endif
diff --git a/arch/arm/mach-aspeed/include/mach/ast1520_platform.h b/arch/arm/mach-aspeed/include/mach/ast1520_platform.h
new file mode 100644
index 0000000..daded5d
--- /dev/null
+++ b/arch/arm/mach-aspeed/include/mach/ast1520_platform.h
@@ -0,0 +1,61 @@
+/*
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef _AST1520_PLATFORM_H_
+#define _AST1520_PLATFORM_H_ 1
+
+#define AST_SRAM_SIZE (SZ_8K)
+
+#define AST_AHB_CTRL_BASE 0x1E600000 /* AHB CONTROLLER */
+
+#define AST_SPI_BASE 0x1E620000 /* SPI CONTROLLER */
+
+#define AST_MAC0_BASE 0x1E660000 /* MAC1 */
+
+#define AST_USB20_BASE 0x1E6A0000 /* USB 2.0 VIRTUAL HUB CONTROLLER */
+#define AST_EHCI_BASE 0x1E6A1000 /* USB 2.0 HOST CONTROLLER */
+#define AST_UHCI_BASE 0x1E6B0000 /* USB 1.1 HOST CONTROLLER */
+#define AST_VIC_BASE 0x1E6C0000 /* VIC */
+#define AST_SDMC_BASE 0x1E6E0000 /* MMC SDRAM*/
+#define AST_SCU_BASE 0x1E6E2000 /* SCU */
+#define AST_CRYPTO_BASE 0x1E6E3000 /* Crypto */
+
+#define AST_I2S_BASE 0x1E6E5000 /* I2S */
+#define AST_GRAPHIC_BASE 0x1E6E6000 /* Graphics */
+#define AST_XDMA_BASE 0x1E6E7000 /* XDMA */
+#define AST_MCTP_BASE 0x1E6E8000 /* MCTP */
+#define AST_PCIE_BASE 0x1E6ED000 /* PCIE */
+
+#define AST_VIDEO_BASE 0x1E700000 /* VIDEO ENGINE */
+#define AST_SRAM_BASE 0x1E720000 /* SRAM */
+#define AST_SDHC_BASE 0x1E740000 /* SD */
+#define AST_2D_BASE 0x1E760000 /* 2D */
+#define AST_GPIO_BASE 0x1E780000 /* GPIO */
+#define AST_RTC_BASE 0x1E781000 /* RTC */
+#define AST_TIMER_BASE 0x1E782000 /* TIMER #0~2*/
+#define AST_UART1_BASE 0x1E783000 /* UART1 */
+#define AST_UART0_BASE 0x1E784000 /* UART3 */
+#define AST_WDT_BASE 0x1E785000 /* WDT */
+
+#define AST_I2C_BASE 0x1E78A000 /* I2C */
+#define AST_UART2_BASE 0x1E78D000 /* UART2 */
+
+#define AST_SPI0_MEM 0x20000000
+
+#define AST_PCIE_WIN_BASE 0x70000000
+#define AST_PCIE_WIN_SIZE 0x01000000
+
+#endif
diff --git a/arch/arm/mach-aspeed/include/mach/ast2000_irqs.h b/arch/arm/mach-aspeed/include/mach/ast2000_irqs.h
new file mode 100644
index 0000000..50aece9
--- /dev/null
+++ b/arch/arm/mach-aspeed/include/mach/ast2000_irqs.h
@@ -0,0 +1,64 @@
+/*
+ * arch/arm/plat-aspeed/include/plat/irqs.h
+ *
+ * Copyright (C) 2012-2020 ASPEED Technology Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef _AST2000_IRQS_H_
+#define _AST2000_IRQS_H_ 1
+
+#define NR_IRQS (AST_VIC_NUM + ARCH_NR_GPIOS)
+//--------------GPIO ---------------------------------------------------------------
+#define ARCH_NR_GPIOS (GPIO_PORT_NUM*8)
+#define IRQ_GPIO_CHAIN_START AST_VIC_NUM
+
+#define AST_VIC_NUM 32
+
+#define IRQ_SPI 0
+#define IRQ_UART0 1
+#define IRQ_UART1 2
+#define IRQ_TIMER0 3
+#define IRQ_TIMER1 4
+#define IRQ_TIMER2 5
+#define IRQ_RTC 6
+#define IRQ_MAC0 7
+#define IRQ_GPIO_B0 8
+#define IRQ_UDC 9
+#define IRQ_PCI 10
+#define IRQ_GPIO_B1 11
+#define IRQ_GPIO_B2 12
+#define IRQ_GPIO_B3 13
+#define IRQ_LPC 14
+#define IRQ_I2C 15
+#define IRQ_USB11 16
+#define IRQ_VIDEO 17
+#define IRQ_CRYPTO 18
+#define IRQ_SCU 19
+#define IRQ_GPIO_B4 20
+#define IRQ_GPIO_B5 21
+#define IRQ_GPIO_B6 22
+#define IRQ_GPIO_A0 23
+#define IRQ_GPIO_A1 24
+#define IRQ_GPIO_A2 25
+#define IRQ_GPIO_A3 26
+#define IRQ_HDMA 27
+#define IRQ_GPIO_A4 28
+#define IRQ_GPIO_A5 29
+#define IRQ_GPIO_A6 30
+#define IRQ_WDT 31
+
+#endif
diff --git a/arch/arm/mach-aspeed/include/mach/ast2000_platform.h b/arch/arm/mach-aspeed/include/mach/ast2000_platform.h
new file mode 100644
index 0000000..ff34f5b
--- /dev/null
+++ b/arch/arm/mach-aspeed/include/mach/ast2000_platform.h
@@ -0,0 +1,40 @@
+/*
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef _AST2000_PLATFORM_H_
+#define _AST2000_PLATFORM_H_ 1
+
+#define AST_MAC0_BASE 0x19c80000 /* MAC1 */
+#define AST_CRYPTO_BASE 0x1E6E0040 /* Crypto */
+#define AST_UDC11_BASE 0x1E6E0080 /* USB11 */
+#define AST_SCU0_BASE 0x1E6E0100 /* SCU1 */
+#define AST_LPC_BASE 0x1E6E0400 /* LPC */
+#define AST_I2C_BASE 0x1E6E0800 /* I2C */
+//---//
+#define AST_VIDEO_BASE 0x1E700000 /* VIDEO ENGINE */
+#define AST_AHB_TO_PBUS_BASE 0x1E720000 /* APB -> PBUS */
+//...//
+#define AST_HDMA_BASE 0x1E7c0000 /* HDMA */
+#define AST_TIMER_BASE 0x1E800000 /* TIMER0/1/2 */
+#define AST_RTC_BASE 0x1E820000 /* RTC */
+#define AST_UART0_BASE 0x1E840000 /* UART0 */
+#define AST_UART1_BASE 0x1E860000 /* UART1 */
+#define AST_SPI_BASE 0x1E880000 /* SPI */
+#define AST_GPIO_BASE 0x1E8A0000 /* GPIO */
+#define AST_WDT_BASE 0x1E8C0000 /* WDT */
+#define AST_SCU0_BASE 0x1E8E000c /* SCU2 */
+
+#endif
diff --git a/arch/arm/mach-aspeed/include/mach/ast2100_irqs.h b/arch/arm/mach-aspeed/include/mach/ast2100_irqs.h
new file mode 100644
index 0000000..8513909
--- /dev/null
+++ b/arch/arm/mach-aspeed/include/mach/ast2100_irqs.h
@@ -0,0 +1,64 @@
+/*
+ * arch/arm/plat-aspeed/include/plat/irqs.h
+ *
+ * Copyright (C) 2012-2020 ASPEED Technology Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef _AST2100_IRQS_H_
+#define _AST2100_IRQS_H_ 1
+
+
+#define NR_IRQS (AST_VIC_NUM + ARCH_NR_GPIOS)
+//--------------GPIO ---------------------------------------------------------------
+#define ARCH_NR_GPIOS (GPIO_PORT_NUM*8)
+#define IRQ_GPIO_CHAIN_START AST_VIC_NUM
+
+#define AST_VIC_NUM 32
+#define IRQ_SDRAM_ECC 0
+#define IRQ_MIC 1
+#define IRQ_MAC0 2 /* MAC 1 interrupt */
+#define IRQ_MAC1 3 /* MAC 2 interrupt */
+#define IRQ_CRYPTO 4
+#define IRQ_USB20_HUB 5
+#define IRQ_EHCI 5
+#define IRQ_XDMA 6
+#define IRQ_VIDEO 7
+#define IRQ_LPC 8
+#define IRQ_UART0 9 /* UART 1 interrupt */
+#define IRQ_UART1 10 /* UART 2 interrupt */
+//11 reserved
+#define IRQ_I2C 12
+#define IRQ_UDC11 13
+//14 reserved
+#define IRQ_PECI 15
+#define IRQ_TIMER0 16 /* TIMER 1 interrupt */
+#define IRQ_TIMER1 17 /* TIMER 2 interrupt */
+#define IRQ_TIMER2 18 /* TIMER 3 interrupt */
+#define IRQ_SMC 19
+#define IRQ_GPIO 20
+#define IRQ_SCU 21
+#define IRQ_RTC_SEC 22
+#define IRQ_RTC_DAY 23
+#define IRQ_RTC_HOUR 24
+#define IRQ_RTC_MIN 25
+#define IRQ_RTC 26
+#define IRQ_WDT 27
+#define IRQ_TACHO 28
+#define IRQ_2D 29
+#define IRQ_PCI 30
+#define IRQ_AHBC 31
+#endif
diff --git a/arch/arm/mach-aspeed/include/mach/ast2100_platform.h b/arch/arm/mach-aspeed/include/mach/ast2100_platform.h
new file mode 100644
index 0000000..2d635f7
--- /dev/null
+++ b/arch/arm/mach-aspeed/include/mach/ast2100_platform.h
@@ -0,0 +1,57 @@
+/*
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef _AST2100_PLATFORM_H_
+#define _AST2100_PLATFORM_H_ 1
+
+#define AST_OLD_SMC_BASE 0x10000000 /*Legacy BMC Static Memory */
+#define AST_OLD_SMC_CTRL_BASE 0x16000000 /*Legacy BMC Static Memory Ctrl*/
+
+#define AST_AHB_CTRL_BASE 0x1E600000 /* AHB CONTROLLER */
+#define AST_MIC_BASE 0x1E640000 /* MIC CONTROLLER */
+#define AST_MAC0_BASE 0x1E660000 /* MAC1 */
+#define AST_MAC1_BASE 0x1E680000 /* MAC2 */
+
+#define AST_USB20_BASE 0x1E6A0000 /* USB 2.0 VIRTUAL HUB CONTROLLER */
+#define AST_VIC_BASE 0x1E6C0000 /* VIC */
+#define AST_SDMC_BASE 0x1E6E0000 /* MMC */
+#define AST_UDC11_BASE 0x1E6E1000 /* USB11 */
+#define AST_SCU_BASE 0x1E6E2000 /* SCU */
+#define AST_CRYPTO_BASE 0x1E6E3000 /* Crypto */
+
+#define AST_GRAPHIC_BASE 0x1E6E6000 /* Graphics */
+
+#define AST_VIDEO_BASE 0x1E700000 /* VIDEO ENGINE */
+#define AST_AHB_TO_PBUS_BASE 0x1E720000 /* APB -> PBUS */
+#define AST_MDMA_BASE 0x1E740000 /* MDMA */
+#define AST_2D_BASE 0x1E760000 /* 2D */
+#define AST_GPIO_BASE 0x1E780000 /* GPIO */
+#define AST_RTC_BASE 0x1E781000 /* RTC */
+#define AST_TIMER_BASE 0x1E782000 /* TIMER #0~7*/
+#define AST_UART0_BASE 0x1E783000 /* UART1 */
+#define AST_UART1_BASE 0x1E784000 /* UART2 */
+#define AST_WDT_BASE 0x1E785000 /* WDT */
+#define AST_PWM_BASE 0x1E786000 /* PWM */
+#define AST_VUART0_BASE 0x1E787000 /* VUART1 */
+#define AST_PUART_BASE 0x1E788000 /* PUART */
+#define AST_LPC_BASE 0x1E789000 /* LPC */
+#define AST_I2C_BASE 0x1E78A000 /* I2C */
+#define AST_PECI_BASE 0x1E78B000 /* PECI */
+#define AST_PCIARBITER_BASE 0x1E78C000 /* PCI ARBITER */
+
+#define ASPEED_VIC_STATUS_OFFSET 0x00
+
+#endif
diff --git a/arch/arm/mach-aspeed/include/mach/ast2200_irqs.h b/arch/arm/mach-aspeed/include/mach/ast2200_irqs.h
new file mode 100644
index 0000000..f0b880f
--- /dev/null
+++ b/arch/arm/mach-aspeed/include/mach/ast2200_irqs.h
@@ -0,0 +1,65 @@
+/*
+ * arch/arm/plat-aspeed/include/plat/irqs.h
+ *
+ * Copyright (C) 2012-2020 ASPEED Technology Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef _AST2200_IRQS_H_
+#define _AST2200_IRQS_H_ 1
+
+#define NR_IRQS (AST_VIC_NUM + ARCH_NR_GPIOS)
+//--------------GPIO ---------------------------------------------------------------
+#define ARCH_NR_GPIOS (GPIO_PORT_NUM*8)
+#define IRQ_GPIO_CHAIN_START AST_VIC_NUM
+
+#define AST_VIC_NUM 32
+
+#define IRQ_SDRAM_ECC 0
+#define IRQ_MIC 1
+#define IRQ_MAC0 2 /* MAC 1 interrupt */
+#define IRQ_MAC1 3 /* MAC 2 interrupt */
+#define IRQ_CRYPTO 4
+#define IRQ_USB20_HUB 5
+#define IRQ_EHCI 5
+#define IRQ_XDMA 6
+#define IRQ_VIDEO 7
+#define IRQ_LPC 8
+#define IRQ_UART0 9 /* UART 1 interrupt */
+#define IRQ_UART1 10 /* UART 2 interrupt */
+//11 reserved
+#define IRQ_I2C 12
+#define IRQ_UDC11 13
+//14 reserved
+#define IRQ_PECI 15
+#define IRQ_TIMER0 16 /* TIMER 1 interrupt */
+#define IRQ_TIMER1 17 /* TIMER 2 interrupt */
+#define IRQ_TIMER2 18 /* TIMER 3 interrupt */
+#define IRQ_SMC 19
+#define IRQ_GPIO 20
+#define IRQ_SCU 21
+#define IRQ_RTC_SEC 22
+#define IRQ_RTC_DAY 23
+#define IRQ_RTC_HOUR 24
+#define IRQ_RTC_MIN 25
+#define IRQ_RTC 26
+#define IRQ_WDT 27
+#define IRQ_TACHO 28
+#define IRQ_2D 29
+#define IRQ_PCI 30
+#define IRQ_AHBC 31
+
+#endif
diff --git a/arch/arm/mach-aspeed/include/mach/ast2200_platform.h b/arch/arm/mach-aspeed/include/mach/ast2200_platform.h
new file mode 100644
index 0000000..324e15b
--- /dev/null
+++ b/arch/arm/mach-aspeed/include/mach/ast2200_platform.h
@@ -0,0 +1,55 @@
+/*
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef _AST2200_PLATFORM_H_
+#define _AST2200_PLATFORM_H_ 1
+
+#define AST_OLD_SMC_BASE 0x10000000 /*Legacy BMC Static Memory */
+#define AST_OLD_SMC_CTRL_BASE 0x16000000 /*Legacy BMC Static Memory Ctrl*/
+
+#define AST_AHB_CTRL_BASE 0x1E600000 /* AHB CONTROLLER */
+
+#define AST_MIC_BASE 0x1E640000 /* MIC CONTROLLER */
+#define AST_MAC1_BASE 0x1E660000 /* MAC1 */
+#define AST_MAC2_BASE 0x1E680000 /* MAC2 */
+
+#define AST_USB20_BASE 0x1E6A0000 /* USB 2.0 VIRTUAL HUB CONTROLLER */
+#define AST_VIC_BASE 0x1E6C0000 /* VIC */
+#define AST_SDMC_BASE 0x1E6E0000 /* MMC */
+#define AST_UDC11_BASE 0x1E6E1000 /* USB11 */
+#define AST_SCU_BASE 0x1E6E2000 /* SCU */
+#define AST_CRYPTO_BASE 0x1E6E3000 /* Crypto */
+
+#define AST_GRAPHIC_BASE 0x1E6E6000 /* Graphics */
+
+#define AST_VIDEO_BASE 0x1E700000 /* VIDEO ENGINE */
+#define AST_AHB_TO_PBUS_BASE 0x1E720000 /* APB -> PBUS */
+#define AST_MDMA_BASE 0x1E740000 /* MDMA */
+#define AST_2D_BASE 0x1E760000 /* 2D */
+#define AST_GPIO_BASE 0x1E780000 /* GPIO */
+#define AST_RTC_BASE 0x1E781000 /* RTC */
+#define AST_TIMER_BASE 0x1E782000 /* TIMER #0~7*/
+#define AST_UART0_BASE 0x1E783000 /* UART1 */
+#define AST_UART1_BASE 0x1E784000 /* UART2 */
+#define AST_WDT_BASE 0x1E785000 /* WDT */
+#define AST_PWM_BASE 0x1E786000 /* PWM */
+#define AST_VUART0_BASE 0x1E787000 /* VUART1 */
+#define AST_PUART_BASE 0x1E788000 /* PUART */
+#define AST_LPC_BASE 0x1E789000 /* LPC */
+#define AST_I2C_BASE 0x1E78A000 /* I2C */
+#define AST_PECI_BASE 0x1E78B000 /* PECI */
+
+#endif
diff --git a/arch/arm/mach-aspeed/include/mach/ast2300_irqs.h b/arch/arm/mach-aspeed/include/mach/ast2300_irqs.h
new file mode 100644
index 0000000..2d7b0c8
--- /dev/null
+++ b/arch/arm/mach-aspeed/include/mach/ast2300_irqs.h
@@ -0,0 +1,92 @@
+/*
+ * arch/arm/plat-aspeed/include/plat/irqs.h
+ *
+ * Copyright (C) 2012-2020 ASPEED Technology Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef _AST2300_IRQS_H_
+#define _AST2300_IRQS_H_ 1
+
+#if defined(CONFIG_ARCH_AST1070)
+//----------VIC + GPIO + CVIC chain--------------------------------------------------
+#define NR_IRQS (AST_VIC_NUM + ARCH_NR_GPIOS + AST_CVIC_NUM)
+//--------------GPIO ---------------------------------------------------------------
+#define ARCH_NR_GPIOS (GPIO_PORT_NUM*8)
+#define IRQ_GPIO_CHAIN_START (AST_VIC_NUM)
+//---------------CVIC---------------------------------------------------------------
+#define IRQ_C0_VIC_CHAIN IRQ_GPIOL1
+#define IRQ_C0_VIC_CHAIN_START (AST_VIC_NUM + ARCH_NR_GPIOS)
+//------------------- ---------------------------------------------------------------
+#else
+#define NR_IRQS (AST_VIC_NUM + ARCH_NR_GPIOS)
+//--------------GPIO ---------------------------------------------------------------
+#define ARCH_NR_GPIOS (GPIO_PORT_NUM*8)
+#define IRQ_GPIO_CHAIN_START AST_VIC_NUM
+
+#endif
+
+
+#define AST_VIC_NUM 46
+
+#define IRQ_SDRAM_ECC 0
+#define IRQ_MIC 1
+#define IRQ_MAC0 2 /* MAC 1 interrupt */
+#define IRQ_MAC1 3 /* MAC 2 interrupt */
+#define IRQ_CRYPTO 4
+#define IRQ_USB20_HUB 5
+#define IRQ_EHCI 5
+#define IRQ_XDMA 6
+#define IRQ_VIDEO 7
+#define IRQ_LPC 8
+#define IRQ_UART1 9 /* UART 1 interrupt */
+#define IRQ_UART0 10 /* UART 5 interrupt */
+//11 Reserved
+#define IRQ_I2C 12
+#define IRQ_UDC11 13
+#define IRQ_UHCI 14
+#define IRQ_PECI 15
+#define IRQ_TIMER0 16 /* TIMER 1 interrupt */
+#define IRQ_TIMER1 17 /* TIMER 2 interrupt */
+#define IRQ_TIMER2 18 /* TIMER 3 interrupt */
+#define IRQ_SMC 19
+#define IRQ_GPIO 20
+#define IRQ_SCU 21
+#define IRQ_RTC 22
+//23 , 24 reserverd
+#define IRQ_CRT 25
+#define IRQ_SDHC 26
+#define IRQ_WDT 27
+#define IRQ_TACHO 28
+#define IRQ_2D 29
+#define IRQ_SYS_WAKEUP 30
+#define IRQ_ADC 31
+#define IRQ_UART2 32 /* UART 2 interrupt */
+#define IRQ_UART3 33 /* UART 3 interrupt */
+#define IRQ_UART4 34 /* UART 4 interrupt */
+#define IRQ_TIMER3 35 /* TIMER 4 interrupt */
+#define IRQ_TIMER4 36
+#define IRQ_TIMER5 37
+#define IRQ_TIMER6 38
+#define IRQ_TIMER7 39 /* TIMER 8 interrupt */
+#define IRQ_SGPIO_MASTER 40
+#define IRQ_SGPIO_SLAVE 41
+#define IRQ_MCTP 42
+#define IRQ_JTAG 43
+//#define IRQ_RESERVED 44
+#define IRQ_CPU1 45
+
+#endif
diff --git a/arch/arm/mach-aspeed/include/mach/ast2300_platform.h b/arch/arm/mach-aspeed/include/mach/ast2300_platform.h
new file mode 100644
index 0000000..4898856
--- /dev/null
+++ b/arch/arm/mach-aspeed/include/mach/ast2300_platform.h
@@ -0,0 +1,72 @@
+/*
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef _AST2300_PLATFORM_H_
+#define _AST2300_PLATFORM_H_ 1
+
+#define AST_DRAM_BASE 0x40000000
+#define AST_SRAM_SIZE (SZ_16K)
+
+#define AST_OLD_SMC_BASE 0x10000000 /*Legacy BMC Static Memory */
+#define AST_OLD_SMC_CTRL_BASE 0x16000000 /*Legacy BMC Static Memory Ctrl*/
+
+#define AST_AHB_CTRL_BASE 0x1E600000 /* AHB CONTROLLER */
+
+#define AST_FMC_BASE 0x1E620000 /* NEW SMC CONTROLLER */
+#define AST_SPI_BASE 0x1E630000 /* SPI CONTROLLER */
+#define AST_MIC_BASE 0x1E640000 /* MIC CONTROLLER */
+#define AST_MAC0_BASE 0x1E660000 /* MAC1 */
+#define AST_MAC1_BASE 0x1E680000 /* MAC2 */
+
+#define AST_USB20_BASE 0x1E6A0000 /* USB 2.0 VIRTUAL HUB CONTROLLER */
+#define AST_UHCI_BASE 0x1E6B0000 /* USB 1.1 HOST CONTROLLER */
+#define AST_VIC_BASE 0x1E6C0000 /* VIC */
+#define AST_SDMC_BASE 0x1E6E0000 /* SDRAM CTRL */
+#define AST_UDC11_BASE 0x1E6E1000 /* USB11 */
+#define AST_SCU_BASE 0x1E6E2000 /* SCU */
+#define AST_CRYPTO_BASE 0x1E6E3000 /* Crypto */
+#define AST_JTAG_BASE 0x1E6E4000 /* JTAG */
+#define AST_GRAPHIC_BASE 0x1E6E6000 /* Graphics */
+#define AST_XDMA_BASE 0x1E6E7000 /* XDMA */
+#define AST_MCTP_BASE 0x1E6E8000 /* MCTP */
+#define AST_ADC_BASE 0x1E6E9000 /* ADC */
+
+#define AST_LPC_PLUS_BASE 0x1E6EC000 /* LPC+ Controller */
+
+#define AST_VIDEO_BASE 0x1E700000 /* VIDEO ENGINE */
+#define AST_SRAM_BASE 0x1E720000 /* SRAM */
+#define AST_SDHC_BASE 0x1E740000 /* SDHC */
+#define AST_2D_BASE 0x1E760000 /* 2D */
+#define AST_GPIO_BASE 0x1E780000 /* GPIO */
+#define AST_RTC_BASE 0x1E781000 /* RTC */
+#define AST_TIMER_BASE 0x1E782000 /* TIMER #0~7*/
+#define AST_UART1_BASE 0x1E783000 /* UART1 */
+#define AST_UART0_BASE 0x1E784000 /* UART5 */
+#define AST_WDT_BASE 0x1E785000 /* WDT */
+#define AST_PWM_BASE 0x1E786000 /* PWM */
+#define AST_VUART0_BASE 0x1E787000 /* VUART1 */
+#define AST_PUART_BASE 0x1E788000 /* PUART */
+#define AST_LPC_BASE 0x1E789000 /* LPC */
+#define AST_MBX_BASE 0x1E789200 /* MailBox */
+#define AST_I2C_BASE 0x1E78A000 /* I2C */
+#define AST_PECI_BASE 0x1E78B000 /* PECI */
+#define AST_UART2_BASE 0x1E78D000 /* UART2 */
+#define AST_UART3_BASE 0x1E78E000 /* UART3 */
+#define AST_UART4_BASE 0x1E78F000 /* UART4 */
+
+#define AST_LPC_BRIDGE 0x60000000
+
+#endif
diff --git a/arch/arm/mach-aspeed/include/mach/ast2400_irqs.h b/arch/arm/mach-aspeed/include/mach/ast2400_irqs.h
new file mode 100644
index 0000000..17c59da
--- /dev/null
+++ b/arch/arm/mach-aspeed/include/mach/ast2400_irqs.h
@@ -0,0 +1,96 @@
+/*
+ * arch/arm/plat-aspeed/include/plat/irqs.h
+ *
+ * Copyright (C) 2012-2020 ASPEED Technology Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef _AST2400_IRQS_H_
+#define _AST2400_IRQS_H_ 1
+
+#if defined(CONFIG_ARCH_AST1070)
+#include <mach/ast1070_irqs.h>
+#define MAX_AST1070_NR 2
+//----------VIC + CVIC + GPIO chain--------------------------------------------------
+#define NR_IRQS (AST_VIC_NUM + (AST_CVIC_NUM * MAX_AST1070_NR) + ARCH_NR_GPIOS)
+//--------------GPIO ---------------------------------------------------------------
+#define ARCH_NR_GPIOS (GPIO_PORT_NUM*8)
+#define IRQ_GPIO_CHAIN_START (AST_VIC_NUM + (AST_CVIC_NUM * MAX_AST1070_NR))
+//------------------- ---------------------------------------------------------------
+#else
+//--------------GPIO ---------------------------------------------------------------
+#define ARCH_NR_GPIOS (GPIO_PORT_NUM*8)
+#define IRQ_GPIO_CHAIN_START (AST_VIC_NUM)
+//------------------- ---------------------------------------------------------------
+#define NR_IRQS (AST_VIC_NUM + ARCH_NR_GPIOS)
+
+#endif
+
+#define AST_VIC_NUM 51
+
+#define IRQ_SDRAM_ECC 0
+#define IRQ_MIC 1
+#define IRQ_MAC0 2 /* MAC 1 interrupt */
+#define IRQ_MAC1 3 /* MAC 2 interrupt */
+#define IRQ_CRYPTO 4
+#define IRQ_USB20_HUB 5
+#define IRQ_EHCI 5
+#define IRQ_XDMA 6
+#define IRQ_VIDEO 7
+#define IRQ_LPC 8
+#define IRQ_UART1 9 /* UART 1 interrupt */
+#define IRQ_UART0 10 /* UART 5 interrupt */
+//11 Reserved
+#define IRQ_I2C 12
+#define IRQ_UDC11 13
+#define IRQ_UHCI 14
+#define IRQ_PECI 15
+#define IRQ_TIMER0 16 /* TIMER 1 interrupt */
+#define IRQ_TIMER1 17 /* TIMER 2 interrupt */
+#define IRQ_TIMER2 18 /* TIMER 3 interrupt */
+#define IRQ_SMC 19
+#define IRQ_GPIO 20
+#define IRQ_SCU 21
+#define IRQ_RTC 22
+//23 , 24 reserverd
+#define IRQ_CRT 25
+#define IRQ_SDHC 26
+#define IRQ_WDT 27
+#define IRQ_TACHO 28
+#define IRQ_2D 29
+#define IRQ_SYS_WAKEUP 30
+#define IRQ_ADC 31
+#define IRQ_UART2 32 /* UART 2 interrupt */
+#define IRQ_UART3 33 /* UART 3 interrupt */
+#define IRQ_UART4 34 /* UART 4 interrupt */
+#define IRQ_TIMER3 35 /* TIMER 4 interrupt */
+#define IRQ_TIMER4 36
+#define IRQ_TIMER5 37
+#define IRQ_TIMER6 38
+#define IRQ_TIMER7 39 /* TIMER 8 interrupt */
+#define IRQ_SGPIO_MASTER 40
+#define IRQ_SGPIO_SLAVE 41
+#define IRQ_MCTP 42
+#define IRQ_JTAG 43
+//#define IRQ_RESERVED 44
+#define IRQ_CPU1 45
+#define IRQ_MAILBOX 46
+#define IRQ_EXT0 47
+#define IRQ_EXT1 48
+#define IRQ_EXT2 49
+#define IRQ_EXT3 50
+
+#endif
diff --git a/arch/arm/mach-aspeed/include/mach/ast2400_platform.h b/arch/arm/mach-aspeed/include/mach/ast2400_platform.h
new file mode 100644
index 0000000..e507953
--- /dev/null
+++ b/arch/arm/mach-aspeed/include/mach/ast2400_platform.h
@@ -0,0 +1,79 @@
+/*
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef _AST2400_PLATFORM_H_
+#define _AST2400_PLATFORM_H_ 1
+
+#define AST_DRAM_BASE 0x40000000
+
+#define AST_SRAM_SIZE (SZ_16K*2)
+
+#define AST_OLD_SMC_BASE 0x10000000 /*Legacy BMC Static Memory */
+#define AST_OLD_SMC_CTRL_BASE 0x16000000 /*Legacy BMC Static Memory Ctrl*/
+
+#define AST_AHB_CTRL_BASE 0x1E600000 /* AHB CONTROLLER */
+
+#define AST_FMC_BASE 0x1E620000 /* NEW SMC CONTROLLER */
+#define AST_SPI_BASE 0x1E630000 /* SPI CONTROLLER */
+#define AST_MIC_BASE 0x1E640000 /* MIC CONTROLLER */
+#define AST_MAC0_BASE 0x1E660000 /* MAC1 */
+#define AST_MAC1_BASE 0x1E680000 /* MAC2 */
+
+#define AST_USB20_BASE 0x1E6A0000 /* USB 2.0 VIRTUAL HUB CONTROLLER */
+#define AST_EHCI_BASE 0x1E6A1000 /* USB 2.0 HOST CONTROLLER */
+#define AST_UHCI_BASE 0x1E6B0000 /* USB 1.1 HOST CONTROLLER */
+#define AST_VIC_BASE 0x1E6C0000 /* VIC */
+#define AST_SDMC_BASE 0x1E6E0000 /* SDRAM CTRL */
+#define AST_UDC11_BASE 0x1E6E1000 /* USB11 */
+#define AST_SCU_BASE 0x1E6E2000 /* SCU */
+#define AST_CRYPTO_BASE 0x1E6E3000 /* Crypto */
+#define AST_JTAG_BASE 0x1E6E4000 /* JTAG */
+#define AST_GRAPHIC_BASE 0x1E6E6000 /* Graphics */
+#define AST_XDMA_BASE 0x1E6E7000 /* XDMA */
+#define AST_MCTP_BASE 0x1E6E8000 /* MCTP */
+#define AST_ADC_BASE 0x1E6E9000 /* ADC */
+
+#define AST_LPC_PLUS_BASE 0x1E6EC000 /* LPC+ Controller */
+
+#define AST_VIDEO_BASE 0x1E700000 /* VIDEO ENGINE */
+#define AST_SRAM_BASE 0x1E720000 /* SRAM */
+#define AST_SDHC_BASE 0x1E740000 /* SDHC */
+#define AST_2D_BASE 0x1E760000 /* 2D */
+#define AST_GPIO_BASE 0x1E780000 /* GPIO */
+#define AST_RTC_BASE 0x1E781000 /* RTC */
+#define AST_TIMER_BASE 0x1E782000 /* TIMER #0~7*/
+#define AST_UART1_BASE 0x1E783000 /* UART1 */
+#define AST_UART0_BASE 0x1E784000 /* UART5 */
+#define AST_WDT_BASE 0x1E785000 /* WDT */
+#define AST_PWM_BASE 0x1E786000 /* PWM */
+#define AST_VUART0_BASE 0x1E787000 /* VUART1 */
+#define AST_PUART_BASE 0x1E788000 /* PUART */
+#define AST_LPC_BASE 0x1E789000 /* LPC */
+#define AST_MBX_BASE 0x1E789200 /* MailBox */
+#define AST_I2C_BASE 0x1E78A000 /* I2C */
+#define AST_PECI_BASE 0x1E78B000 /* PECI */
+#define AST_PCIARBITER_BASE 0x1E78C000 /* PCI ARBITER */
+#define AST_UART2_BASE 0x1E78D000 /* UART2 */
+#define AST_UART3_BASE 0x1E78E000 /* UART3 */
+#define AST_UART4_BASE 0x1E78F000 /* UART4 */
+#define AST_SPI0_MEM 0x30000000
+
+#define AST_LPC_PLUS_BRIDGE 0x70000000
+
+#define AST_LPC_BRIDGE 0x60000000
+
+
+#endif
diff --git a/arch/arm/mach-aspeed/include/mach/ast_gpio_irqs.h b/arch/arm/mach-aspeed/include/mach/ast_gpio_irqs.h
new file mode 100644
index 0000000..48d5ef6
--- /dev/null
+++ b/arch/arm/mach-aspeed/include/mach/ast_gpio_irqs.h
@@ -0,0 +1,276 @@
+/*
+ * file : gpio_irqs.h
+ *
+ * Copyright (C) 2012-2020 ASPEED Technology Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef _GPIO_IRQS_H_
+#define _GPIO_IRQS_H_ 1
+
+#if defined(CONFIG_ARCH_AST1010)
+#define GPIO_PORT_NUM 19
+#elif defined(CONFIG_ARCH_AST2000)
+#define GPIO_PORT_NUM 19
+#elif defined(CONFIG_ARCH_AST2100)
+#define GPIO_PORT_NUM 8
+#elif defined(CONFIG_ARCH_AST2200)
+#define GPIO_PORT_NUM 19
+#elif defined(CONFIG_ARCH_AST2300)
+#define GPIO_PORT_NUM 19
+#elif defined(CONFIG_ARCH_AST2400)
+#define GPIO_PORT_NUM 28
+#elif defined(CONFIG_ARCH_AST1520)
+#define GPIO_PORT_NUM 28
+#else
+#err "no define for gpio irqs.h"
+#endif
+
+
+#define IRQ_GPIOA0 (IRQ_GPIO_CHAIN_START + 0)
+#define IRQ_GPIOA1 (IRQ_GPIO_CHAIN_START + 1)
+#define IRQ_GPIOA2 (IRQ_GPIO_CHAIN_START + 2)
+#define IRQ_GPIOA3 (IRQ_GPIO_CHAIN_START + 3)
+#define IRQ_GPIOA4 (IRQ_GPIO_CHAIN_START + 4)
+#define IRQ_GPIOA5 (IRQ_GPIO_CHAIN_START + 5)
+#define IRQ_GPIOA6 (IRQ_GPIO_CHAIN_START + 6)
+#define IRQ_GPIOA7 (IRQ_GPIO_CHAIN_START + 7)
+#define IRQ_GPIOB0 (IRQ_GPIO_CHAIN_START + 8)
+#define IRQ_GPIOB1 (IRQ_GPIO_CHAIN_START + 9)
+#define IRQ_GPIOB2 (IRQ_GPIO_CHAIN_START + 10)
+#define IRQ_GPIOB3 (IRQ_GPIO_CHAIN_START + 11)
+#define IRQ_GPIOB4 (IRQ_GPIO_CHAIN_START + 12)
+#define IRQ_GPIOB5 (IRQ_GPIO_CHAIN_START + 13)
+#define IRQ_GPIOB6 (IRQ_GPIO_CHAIN_START + 14)
+#define IRQ_GPIOB7 (IRQ_GPIO_CHAIN_START + 15)
+#define IRQ_GPIOC0 (IRQ_GPIO_CHAIN_START + 16)
+#define IRQ_GPIOC1 (IRQ_GPIO_CHAIN_START + 17)
+#define IRQ_GPIOC2 (IRQ_GPIO_CHAIN_START + 18)
+#define IRQ_GPIOC3 (IRQ_GPIO_CHAIN_START + 19)
+#define IRQ_GPIOC4 (IRQ_GPIO_CHAIN_START + 20)
+#define IRQ_GPIOC5 (IRQ_GPIO_CHAIN_START + 21)
+#define IRQ_GPIOC6 (IRQ_GPIO_CHAIN_START + 22)
+#define IRQ_GPIOC7 (IRQ_GPIO_CHAIN_START + 23)
+#define IRQ_GPIOD0 (IRQ_GPIO_CHAIN_START + 24)
+#define IRQ_GPIOD1 (IRQ_GPIO_CHAIN_START + 25)
+#define IRQ_GPIOD2 (IRQ_GPIO_CHAIN_START + 26)
+#define IRQ_GPIOD3 (IRQ_GPIO_CHAIN_START + 27)
+#define IRQ_GPIOD4 (IRQ_GPIO_CHAIN_START + 28)
+#define IRQ_GPIOD5 (IRQ_GPIO_CHAIN_START + 29)
+#define IRQ_GPIOD6 (IRQ_GPIO_CHAIN_START + 30)
+#define IRQ_GPIOD7 (IRQ_GPIO_CHAIN_START + 31)
+#define IRQ_GPIOE0 (IRQ_GPIO_CHAIN_START + 32)
+#define IRQ_GPIOE1 (IRQ_GPIO_CHAIN_START + 33)
+#define IRQ_GPIOE2 (IRQ_GPIO_CHAIN_START + 34)
+#define IRQ_GPIOE3 (IRQ_GPIO_CHAIN_START + 35)
+#define IRQ_GPIOE4 (IRQ_GPIO_CHAIN_START + 36)
+#define IRQ_GPIOE5 (IRQ_GPIO_CHAIN_START + 37)
+#define IRQ_GPIOE6 (IRQ_GPIO_CHAIN_START + 38)
+#define IRQ_GPIOE7 (IRQ_GPIO_CHAIN_START + 39)
+#define IRQ_GPIOF0 (IRQ_GPIO_CHAIN_START + 40)
+#define IRQ_GPIOF1 (IRQ_GPIO_CHAIN_START + 41)
+#define IRQ_GPIOF2 (IRQ_GPIO_CHAIN_START + 42)
+#define IRQ_GPIOF3 (IRQ_GPIO_CHAIN_START + 43)
+#define IRQ_GPIOF4 (IRQ_GPIO_CHAIN_START + 44)
+#define IRQ_GPIOF5 (IRQ_GPIO_CHAIN_START + 45)
+#define IRQ_GPIOF6 (IRQ_GPIO_CHAIN_START + 46)
+#define IRQ_GPIOF7 (IRQ_GPIO_CHAIN_START + 47)
+#define IRQ_GPIOG0 (IRQ_GPIO_CHAIN_START + 48)
+#define IRQ_GPIOG1 (IRQ_GPIO_CHAIN_START + 49)
+#define IRQ_GPIOG2 (IRQ_GPIO_CHAIN_START + 50)
+#define IRQ_GPIOG3 (IRQ_GPIO_CHAIN_START + 51)
+#define IRQ_GPIOG4 (IRQ_GPIO_CHAIN_START + 52)
+#define IRQ_GPIOG5 (IRQ_GPIO_CHAIN_START + 53)
+#define IRQ_GPIOG6 (IRQ_GPIO_CHAIN_START + 54)
+#define IRQ_GPIOG7 (IRQ_GPIO_CHAIN_START + 55)
+#define IRQ_GPIOH0 (IRQ_GPIO_CHAIN_START + 56)
+#define IRQ_GPIOH1 (IRQ_GPIO_CHAIN_START + 57)
+#define IRQ_GPIOH2 (IRQ_GPIO_CHAIN_START + 58)
+#define IRQ_GPIOH3 (IRQ_GPIO_CHAIN_START + 59)
+#define IRQ_GPIOH4 (IRQ_GPIO_CHAIN_START + 60)
+#define IRQ_GPIOH5 (IRQ_GPIO_CHAIN_START + 61)
+#define IRQ_GPIOH6 (IRQ_GPIO_CHAIN_START + 62)
+#define IRQ_GPIOH7 (IRQ_GPIO_CHAIN_START + 63)
+
+#if defined(CONFIG_ARCH_AST2400) || defined(CONFIG_ARCH_AST2300) || defined(CONFIG_ARCH_AST1520)
+
+#define IRQ_GPIOI0 (IRQ_GPIO_CHAIN_START + 64)
+#define IRQ_GPIOI1 (IRQ_GPIO_CHAIN_START + 65)
+#define IRQ_GPIOI2 (IRQ_GPIO_CHAIN_START + 66)
+#define IRQ_GPIOI3 (IRQ_GPIO_CHAIN_START + 67)
+#define IRQ_GPIOI4 (IRQ_GPIO_CHAIN_START + 68)
+#define IRQ_GPIOI5 (IRQ_GPIO_CHAIN_START + 69)
+#define IRQ_GPIOI6 (IRQ_GPIO_CHAIN_START + 70)
+#define IRQ_GPIOI7 (IRQ_GPIO_CHAIN_START + 71)
+#define IRQ_GPIOJ0 (IRQ_GPIO_CHAIN_START + 72)
+#define IRQ_GPIOJ1 (IRQ_GPIO_CHAIN_START + 73)
+#define IRQ_GPIOJ2 (IRQ_GPIO_CHAIN_START + 74)
+#define IRQ_GPIOJ3 (IRQ_GPIO_CHAIN_START + 75)
+#define IRQ_GPIOJ4 (IRQ_GPIO_CHAIN_START + 76)
+#define IRQ_GPIOJ5 (IRQ_GPIO_CHAIN_START + 77)
+#define IRQ_GPIOJ6 (IRQ_GPIO_CHAIN_START + 78)
+#define IRQ_GPIOJ7 (IRQ_GPIO_CHAIN_START + 79)
+#define IRQ_GPIOK0 (IRQ_GPIO_CHAIN_START + 80)
+#define IRQ_GPIOK1 (IRQ_GPIO_CHAIN_START + 81)
+#define IRQ_GPIOK2 (IRQ_GPIO_CHAIN_START + 82)
+#define IRQ_GPIOK3 (IRQ_GPIO_CHAIN_START + 83)
+#define IRQ_GPIOK4 (IRQ_GPIO_CHAIN_START + 84)
+#define IRQ_GPIOK5 (IRQ_GPIO_CHAIN_START + 85)
+#define IRQ_GPIOK6 (IRQ_GPIO_CHAIN_START + 86)
+#define IRQ_GPIOK7 (IRQ_GPIO_CHAIN_START + 87)
+#define IRQ_GPIOL0 (IRQ_GPIO_CHAIN_START + 88)
+#define IRQ_GPIOL1 (IRQ_GPIO_CHAIN_START + 89)
+#define IRQ_GPIOL2 (IRQ_GPIO_CHAIN_START + 90)
+#define IRQ_GPIOL3 (IRQ_GPIO_CHAIN_START + 91)
+#define IRQ_GPIOL4 (IRQ_GPIO_CHAIN_START + 92)
+#define IRQ_GPIOL5 (IRQ_GPIO_CHAIN_START + 93)
+#define IRQ_GPIOL6 (IRQ_GPIO_CHAIN_START + 94)
+#define IRQ_GPIOL7 (IRQ_GPIO_CHAIN_START + 95)
+#define IRQ_GPIOM0 (IRQ_GPIO_CHAIN_START + 96)
+#define IRQ_GPIOM1 (IRQ_GPIO_CHAIN_START + 97)
+#define IRQ_GPIOM2 (IRQ_GPIO_CHAIN_START + 98)
+#define IRQ_GPIOM3 (IRQ_GPIO_CHAIN_START + 99)
+#define IRQ_GPIOM4 (IRQ_GPIO_CHAIN_START + 100)
+#define IRQ_GPIOM5 (IRQ_GPIO_CHAIN_START + 101)
+#define IRQ_GPIOM6 (IRQ_GPIO_CHAIN_START + 102)
+#define IRQ_GPIOM7 (IRQ_GPIO_CHAIN_START + 103)
+#define IRQ_GPION0 (IRQ_GPIO_CHAIN_START + 104)
+#define IRQ_GPION1 (IRQ_GPIO_CHAIN_START + 105)
+#define IRQ_GPION2 (IRQ_GPIO_CHAIN_START + 106)
+#define IRQ_GPION3 (IRQ_GPIO_CHAIN_START + 107)
+#define IRQ_GPION4 (IRQ_GPIO_CHAIN_START + 108)
+#define IRQ_GPION5 (IRQ_GPIO_CHAIN_START + 109)
+#define IRQ_GPION6 (IRQ_GPIO_CHAIN_START + 110)
+#define IRQ_GPION7 (IRQ_GPIO_CHAIN_START + 111)
+#define IRQ_GPIOO0 (IRQ_GPIO_CHAIN_START + 112)
+#define IRQ_GPIOO1 (IRQ_GPIO_CHAIN_START + 113)
+#define IRQ_GPIOO2 (IRQ_GPIO_CHAIN_START + 114)
+#define IRQ_GPIOO3 (IRQ_GPIO_CHAIN_START + 115)
+#define IRQ_GPIOO4 (IRQ_GPIO_CHAIN_START + 116)
+#define IRQ_GPIOO5 (IRQ_GPIO_CHAIN_START + 117)
+#define IRQ_GPIOO6 (IRQ_GPIO_CHAIN_START + 118)
+#define IRQ_GPIOO7 (IRQ_GPIO_CHAIN_START + 119)
+#define IRQ_GPIOP0 (IRQ_GPIO_CHAIN_START + 120)
+#define IRQ_GPIOP1 (IRQ_GPIO_CHAIN_START + 121)
+#define IRQ_GPIOP2 (IRQ_GPIO_CHAIN_START + 122)
+#define IRQ_GPIOP3 (IRQ_GPIO_CHAIN_START + 123)
+#define IRQ_GPIOP4 (IRQ_GPIO_CHAIN_START + 124)
+#define IRQ_GPIOP5 (IRQ_GPIO_CHAIN_START + 125)
+#define IRQ_GPIOP6 (IRQ_GPIO_CHAIN_START + 126)
+#define IRQ_GPIOP7 (IRQ_GPIO_CHAIN_START + 127)
+#define IRQ_GPIOQ0 (IRQ_GPIO_CHAIN_START + 128)
+#define IRQ_GPIOQ1 (IRQ_GPIO_CHAIN_START + 129)
+#define IRQ_GPIOQ2 (IRQ_GPIO_CHAIN_START + 130)
+#define IRQ_GPIOQ3 (IRQ_GPIO_CHAIN_START + 131)
+#define IRQ_GPIOQ4 (IRQ_GPIO_CHAIN_START + 132)
+#define IRQ_GPIOQ5 (IRQ_GPIO_CHAIN_START + 133)
+#define IRQ_GPIOQ6 (IRQ_GPIO_CHAIN_START + 134)
+#define IRQ_GPIOQ7 (IRQ_GPIO_CHAIN_START + 135)
+#define IRQ_GPIOR0 (IRQ_GPIO_CHAIN_START + 136)
+#define IRQ_GPIOR1 (IRQ_GPIO_CHAIN_START + 137)
+#define IRQ_GPIOR2 (IRQ_GPIO_CHAIN_START + 138)
+#define IRQ_GPIOR3 (IRQ_GPIO_CHAIN_START + 139)
+#define IRQ_GPIOR4 (IRQ_GPIO_CHAIN_START + 140)
+#define IRQ_GPIOR5 (IRQ_GPIO_CHAIN_START + 141)
+#define IRQ_GPIOR6 (IRQ_GPIO_CHAIN_START + 142)
+#define IRQ_GPIOR7 (IRQ_GPIO_CHAIN_START + 143)
+#define IRQ_GPIOS0 (IRQ_GPIO_CHAIN_START + 144)
+#define IRQ_GPIOS1 (IRQ_GPIO_CHAIN_START + 145)
+#define IRQ_GPIOS2 (IRQ_GPIO_CHAIN_START + 146)
+#define IRQ_GPIOS3 (IRQ_GPIO_CHAIN_START + 147)
+#define IRQ_GPIOS4 (IRQ_GPIO_CHAIN_START + 148)
+#define IRQ_GPIOS5 (IRQ_GPIO_CHAIN_START + 149)
+#define IRQ_GPIOS6 (IRQ_GPIO_CHAIN_START + 150)
+#define IRQ_GPIOS7 (IRQ_GPIO_CHAIN_START + 151)
+
+#if defined(CONFIG_ARCH_AST2400) || defined(CONFIG_ARCH_AST1520)
+
+#define IRQ_GPIOT0 (IRQ_GPIO_CHAIN_START + 152)
+#define IRQ_GPIOT1 (IRQ_GPIO_CHAIN_START + 153)
+#define IRQ_GPIOT2 (IRQ_GPIO_CHAIN_START + 154)
+#define IRQ_GPIOT3 (IRQ_GPIO_CHAIN_START + 155)
+#define IRQ_GPIOT4 (IRQ_GPIO_CHAIN_START + 156)
+#define IRQ_GPIOT5 (IRQ_GPIO_CHAIN_START + 157)
+#define IRQ_GPIOT6 (IRQ_GPIO_CHAIN_START + 158)
+#define IRQ_GPIOT7 (IRQ_GPIO_CHAIN_START + 159)
+#define IRQ_GPIOU0 (IRQ_GPIO_CHAIN_START + 161)
+#define IRQ_GPIOU1 (IRQ_GPIO_CHAIN_START + 162)
+#define IRQ_GPIOU2 (IRQ_GPIO_CHAIN_START + 163)
+#define IRQ_GPIOU3 (IRQ_GPIO_CHAIN_START + 164)
+#define IRQ_GPIOU4 (IRQ_GPIO_CHAIN_START + 165)
+#define IRQ_GPIOU5 (IRQ_GPIO_CHAIN_START + 166)
+#define IRQ_GPIOU6 (IRQ_GPIO_CHAIN_START + 167)
+#define IRQ_GPIOU7 (IRQ_GPIO_CHAIN_START + 168)
+#define IRQ_GPIOV0 (IRQ_GPIO_CHAIN_START + 169)
+#define IRQ_GPIOV1 (IRQ_GPIO_CHAIN_START + 170)
+#define IRQ_GPIOV2 (IRQ_GPIO_CHAIN_START + 171)
+#define IRQ_GPIOV3 (IRQ_GPIO_CHAIN_START + 172)
+#define IRQ_GPIOV4 (IRQ_GPIO_CHAIN_START + 173)
+#define IRQ_GPIOV5 (IRQ_GPIO_CHAIN_START + 174)
+#define IRQ_GPIOV6 (IRQ_GPIO_CHAIN_START + 175)
+#define IRQ_GPIOV7 (IRQ_GPIO_CHAIN_START + 176)
+#define IRQ_GPIOW0 (IRQ_GPIO_CHAIN_START + 177)
+#define IRQ_GPIOW1 (IRQ_GPIO_CHAIN_START + 178)
+#define IRQ_GPIOW2 (IRQ_GPIO_CHAIN_START + 179)
+#define IRQ_GPIOW3 (IRQ_GPIO_CHAIN_START + 181)
+#define IRQ_GPIOW4 (IRQ_GPIO_CHAIN_START + 182)
+#define IRQ_GPIOW5 (IRQ_GPIO_CHAIN_START + 183)
+#define IRQ_GPIOW6 (IRQ_GPIO_CHAIN_START + 184)
+#define IRQ_GPIOW7 (IRQ_GPIO_CHAIN_START + 185)
+#define IRQ_GPIOX0 (IRQ_GPIO_CHAIN_START + 186)
+#define IRQ_GPIOX1 (IRQ_GPIO_CHAIN_START + 187)
+#define IRQ_GPIOX2 (IRQ_GPIO_CHAIN_START + 188)
+#define IRQ_GPIOX3 (IRQ_GPIO_CHAIN_START + 189)
+#define IRQ_GPIOX4 (IRQ_GPIO_CHAIN_START + 190)
+#define IRQ_GPIOX5 (IRQ_GPIO_CHAIN_START + 191)
+#define IRQ_GPIOX6 (IRQ_GPIO_CHAIN_START + 192)
+#define IRQ_GPIOX7 (IRQ_GPIO_CHAIN_START + 193)
+#define IRQ_GPIOY0 (IRQ_GPIO_CHAIN_START + 194)
+#define IRQ_GPIOY1 (IRQ_GPIO_CHAIN_START + 195)
+#define IRQ_GPIOY2 (IRQ_GPIO_CHAIN_START + 196)
+#define IRQ_GPIOY3 (IRQ_GPIO_CHAIN_START + 197)
+#define IRQ_GPIOY4 (IRQ_GPIO_CHAIN_START + 198)
+#define IRQ_GPIOY5 (IRQ_GPIO_CHAIN_START + 199)
+#define IRQ_GPIOY6 (IRQ_GPIO_CHAIN_START + 200)
+#define IRQ_GPIOY7 (IRQ_GPIO_CHAIN_START + 201)
+#define IRQ_GPIOZ0 (IRQ_GPIO_CHAIN_START + 202)
+#define IRQ_GPIOZ1 (IRQ_GPIO_CHAIN_START + 203)
+#define IRQ_GPIOZ2 (IRQ_GPIO_CHAIN_START + 204)
+#define IRQ_GPIOZ3 (IRQ_GPIO_CHAIN_START + 205)
+#define IRQ_GPIOZ4 (IRQ_GPIO_CHAIN_START + 206)
+#define IRQ_GPIOZ5 (IRQ_GPIO_CHAIN_START + 207)
+#define IRQ_GPIOZ6 (IRQ_GPIO_CHAIN_START + 208)
+#define IRQ_GPIOZ7 (IRQ_GPIO_CHAIN_START + 209)
+#define IRQ_GPIOAA0 (IRQ_GPIO_CHAIN_START + 210)
+#define IRQ_GPIOAA1 (IRQ_GPIO_CHAIN_START + 211)
+#define IRQ_GPIOAA2 (IRQ_GPIO_CHAIN_START + 212)
+#define IRQ_GPIOAA3 (IRQ_GPIO_CHAIN_START + 213)
+#define IRQ_GPIOAA4 (IRQ_GPIO_CHAIN_START + 214)
+#define IRQ_GPIOAA5 (IRQ_GPIO_CHAIN_START + 215)
+#define IRQ_GPIOAA6 (IRQ_GPIO_CHAIN_START + 216)
+#define IRQ_GPIOAA7 (IRQ_GPIO_CHAIN_START + 217)
+#define IRQ_GPIOBB0 (IRQ_GPIO_CHAIN_START + 218)
+#define IRQ_GPIOBB1 (IRQ_GPIO_CHAIN_START + 219)
+#define IRQ_GPIOBB2 (IRQ_GPIO_CHAIN_START + 220)
+#define IRQ_GPIOBB3 (IRQ_GPIO_CHAIN_START + 221)
+#define IRQ_GPIOBB4 (IRQ_GPIO_CHAIN_START + 222)
+#define IRQ_GPIOBB5 (IRQ_GPIO_CHAIN_START + 223)
+#define IRQ_GPIOBB6 (IRQ_GPIO_CHAIN_START + 224)
+#define IRQ_GPIOBB7 (IRQ_GPIO_CHAIN_START + 225)
+#endif
+
+#endif
+#endif
diff --git a/arch/arm/mach-aspeed/include/mach/ast_kcs.h b/arch/arm/mach-aspeed/include/mach/ast_kcs.h
new file mode 100644
index 0000000..9bcd6fc
--- /dev/null
+++ b/arch/arm/mach-aspeed/include/mach/ast_kcs.h
@@ -0,0 +1,147 @@
+/****************************************************************
+ ** **
+ ** (C)Copyright 2006-2009, American Megatrends Inc. **
+ ** **
+ ** All Rights Reserved. **
+ ** **
+ ** 5555 Oakbrook Pkwy Suite 200, Norcross **
+ ** **
+ ** Georgia - 30093, USA. Phone-(770)-246-8600. **
+ ** **
+ ****************************************************************/
+
+/****************************************************************
+ *
+ * ast_kcs.h
+ * ASPEED AST2100/2050/2200/2150/2300 LPC controller KCS-related
+ * definitions, macros, prototypes
+ *
+*****************************************************************/
+
+#ifndef __AST_KCS_H__
+#define __AST_KCS_H__
+
+#define AST_KCS_REG_BASE 0x1E789000
+#define AST_KCS_REG_SIZE SZ_4K
+#define AST_KCS_IRQ 8
+
+#if defined SOC_AST2300
+#define AST_KCS_CHANNEL_NUM 4
+#else
+#define AST_KCS_CHANNEL_NUM 3
+#endif
+
+#define ERROR_STATE 0xC0
+
+/* channel 1 I/O port address : 0xCA0 0xCA4*/
+#define AST_KCS_ADR1_HI 0x0C
+#define AST_KCS_ADR1_LO 0xA0
+
+/* channel 2 I/O port address : 0xCA8 0xCAC*/
+#define AST_KCS_ADR2_HI 0x0C
+#define AST_KCS_ADR2_LO 0xA8
+
+/* channel 3 I/O port address : 0xCA2 0xCA3*/
+#define AST_KCS_ADR3_HI 0x0C
+#define AST_KCS_ADR3_LO 0xA2
+
+/* channel 4 I/O port address : 0xCA6 0xCA7 */
+#define AST_KCS_ADR4 0x0CA70CA6
+
+/* KCS-related registers of AST LPC controller */
+#define AST_LPC_HICR0 0x00
+#define AST_LPC_HICR1 0x04
+#define AST_LPC_HICR2 0x08
+#define AST_LPC_HICR3 0x0C
+#define AST_LPC_HICR4 0x10
+#define AST_LPC_LADR3H 0x14
+#define AST_LPC_LADR3L 0x18
+#define AST_LPC_LADR12H 0x1C
+#define AST_LPC_LADR12L 0x20
+#define AST_LPC_IDR1 0x24
+#define AST_LPC_IDR2 0x28
+#define AST_LPC_IDR3 0x2C
+#define AST_LPC_ODR1 0x30
+#define AST_LPC_ODR2 0x34
+#define AST_LPC_ODR3 0x38
+#define AST_LPC_STR1 0x3C
+#define AST_LPC_STR2 0x40
+#define AST_LPC_STR3 0x44
+#define AST_LPC_SIRQCR0 0x70
+#define AST_LPC_SIRQCR1 0x74
+#define AST_LPC_SIRQCR2 0x78
+#define AST_LPC_SIRQCR3 0x7C
+#define AST_LPC_HICR5 0x80
+#define AST_LPC_HICR6 0x84
+
+#if defined SOC_AST2300
+#define AST_LPC_HICRB 0x100
+#define AST_LPC_IDR4 0x114
+#define AST_LPC_ODR4 0x118
+#define AST_LPC_STR4 0x11C
+#define AST_LPC_LADR4 0x110
+#endif
+
+#define AST_LPC_IDR_CH(ch) (AST_LPC_IDR1 + (ch * 0x04))
+#define AST_LPC_ODR_CH(ch) (AST_LPC_ODR1 + (ch * 0x04))
+#define AST_LPC_STR_CH(ch) (AST_LPC_STR1 + (ch * 0x04))
+
+//#define AST_LPC_STR_CH(ch) (ch==3)?AST_LPC_STR4:(AST_LPC_STR1 + (ch * 0x04))
+
+/* bits of HICR0 */
+#define AST_LPC_HICR0_LPC3E 0x80
+#define AST_LPC_HICR0_LPC2E 0x40
+#define AST_LPC_HICR0_LPC1E 0x20
+#define AST_LPC_HICR0_SDWNE 0x08
+#define AST_LPC_HICR0_PMEE 0x04
+
+/* bits of HICR1 */
+#define AST_LPC_HICR1_LPCBSY 0x80
+#define AST_LPC_HICR1_CLKREQ 0x40
+#define AST_LPC_HICR1_IRQBSY 0x20
+#define AST_LPC_HICR1_LRSTB 0x10
+#define AST_LPC_HICR1_SDWNB 0x08
+#define AST_LPC_HICR1_PMEB 0x04
+
+/* bits of HICR2, interrupt control register */
+#define AST_LPC_HICR2_LRST 0x40
+#define AST_LPC_HICR2_SDWN 0x20
+#define AST_LPC_HICR2_ABRT 0x10
+#define AST_LPC_HICR2_IBFIE3 0x08
+#define AST_LPC_HICR2_IBFIE2 0x04
+#define AST_LPC_HICR2_IBFIE1 0x02
+#define AST_LPC_HICR2_ERRIE 0x01
+
+/* bits of HICR3, pin states regsiter */
+#define AST_LPC_HICR3_LFRAME 0x80
+#define AST_LPC_HICR3_CLKRUN 0x40
+#define AST_LPC_HICR3_SERIRQ 0x20
+#define AST_LPC_HICR3_LRESET 0x10
+#define AST_LPC_HICR3_LPCPD 0x08
+#define AST_LPC_HICR3_PME 0x04
+
+/* bits of HICR4, selection register */
+#define AST_LPC_HICR4_LADR12SEL 0x80
+#define AST_LPC_HICR4_KCSENBL 0x04
+#define AST_LPC_HICR4_BTENBL 0x01
+
+/* bits of STR[1:3], data full register */
+#define AST_LPC_STR_CD 0x08
+#define AST_LPC_STR_SMS_ATN 0x04
+#define AST_LPC_STR_IBFA 0x02
+#define AST_LPC_STR_OBFA 0x01
+
+/* bits of HICR6 */
+#define AST_LPC_HICR6_SNP1_STR 0x02
+#define AST_LPC_HICR6_SNP0_STR 0x01
+
+#if defined SOC_AST2300
+/* bits of HICRB */
+#define AST_LPC_HICRB0_KCS4E 0x01
+#define AST_LPC_HICRB0_KCS4INTE 0x02
+
+
+#endif
+
+#endif /* ! __AST_KCS_H__ */
+
diff --git a/arch/arm/mach-aspeed/include/mach/ast_lcd.h b/arch/arm/mach-aspeed/include/mach/ast_lcd.h
new file mode 100644
index 0000000..20963eb
--- /dev/null
+++ b/arch/arm/mach-aspeed/include/mach/ast_lcd.h
@@ -0,0 +1,61 @@
+ /********************************************************************************
+* File Name : drivers/video/ast_lcd.h
+* Author : Ryan Chen
+* Description : ASPEED LCD Panel Timing
+*
+* Copyright (C) ASPEED Tech. Inc.
+* This program is free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by the Free Software Foundation;
+* either version 2 of the License, or (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
+* without even the implied warranty of MERCHANTABILITY or
+* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+* History :
+* 1. 2012/12/27 Ryan Chen create this file
+*
+*
+********************************************************************************/
+#include <linux/fb.h>
+
+//# Define IO __ for control
+#define YUV_MODE 0x4630
+#define CHANGE_YUV_ADDR 0x4631
+#define CHANGE_ADDR 0x4632
+#define OVERSCAN 0x4634
+
+
+enum astfb_color_format {
+ ASTFB_COLOR_RGB565 = 0,
+ ASTFB_COLOR_RGB888,
+ ASTFB_COLOR_YUV444,
+ ASTFB_COLOR_YUV420,
+};
+
+struct aspeed_lcd_panel {
+ struct fb_videomode mode;
+ signed short width; /* width in mm */
+ signed short height; /* height in mm */
+};
+
+struct ast_monitor_info {
+ int status; //0: no data 1:get data
+ int type; //0:dvi 1:hdmi
+ struct fb_monspecs specs;
+ char edid[256];
+};
+
+struct ast_fb_plat_data {
+ u32 (*get_clk)(void);
+};
+
+int ast_vga_get_info(struct fb_info *fb_info);
+int ast_hdmi_get_info(struct fb_info *fb_info);
+void ast_hdmi_enable(int en);
+int vga_read_edid(void);
+
diff --git a/arch/arm/mach-aspeed/include/mach/ast_lpc_irqs.h b/arch/arm/mach-aspeed/include/mach/ast_lpc_irqs.h
new file mode 100644
index 0000000..bbb3878
--- /dev/null
+++ b/arch/arm/mach-aspeed/include/mach/ast_lpc_irqs.h
@@ -0,0 +1,34 @@
+/*
+ * arch/arm/plat-aspeed/include/plat/gpio_irqs.h
+ *
+ * Copyright (C) 2012-2020 ASPEED Technology Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef _LPC_IRQS_H_
+#define _LPC_IRQS_H_ 1
+
+#define AST_LPC_IRQ_NUM 7
+
+#define IRQ_KCS0 (IRQ_LPC_CHAIN_START + 0)
+#define IRQ_KCS1 (IRQ_LPC_CHAIN_START + 1)
+#define IRQ_KCS2 (IRQ_LPC_CHAIN_START + 2)
+#define IRQ_KCS3 (IRQ_LPC_CHAIN_START + 3)
+#define IRQ_KCS4 (IRQ_LPC_CHAIN_START + 4)
+#define IRQ_SNOOP0 (IRQ_LPC_CHAIN_START + 5)
+#define IRQ_SNOOP1 (IRQ_LPC_CHAIN_START + 6)
+
+#endif
diff --git a/arch/arm/mach-aspeed/include/mach/ast_pwm_techo.h b/arch/arm/mach-aspeed/include/mach/ast_pwm_techo.h
new file mode 100644
index 0000000..51d4ae3
--- /dev/null
+++ b/arch/arm/mach-aspeed/include/mach/ast_pwm_techo.h
@@ -0,0 +1,13 @@
+/*
+ * ast_pwm_techo_h
+ *
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or (at
+ * your option) any later version.
+ */
+struct ast_pwm_driver_data {
+ u32 (*get_pwm_clock)(void);
+};
+
diff --git a/arch/arm/mach-aspeed/include/mach/ast_spi.h b/arch/arm/mach-aspeed/include/mach/ast_spi.h
new file mode 100644
index 0000000..d612967
--- /dev/null
+++ b/arch/arm/mach-aspeed/include/mach/ast_spi.h
@@ -0,0 +1,14 @@
+/*
+ * ast_spi_h
+ *
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or (at
+ * your option) any later version.
+ */
+
+struct ast_spi_driver_data {
+ u32 (*get_div)(u32 max_speed_hz);
+ u16 num_chipselect;
+};
diff --git a/arch/arm/mach-aspeed/include/mach/ast_video.h b/arch/arm/mach-aspeed/include/mach/ast_video.h
new file mode 100644
index 0000000..18f9189
--- /dev/null
+++ b/arch/arm/mach-aspeed/include/mach/ast_video.h
@@ -0,0 +1,89 @@
+ /********************************************************************************
+* File Name : drivers/video/ast_video.h
+* Author : Ryan Chen
+* Description : ASPEED Video Engine
+*
+* Copyright (C) ASPEED Tech. Inc.
+* This program is free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by the Free Software Foundation;
+* either version 2 of the License, or (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
+* without even the implied warranty of MERCHANTABILITY or
+* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+* History :
+* 1. 2012/12/27 Ryan Chen create this file
+*
+*
+********************************************************************************/
+typedef enum ast_video_mode {
+ VIDEO_SINGLE_MODE = 0,
+ VIDEO_FRAME_MODE,
+ VIDEO_STREAM_MODE,
+} video_mode;
+
+//VR08[2]
+typedef enum ast_video_source {
+ VIDEO_SOURCE_UNKNOW = 0, //maybe memory .. TODO ...
+ VIDEO_SOURCE_INTERNAL,
+ VIDEO_SOURCE_EXTERNAL,
+} video_source;
+
+//VR08[5]
+typedef enum ast_vga_mode {
+ VIDEO_VGA_DIRECT_MODE = 0,
+ VIDEO_VGA_CAPTURE_MODE,
+} vga_mode;
+
+//VR08[4]
+typedef enum ast_video_dis_en {
+ VIDEO_EXT_DE_SIGNAL = 0,
+ VIDEO_INT_DE_SIGNAL,
+} display_enable;
+
+typedef enum video_compress_format {
+ VIDEO_YUV444 = 0,
+ VIDEO_YUV420,
+} compress_formate;
+
+typedef enum video_color_format {
+ VIDEO_COLOR_RGB565 = 0,
+ VIDEO_COLOR_RGB888,
+ VIDEO_COLOR_YUV444,
+ VIDEO_COLOR_YUV420,
+} color_formate;
+
+typedef enum vga_color_mode {
+ VGA_NO_SIGNAL = 0,
+ EGA_MODE,
+ VGA_MODE,
+ VGA_15BPP_MODE,
+ VGA_16BPP_MODE,
+ VGA_32BPP_MODE,
+} color_mode;
+
+typedef enum video_stage {
+ NONE,
+ POLARITY,
+ RESOLUTION,
+ INIT,
+ RUN,
+} stage;
+
+struct ast_video_plat_data {
+ u32 (*get_clk)(void);
+ void (*ctrl_reset)(void);
+ void (*vga_display)(u8 enable);
+ u32 (*get_vga_base)(void);
+ video_source input_source;
+ video_mode mode;
+ u8 rc4_enable;
+ u8 scaling;
+ compress_formate compress;
+};
+
diff --git a/arch/arm/mach-aspeed/include/mach/ast_wdt.h b/arch/arm/mach-aspeed/include/mach/ast_wdt.h
new file mode 100644
index 0000000..f9125a1
--- /dev/null
+++ b/arch/arm/mach-aspeed/include/mach/ast_wdt.h
@@ -0,0 +1,11 @@
+/*
+ * ast_wdt_h
+ *
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or (at
+ * your option) any later version.
+ */
+
+ extern void ast_wdt_reset_full(void);
diff --git a/arch/arm/mach-aspeed/include/mach/debug-macro.S b/arch/arm/mach-aspeed/include/mach/debug-macro.S
new file mode 100644
index 0000000..33fc879
--- /dev/null
+++ b/arch/arm/mach-aspeed/include/mach/debug-macro.S
@@ -0,0 +1,21 @@
+/* debug-macro.S
+ *
+ * Debugging macro include header
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+*/
+#include <mach/platform.h>
+#include <mach/hardware.h>
+
+ .macro addruart, rx, tmp
+ mrc p15, 0, \rx, c1, c0
+ tst \rx, #1 @ MMU enabled?
+ ldreq \rx, =AST_UART_BASE
+ ldrne \rx, =IO_ADDRESS(AST_UART_BASE)
+ .endm
+
+#define UART_SHIFT 2
+#include <asm/hardware/debug-8250.S>
diff --git a/arch/arm/mach-aspeed/include/mach/dma.h b/arch/arm/mach-aspeed/include/mach/dma.h
new file mode 100644
index 0000000..36c141d
--- /dev/null
+++ b/arch/arm/mach-aspeed/include/mach/dma.h
@@ -0,0 +1,25 @@
+/*
+ * dma.h
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+#ifndef __ASM_ARCH_DMA_H
+#define __ASM_ARCH_DMA_H
+
+#define MAX_DMA_ADDRESS 0xffffffff
+
+#define MAX_DMA_CHANNELS 0
+
+#endif /* _ASM_ARCH_DMA_H */
diff --git a/arch/arm/mach-aspeed/include/mach/entry-macro.S b/arch/arm/mach-aspeed/include/mach/entry-macro.S
new file mode 100644
index 0000000..88b4417
--- /dev/null
+++ b/arch/arm/mach-aspeed/include/mach/entry-macro.S
@@ -0,0 +1,191 @@
+/*
+ * entry-macro.S
+ *
+ * This file is licensed under the terms of the GNU General Public
+ * License version 2. This program is licensed "as is" without any
+ * warranty of any kind, whether express or implied.
+ */
+#include <mach/hardware.h>
+#include <mach/irqs.h>
+#include <mach/platform.h>
+#include <plat/regs-intr.h>
+
+ .macro disable_fiq
+ .endm
+
+ .macro get_irqnr_preamble, base, tmp
+ ldr \base, =IO_ADDRESS(AST_VIC_BASE)
+ .endm
+
+ .macro arch_ret_to_user, tmp1, tmp2
+ .endm
+#if 1
+
+#if defined(NEW_VIC)
+ .macro get_irqnr_and_base, irqnr, irqstat, base, tmp
+
+ ldr \tmp, =IO_ADDRESS(AST_SCU_BASE)
+ ldr \irqnr, [\tmp, #0x44]
+
+ cmp \irqnr, #0
+ beq 2000f
+
+1000: /* pass1 */
+ cmp \irqnr, #32
+ ble 1001f
+ ldr \tmp, =IO_ADDRESS(AST_VIC_BASE)
+ ldr \irqstat, [\tmp, #0x84]
+ sub \irqnr, \irqnr, #32
+ mov \tmp, #32
+ sub \tmp, \tmp, \irqnr
+ mov \irqstat, \irqstat, lsl \tmp /* mask uncompare parts */
+ mov \irqstat, \irqstat, lsr \tmp
+ mov \irqnr, #63
+ clz \tmp, \irqstat
+ cmp \tmp, #32
+ bne 3000f
+ mov \irqnr, #32
+1001:
+ ldr \tmp, =IO_ADDRESS(AST_VIC_BASE)
+ ldr \irqstat, [\tmp, #0x00]
+ mov \tmp, #32
+ sub \tmp, \tmp, \irqnr
+ mov \irqstat, \irqstat, lsl \tmp /* mask uncompare parts */
+ mov \irqstat, \irqstat, lsr \tmp
+ mov \irqnr, #31
+ clz \tmp, \irqstat
+ cmp \tmp, #32
+ bne 3000f
+
+2000: /* pass 2 */
+ ldr \tmp, =IO_ADDRESS(AST_VIC_BASE)
+ ldr \irqstat, [\tmp, #0x84]
+ mov \irqnr, #63
+ clz \tmp, \irqstat
+ cmp \tmp, #32
+ bne 3000f
+2001:
+ ldr \tmp, =IO_ADDRESS(AST_VIC_BASE)
+ ldr \irqstat, [\tmp, #0x00]
+ mov \irqnr, #31
+ clz \tmp, \irqstat
+ cmp \tmp, #32
+ beq 4000f /* not find */
+
+3000: /* find */
+ sub \irqnr, \irqnr, \tmp
+ ldr \tmp, =IO_ADDRESS(AST_SCU_BASE)
+ str \irqnr, [\tmp, #0x44]
+ cmp \irqnr, #64
+4000: /* done */
+ .endm
+#else
+ .macro get_irqnr_and_base, irqnr, irqstat, base, tmp
+/* FIXME: should not be using soo many LDRs here */
+ ldr \irqnr, =IO_ADDRESS(AST_VIC_BASE)
+ ldr \irqstat, [\irqnr, #ASPEED_VIC_STATUS_OFFSET] @ get masked status
+
+ mov \irqnr, #0
+1001: tst \irqstat, #1
+ bne 1002f
+ add \irqnr, \irqnr, #1
+ mov \irqstat, \irqstat, lsr #1
+ cmp \irqnr, #31
+ bcc 1001b
+1002: /* EQ will be set if we reach 31 */
+ .endm
+
+#endif
+#else
+
+ .macro get_irqnr_and_base, irqnr, irqstat, base, tmp
+
+ /*********************************************/
+ /* load VIC (VIC1) status value into irqstat */
+ /*********************************************/
+ ldr \irqnr, =IO_ADDRESS(MVP2_VIC_BASE)
+ ldr \irqstat, [\irqnr, #MVP2_VIC_STATUS_OFFSET]
+
+
+ /**********************************************/
+ /* check each status bit and start from bit 0 */
+ /**********************************************/
+ mov \irqnr, #0
+1000: tst \irqstat, #1 /* Check irqstat[irqnr] is 1 or not. */
+ bne 1100f /* If irqstat[irqnr] is 1, service */
+ /* this interrupt. */
+1001:
+ /* check next bit */
+ add \irqnr, \irqnr, #1
+ mov \irqstat, \irqstat, lsr #1
+
+ cmp \irqnr, #32 /* If irqnr is number 32, all bits on VIC1 */
+ beq 1300f /* have been checked and leave this macro. */
+ /* Note that the Zero bit should be 1. */
+
+ bne 1000b /* continue to check next bit */
+
+
+
+1100: ldr \irqstat, =INT_VIC2IRQ /* interrupt from VIC2? */
+ cmp \irqnr, \irqstat
+
+ bne 1300f /* Interupt isn't from VIC2 (i.e. irqnr != INT_VIC2IRQ). */
+ /* Leave this macro with irqnr isn't changed and keep Zero */
+ /* flag not set */
+
+
+ /***************************************/
+ /* load VIC2 status value into irqstat */
+ /***************************************/
+#if 0
+ ldr \irqnr, =IO_ADDRESS(MVP2_VIC2_BASE)
+ ldr \irqstat, [\irqnr, #MVP2_VIC_STATUS_OFFSET]
+#else
+ ldr \irqnr, =IO_ADDRESS(MVP2_VIC_BASE)
+ ldr \irqstat, =0x1000
+ add \irqnr, \irqnr, \irqstat
+ ldr \irqstat, [\irqnr, #MVP2_VIC_STATUS_OFFSET]
+#endif
+
+ /***********************************************/
+ /* Check each status bit and start from bit 0. */
+ /* Note that bit 0 in VIC2 is IRQ number 32. */
+ /***********************************************/
+ mov \irqnr, #32
+1200: tst \irqstat, #1
+ bne 1300f
+
+
+ /* check next bit */
+ add \irqnr, \irqnr, #1
+ mov \irqstat, \irqstat, lsr #1
+
+ cmp \irqnr, #64 /* If irqnr isn't reach 64 */
+ bne 1200b /* continue check irqstat. */
+
+
+
+ /*************************************************************************/
+ /* Examine all the other interrupt bits larger than INT_VIC2IRQ on VIC1. */
+ /*************************************************************************/
+ ldr \irqnr, =IO_ADDRESS(MVP2_VIC_BASE)
+ ldr \irqstat, [\irqnr, #MVP2_VIC_STATUS_OFFSET]
+ mov \irqnr, #INT_VIC2IRQ
+ mov \irqstat, \irqstat, lsr #INT_VIC2IRQ
+ b 1001b
+
+ /* TODO : if needed */
+ /* All interrupt bits on VIC2 have been checked and no bit with value */
+ /* 1 is found. Write 1 to EdgeClearReg[INT_VIC2IRQ] to clear interrupt. */
+
+1300:
+ .endm
+
+#endif
+
+
+
+ .macro irq_prio_table
+ .endm
+
diff --git a/arch/arm/mach-aspeed/include/mach/ftgmac100_drv.h b/arch/arm/mach-aspeed/include/mach/ftgmac100_drv.h
new file mode 100644
index 0000000..40a59e3
--- /dev/null
+++ b/arch/arm/mach-aspeed/include/mach/ftgmac100_drv.h
@@ -0,0 +1,18 @@
+/*
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or (at
+ * your option) any later version.
+ */
+
+/* store this information for the driver.. */
+
+struct ftgmac100_eth_data
+{
+ unsigned char dev_addr[6]; //MAC address
+ unsigned char phy_addr; //Phy Address
+ unsigned char phy_id; //Phy ID
+ unsigned char DF_support; //Defragment support
+ unsigned long NCSI_support;
+ unsigned long INTEL_NCSI_EVA_support;
+};
diff --git a/arch/arm/mach-aspeed/include/mach/gpio.h b/arch/arm/mach-aspeed/include/mach/gpio.h
new file mode 100644
index 0000000..9ff3863
--- /dev/null
+++ b/arch/arm/mach-aspeed/include/mach/gpio.h
@@ -0,0 +1,352 @@
+/*
+ * arch/arm/mach-aspeed/include/mach/gpio.h
+ *
+ * Support functions for ASPEED GPIO
+ *
+ * Copyright (C) 2012-2020 ASPEED Technology Inc.
+ * Written by Ryan Chen <ryan_chen@aspeedtech.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+
+#ifndef __ASM_ARCH_ASPEED_GPIO_H
+#define __ASM_ARCH_ASPEED_GPIO_H
+
+#include <linux/kernel.h>
+#include <mach/irqs.h>
+#include <plat/aspeed.h>
+
+/*************************************************************/
+#define GPIO_PORTA 0x0
+#define GPIO_PORTB 0x1
+#define GPIO_PORTC 0x2
+#define GPIO_PORTD 0x3
+#define GPIO_PORTE 0x4
+#define GPIO_PORTF 0x5
+#define GPIO_PORTG 0x6
+#define GPIO_PORTH 0x7
+#define GPIO_PORTI 0x8
+#define GPIO_PORTJ 0x9
+#define GPIO_PORTK 0xa
+#define GPIO_PORTL 0xb
+#define GPIO_PORTM 0xc
+#define GPIO_PORTN 0xd
+#define GPIO_PORTO 0xe
+#define GPIO_PORTP 0xf
+#define GPIO_PORTQ 0x10
+#define GPIO_PORTR 0x11
+#define GPIO_PORTS 0x12
+//AST2300 didn't have PORT TT
+#define GPIO_PORTT 0x13
+#if defined(AST_SOC_G4) || defined(CONFIG_AST2400_BMC)
+#define GPIO_PORTU 0x14
+#define GPIO_PORTV 0x15
+#define GPIO_PORTW 0x16
+#define GPIO_PORTX 0x17
+#define GPIO_PORTY 0x18
+#define GPIO_PORTZ 0x19
+#define GPIO_PORTAA 0x1a
+#define GPIO_PORTAB 0x1b
+#endif
+
+#define GPIO_PER_PORT_PIN_NUM 8
+
+#define GPIO_INPUT_MODE 0
+#define GPIO_OUTPUT_MODE 1
+
+#define GPIO_RISING_EDGE 1
+#define GPIO_FALLING_EDGE 0
+
+#define GPIO_LEVEL_HIGH 1
+#define GPIO_LEVEL_LOW 1
+
+#define GPIO_EDGE_MODE 0
+#define GPIO_LEVEL_MODE 1
+
+#define GPIO_EDGE_LEVEL_MODE 0
+#define GPIO_DUAL_EDGE_MODE 1
+
+#define GPIO_NO_DEBOUNCE 0
+#define GPIO_DEBOUNCE_TIMER0 2 //GPIO 50 as debounce timer
+#define GPIO_DEBOUNCE_TIMER1 1 //GPIO 54 as debounce timer
+#define GPIO_DEBOUNCE_TIMER2 3 //GPIO 58 as debounce timer
+
+#define GPIO_CMD_ARM 0
+#define GPIO_CMD_LPC 1
+#define GPIO_CMD_COPROCESSOR 2
+
+#define PIN_GPIOA0 (0)
+#define PIN_GPIOA1 (1)
+#define PIN_GPIOA2 (2)
+#define PIN_GPIOA3 (3)
+#define PIN_GPIOA4 (4)
+#define PIN_GPIOA5 (5)
+#define PIN_GPIOA6 (6)
+#define PIN_GPIOA7 (7)
+#define PIN_GPIOB0 (8)
+#define PIN_GPIOB1 (9)
+#define PIN_GPIOB2 (10)
+#define PIN_GPIOB3 (11)
+#define PIN_GPIOB4 (12)
+#define PIN_GPIOB5 (13)
+#define PIN_GPIOB6 (14)
+#define PIN_GPIOB7 (15)
+#define PIN_GPIOC0 (16)
+#define PIN_GPIOC1 (17)
+#define PIN_GPIOC2 (18)
+#define PIN_GPIOC3 (19)
+#define PIN_GPIOC4 (20)
+#define PIN_GPIOC5 (21)
+#define PIN_GPIOC6 (22)
+#define PIN_GPIOC7 (23)
+#define PIN_GPIOD0 (24)
+#define PIN_GPIOD1 (25)
+#define PIN_GPIOD2 (26)
+#define PIN_GPIOD3 (27)
+#define PIN_GPIOD4 (28)
+#define PIN_GPIOD5 (29)
+#define PIN_GPIOD6 (30)
+#define PIN_GPIOD7 (31)
+#define PIN_GPIOE0 (32)
+#define PIN_GPIOE1 (33)
+#define PIN_GPIOE2 (34)
+#define PIN_GPIOE3 (35)
+#define PIN_GPIOE4 (36)
+#define PIN_GPIOE5 (37)
+#define PIN_GPIOE6 (38)
+#define PIN_GPIOE7 (39)
+#define PIN_GPIOF0 (40)
+#define PIN_GPIOF1 (41)
+#define PIN_GPIOF2 (42)
+#define PIN_GPIOF3 (43)
+#define PIN_GPIOF4 (44)
+#define PIN_GPIOF5 (45)
+#define PIN_GPIOF6 (46)
+#define PIN_GPIOF7 (47)
+#define PIN_GPIOG0 (48)
+#define PIN_GPIOG1 (49)
+#define PIN_GPIOG2 (50)
+#define PIN_GPIOG3 (51)
+#define PIN_GPIOG4 (52)
+#define PIN_GPIOG5 (53)
+#define PIN_GPIOG6 (54)
+#define PIN_GPIOG7 (55)
+#define PIN_GPIOH0 (56)
+#define PIN_GPIOH1 (57)
+#define PIN_GPIOH2 (58)
+#define PIN_GPIOH3 (59)
+#define PIN_GPIOH4 (60)
+#define PIN_GPIOH5 (61)
+#define PIN_GPIOH6 (62)
+#define PIN_GPIOH7 (63)
+#define PIN_GPIOI0 (64)
+#define PIN_GPIOI1 (65)
+#define PIN_GPIOI2 (66)
+#define PIN_GPIOI3 (67)
+#define PIN_GPIOI4 (68)
+#define PIN_GPIOI5 (69)
+#define PIN_GPIOI6 (70)
+#define PIN_GPIOI7 (71)
+#define PIN_GPIOJ0 (72)
+#define PIN_GPIOJ1 (73)
+#define PIN_GPIOJ2 (74)
+#define PIN_GPIOJ3 (75)
+#define PIN_GPIOJ4 (76)
+#define PIN_GPIOJ5 (77)
+#define PIN_GPIOJ6 (78)
+#define PIN_GPIOJ7 (79)
+#define PIN_GPIOK0 (80)
+#define PIN_GPIOK1 (81)
+#define PIN_GPIOK2 (82)
+#define PIN_GPIOK3 (83)
+#define PIN_GPIOK4 (84)
+#define PIN_GPIOK5 (85)
+#define PIN_GPIOK6 (86)
+#define PIN_GPIOK7 (87)
+#define PIN_GPIOL0 (88)
+#define PIN_GPIOL1 (89)
+#define PIN_GPIOL2 (90)
+#define PIN_GPIOL3 (91)
+#define PIN_GPIOL4 (92)
+#define PIN_GPIOL5 (93)
+#define PIN_GPIOL6 (94)
+#define PIN_GPIOL7 (95)
+#define PIN_GPIOM0 (96)
+#define PIN_GPIOM1 (97)
+#define PIN_GPIOM2 (98)
+#define PIN_GPIOM3 (99)
+#define PIN_GPIOM4 (100)
+#define PIN_GPIOM5 (101)
+#define PIN_GPIOM6 (102)
+#define PIN_GPIOM7 (103)
+#define PIN_GPION0 (104)
+#define PIN_GPION1 (105)
+#define PIN_GPION2 (106)
+#define PIN_GPION3 (107)
+#define PIN_GPION4 (108)
+#define PIN_GPION5 (109)
+#define PIN_GPION6 (110)
+#define PIN_GPION7 (111)
+#define PIN_GPIOO0 (112)
+#define PIN_GPIOO1 (113)
+#define PIN_GPIOO2 (114)
+#define PIN_GPIOO3 (115)
+#define PIN_GPIOO4 (116)
+#define PIN_GPIOO5 (117)
+#define PIN_GPIOO6 (118)
+#define PIN_GPIOO7 (119)
+#define PIN_GPIOP0 (120)
+#define PIN_GPIOP1 (121)
+#define PIN_GPIOP2 (122)
+#define PIN_GPIOP3 (123)
+#define PIN_GPIOP4 (124)
+#define PIN_GPIOP5 (125)
+#define PIN_GPIOP6 (126)
+#define PIN_GPIOP7 (127)
+#define PIN_GPIOQ0 (128)
+#define PIN_GPIOQ1 (129)
+#define PIN_GPIOQ2 (130)
+#define PIN_GPIOQ3 (131)
+#define PIN_GPIOQ4 (132)
+#define PIN_GPIOQ5 (133)
+#define PIN_GPIOQ6 (134)
+#define PIN_GPIOQ7 (135)
+#define PIN_GPIOR0 (136)
+#define PIN_GPIOR1 (137)
+#define PIN_GPIOR2 (138)
+#define PIN_GPIOR3 (139)
+#define PIN_GPIOR4 (140)
+#define PIN_GPIOR5 (141)
+#define PIN_GPIOR6 (142)
+#define PIN_GPIOR7 (143)
+#define PIN_GPIOS0 (144)
+#define PIN_GPIOS1 (145)
+#define PIN_GPIOS2 (146)
+#define PIN_GPIOS3 (147)
+#define PIN_GPIOS4 (148)
+#define PIN_GPIOS5 (149)
+#define PIN_GPIOS6 (150)
+#define PIN_GPIOS7 (151)
+#if defined(AST_SOC_G4) || defined(CONFIG_AST2400_BMC)
+#define PIN_GPIOT0 (152)
+#define PIN_GPIOT1 (153)
+#define PIN_GPIOT2 (154)
+#define PIN_GPIOT3 (155)
+#define PIN_GPIOT4 (156)
+#define PIN_GPIOT5 (157)
+#define PIN_GPIOT6 (158)
+#define PIN_GPIOT7 (159)
+#define PIN_GPIOU0 (161)
+#define PIN_GPIOU1 (162)
+#define PIN_GPIOU2 (163)
+#define PIN_GPIOU3 (164)
+#define PIN_GPIOU4 (165)
+#define PIN_GPIOU5 (166)
+#define PIN_GPIOU6 (167)
+#define PIN_GPIOU7 (168)
+#define PIN_GPIOV0 (169)
+#define PIN_GPIOV1 (170)
+#define PIN_GPIOV2 (171)
+#define PIN_GPIOV3 (172)
+#define PIN_GPIOV4 (173)
+#define PIN_GPIOV5 (174)
+#define PIN_GPIOV6 (175)
+#define PIN_GPIOV7 (176)
+#define PIN_GPIOW0 (177)
+#define PIN_GPIOW1 (178)
+#define PIN_GPIOW2 (179)
+#define PIN_GPIOW3 (181)
+#define PIN_GPIOW4 (182)
+#define PIN_GPIOW5 (183)
+#define PIN_GPIOW6 (184)
+#define PIN_GPIOW7 (185)
+#define PIN_GPIOX0 (186)
+#define PIN_GPIOX1 (187)
+#define PIN_GPIOX2 (188)
+#define PIN_GPIOX3 (189)
+#define PIN_GPIOX4 (190)
+#define PIN_GPIOX5 (191)
+#define PIN_GPIOX6 (192)
+#define PIN_GPIOX7 (193)
+#define PIN_GPIOY0 (194)
+#define PIN_GPIOY1 (195)
+#define PIN_GPIOY2 (196)
+#define PIN_GPIOY3 (197)
+#define PIN_GPIOY4 (198)
+#define PIN_GPIOY5 (199)
+#define PIN_GPIOY6 (200)
+#define PIN_GPIOY7 (201)
+#define PIN_GPIOZ0 (202)
+#define PIN_GPIOZ1 (203)
+#define PIN_GPIOZ2 (204)
+#define PIN_GPIOZ3 (205)
+#define PIN_GPIOZ4 (206)
+#define PIN_GPIOZ5 (207)
+#define PIN_GPIOZ6 (208)
+#define PIN_GPIOZ7 (209)
+#define PIN_GPIOAA0 (210)
+#define PIN_GPIOAA1 (211)
+#define PIN_GPIOAA2 (212)
+#define PIN_GPIOAA3 (213)
+#define PIN_GPIOAA4 (214)
+#define PIN_GPIOAA5 (215)
+#define PIN_GPIOAA6 (216)
+#define PIN_GPIOAA7 (217)
+#define PIN_GPIOBB0 (218)
+#define PIN_GPIOBB1 (219)
+#define PIN_GPIOBB2 (220)
+#define PIN_GPIOBB3 (221)
+#define PIN_GPIOBB4 (222)
+#define PIN_GPIOBB5 (223)
+#define PIN_GPIOBB6 (224)
+#define PIN_GPIOBB7 (225)
+#endif
+/*************************************************************/
+#ifndef __ASSEMBLY__
+
+/* callable at any time */
+extern int ast_set_gpio_value(unsigned gpio_pin, int value);
+extern int ast_get_gpio_value(unsigned gpio_pin);
+
+/*-------------------------------------------------------------------------*/
+
+/* wrappers for "new style" GPIO calls. the old AT91-specfic ones should
+ * eventually be removed (along with this errno.h inclusion), and the
+ * gpio request/free calls should probably be implemented.
+ */
+
+//extern int gpio_direction_input(unsigned gpio);
+//extern int gpio_direction_output(unsigned gpio, int value);
+
+static inline int gpio_get_value(unsigned gpio)
+{
+ return ast_get_gpio_value(gpio);
+}
+
+static inline void gpio_set_value(unsigned gpio, int value)
+{
+ ast_set_gpio_value(gpio, value);
+}
+
+#include <asm-generic/gpio.h> /* cansleep wrappers */
+
+#define gpio_to_irq(gpio) (IRQ_GPIO_CHAIN_START + (gpio))
+#define irq_to_gpio(irq) ((irq) - IRQ_GPIO_CHAIN_START)
+
+#endif /* __ASSEMBLY__ */
+
+
+#endif
diff --git a/arch/arm/mach-aspeed/include/mach/hardware.h b/arch/arm/mach-aspeed/include/mach/hardware.h
new file mode 100644
index 0000000..be3f23d
--- /dev/null
+++ b/arch/arm/mach-aspeed/include/mach/hardware.h
@@ -0,0 +1,51 @@
+/*
+ * hardware.h
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+#ifndef __ASM_ARCH_HARDWARE_H
+#define __ASM_ARCH_HARDWARE_H
+
+#include <mach/platform.h>
+
+/*
+ * Where in virtual memory the IO devices (timers, system controllers
+ * and so on)
+ */
+
+#define IO_BASE 0xF8000000 // VA of IO
+/*#define IO_BASE2 0xE0000000 // VA of IO2 (AST1070) */
+
+#ifdef CONFIG_AST_PCIE_EXT
+#define ASPEED_IO_START2 AST_PCIE_WIN_BASE
+#else
+#define ASPEED_IO_START2 AST_LPC_BRIDGE
+#endif
+
+/* macro to get at IO space when running virtually */
+//#define IO_ADDRESS(x) (((x) >> 4) + IO_BASE)
+/*#define IO_ADDRESS(x) (x - 0x10000000 + IO_BASE) */
+#define IO_ADDRESS(x) (x - 0x1e600000 + IO_BASE)
+/*#define IO_ADDRESS2(x) (x - ASPEED_IO_START2 + IO_BASE2) */
+
+//PCIE
+#ifdef CONFIG_AST_PCIE
+#define PCIBIOS_MIN_IO 0x0
+#define PCIBIOS_MIN_MEM 0x0
+#define pcibios_assign_all_busses() 1
+#endif
+
+#endif /* __ASM_ARCH_HARDWARE_H END */
+
diff --git a/arch/arm/mach-aspeed/include/mach/io.h b/arch/arm/mach-aspeed/include/mach/io.h
new file mode 100644
index 0000000..baf86d2
--- /dev/null
+++ b/arch/arm/mach-aspeed/include/mach/io.h
@@ -0,0 +1,28 @@
+/*
+ * io.h
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+#ifndef __ASM_ARM_ARCH_IO_H
+#define __ASM_ARM_ARCH_IO_H
+
+#include <mach/hardware.h>
+#define IO_SPACE_LIMIT 0xffffffff
+
+#define __io(a) ((void __iomem *)(a))
+#define __mem_pci(a) (a)
+#define __mem_isa(a) (a)
+#endif
+
diff --git a/arch/arm/mach-aspeed/include/mach/irqs.h b/arch/arm/mach-aspeed/include/mach/irqs.h
new file mode 100644
index 0000000..d133251
--- /dev/null
+++ b/arch/arm/mach-aspeed/include/mach/irqs.h
@@ -0,0 +1,61 @@
+/*
+ * arch/arm/plat-aspeed/include/plat/irqs.h
+ *
+ * Copyright (C) 2012-2020 ASPEED Technology Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#include <plat/aspeed.h>
+
+#if defined(CONFIG_ARCH_AST1010)
+#include <mach/ast1010_irqs.h>
+#elif defined(CONFIG_ARCH_AST1510)
+#include <mach/ast1510_irqs.h>
+#elif defined(CONFIG_ARCH_AST1520)
+#include <mach/ast1520_irqs.h>
+#elif defined(CONFIG_ARCH_AST2000)
+#include <mach/ast2000_irqs.h>
+#elif defined(CONFIG_ARCH_AST2100)
+#include <mach/ast2100_irqs.h>
+#elif defined(CONFIG_ARCH_AST2200)
+#include <mach/ast2200_irqs.h>
+#elif defined(CONFIG_ARCH_AST2300)
+#include <mach/ast2300_irqs.h>
+#elif defined(CONFIG_ARCH_AST2400)
+#include <mach/ast2400_irqs.h>
+#elif defined(CONFIG_ARCH_AST2500)
+#include <mach/ast2500_irqs.h>
+#elif defined(CONFIG_ARCH_AST3100)
+#include <mach/ast3100_irqs.h>
+#elif defined(CONFIG_ARCH_AST3200)
+#include <mach/ast3200_irqs.h>
+#else
+#err "no define for irqs.h"
+#endif
+
+#include <mach/ast_gpio_irqs.h>
+//#include <mach/ast_lpc_irqs.h>
+
+/*********************************************************************************/
+//CVIC
+#if defined(CONFIG_ARCH_AST1070)
+//Companion chip irq
+#include <mach/ast1070_irqs.h>
+#endif
+
+#if defined(CONFIG_AST2400_BMC)
+#include <mach/ext_ast2400_irqs.h>
+#endif
diff --git a/arch/arm/mach-aspeed/include/mach/memory.h b/arch/arm/mach-aspeed/include/mach/memory.h
new file mode 100644
index 0000000..d9927b2
--- /dev/null
+++ b/arch/arm/mach-aspeed/include/mach/memory.h
@@ -0,0 +1,48 @@
+/*
+ * memory.h
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+#include <mach/platform.h>
+#include <plat/aspeed.h>
+
+#ifndef __ASM_ARCH_MEMORY_H
+#define __ASM_ARCH_MEMORY_H
+
+/*
+ * Physical DRAM offset.
+ */
+#if defined(AST_SOC_G3) || defined(AST_SOC_G4)
+#define PHYS_OFFSET UL(0x40000000)
+#define BUS_OFFSET UL(0x40000000)
+#elif defined(AST_SOC_G5)
+#define PHYS_OFFSET UL(0x80000000)
+#define BUS_OFFSET UL(0x80000000)
+#else
+#define PHYS_OFFSET UL(0x40000000)
+#define BUS_OFFSET UL(0x40000000)
+#endif
+
+/*
+ * Virtual view <-> DMA view memory address translations
+ * virt_to_bus: Used to translate the virtual address to an
+ * address suitable to be passed to set_dma_addr
+ * bus_to_virt: Used to convert an address for DMA operations
+ * to an address that the kernel can use.
+ */
+#define __virt_to_bus(x) (x - PAGE_OFFSET + BUS_OFFSET)
+#define __bus_to_virt(x) (x - BUS_OFFSET + PAGE_OFFSET)
+
+#endif
diff --git a/arch/arm/mach-aspeed/include/mach/platform.h b/arch/arm/mach-aspeed/include/mach/platform.h
new file mode 100644
index 0000000..afce81b
--- /dev/null
+++ b/arch/arm/mach-aspeed/include/mach/platform.h
@@ -0,0 +1,89 @@
+/*
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef _AST_PLATFORM_H_
+#define _AST_PLATFORM_H_ 1
+
+#define AST_PLL_25MHZ 25000000
+#define AST_PLL_24MHZ 24000000
+#define AST_PLL_12MHZ 12000000
+
+#define AST_IO_START 0x1E600000
+#define AST_IO_SIZE 0x00200000
+
+/*********************************************************************************/
+#if defined(CONFIG_ARCH_AST1520)
+#include <mach/ast1520_platform.h>
+#elif defined(CONFIG_ARCH_AST2000)
+#include <mach/ast2000_platform.h>
+#elif defined(CONFIG_ARCH_AST2100)
+#include <mach/ast2100_platform.h>
+#elif defined(CONFIG_ARCH_AST2200)
+#include <mach/ast2200_platform.h>
+#elif defined(CONFIG_ARCH_AST2300)
+#include <mach/ast2300_platform.h>
+#elif defined(CONFIG_ARCH_AST2400)
+#include <mach/ast2400_platform.h>
+#elif defined(CONFIG_ARCH_AST2500)
+#include <mach/ast2500_platform.h>
+#elif defined(CONFIG_ARCH_AST3200)
+#include <mach/ast3200_platform.h>
+#else
+#err "No define for platform.h"
+#endif
+/*********************************************************************************/
+/* Companion Base Address */
+#if defined(CONFIG_ARCH_AST1070)
+#include <mach/ast1070_platform.h>
+#endif
+/*********************************************************************************/
+#if defined(CONFIG_ARCH_AST2300) || defined(CONFIG_ARCH_AST2400)
+#define AST_CS0_DEF_BASE 0x20000000 /* CS0 */
+#define AST_CS1_DEF_BASE 0x24000000 /* CS1 */
+#define AST_CS2_DEF_BASE 0x26000000 /* CS2 */
+#define AST_CS3_DEF_BASE 0x28000000 /* CS3 */
+#define AST_CS4_DEF_BASE 0x2a000000 /* CS4 */
+
+#define AST_NOR_SIZE 0x01000000 /* AST2300 NOR size 16MB */
+#else
+#define AST_CS0_DEF_BASE 0x10000000 /* CS0 */
+#define AST_CS1_DEF_BASE 0x12000000 /* CS1 */
+#define AST_CS2_DEF_BASE 0x14000000 /* CS2 */
+#endif
+
+/*
+ * Watchdog
+ */
+#define AST_WDT_VA_BASE (IO_ADDRESS(AST_WDT_BASE))
+
+/*
+ * Console UART
+ */
+#ifdef CONFIG_WEDGE
+#define AST_UART_BASE AST_UART3_BASE
+#elif defined(CONFIG_WEDGE100)
+#define AST_UART_BASE AST_UART3_BASE
+#elif defined(CONFIG_YOSEMITE)
+#define AST_UART_BASE AST_UART0_BASE
+#elif defined(CONFIG_FBPLATFORM1)
+#define AST_UART_BASE AST_UART0_BASE
+#elif defined(CONFIG_ASUSPLATFORM)
+#define AST_UART_BASE AST_UART1_BASE
+#else
+#define AST_UART_BASE AST_UART0_BASE
+#endif
+
+#endif
diff --git a/arch/arm/mach-aspeed/include/mach/system.h b/arch/arm/mach-aspeed/include/mach/system.h
new file mode 100644
index 0000000..926268b
--- /dev/null
+++ b/arch/arm/mach-aspeed/include/mach/system.h
@@ -0,0 +1,44 @@
+/*
+ * system.h
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+#ifndef __ASM_ARCH_SYSTEM_H
+#define __ASM_ARCH_SYSTEM_H
+
+#include <mach/hardware.h>
+#include <asm/io.h>
+#include <mach/ast_wdt.h>
+
+static inline void arch_idle(void)
+{
+ /*
+ * This should do all the clock switching
+ * and wait for interrupt tricks
+ */
+ cpu_do_idle();
+}
+
+static inline void arch_reset(char mode)
+{
+ /*
+ * Use WDT to restart system
+ */
+#if defined(CONFIG_AST_WATCHDOG) || defined(CONFIG_AST_WATCHDOG_MODULE)
+ ast_wdt_reset_full();
+#endif
+}
+
+#endif
diff --git a/arch/arm/mach-aspeed/include/mach/time.h b/arch/arm/mach-aspeed/include/mach/time.h
new file mode 100644
index 0000000..973a0b0
--- /dev/null
+++ b/arch/arm/mach-aspeed/include/mach/time.h
@@ -0,0 +1,73 @@
+/*
+ * time.h
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+#include <asm/system.h>
+#include <asm/mach/time.h>
+#include <asm/param.h>
+
+/*
+ * How long is the timer interval?
+ */
+#define TIMER_INTERVAL (ASPEED_TIMER_CLKRATE / HZ)
+#define TIMER_RELOAD (TIMER_INTERVAL)
+#define TICKS2USECS(x) ((x) / TICKS_PER_uSEC)
+
+/*
+ * Timer
+ */
+#define ASPEED_TIMER0_OFFSET 0x0000 /* Timer0 Offset */
+#define ASPEED_TIMER1_OFFSET 0x0010 /* Timer1 Offset */
+#define ASPEED_TIMER2_OFFSET 0x0020 /* Timer2 Offset */
+#define ASPEED_TIMERRC_OFFSET 0x0030 /* Timer RC Offset */
+
+#define ASPEED_TIMER_CLKRATE (ASPEED_EXTCLK)
+#define ASPEED_EXTCLK (1*1000*1000) /* 1M */
+
+/*
+ * Ticks
+ */
+//#define TICKS_PER_uSEC 40 // IP Cam
+//#define TICKS_PER_uSEC 24 // FPGA
+#define TICKS_PER_uSEC 1 /* ASPEED_EXTCLK / 10 ^ 6 */
+
+#define mSEC_1 1000
+#define mSEC_5 (mSEC_1 * 5)
+#define mSEC_10 (mSEC_1 * 10)
+#define mSEC_25 (mSEC_1 * 25)
+#define SEC_1 (mSEC_1 * 1000)
+
+/*
+ * Timer Control
+ */
+#define TIMER0_ENABLE 0x0001
+#define TIMER1_ENABLE 0x0010
+#define TIMER2_ENABLE 0x0100
+
+#define TIMER0_RefExt 0x0002
+#define TIMER1_RefExt 0x0020
+#define TIMER2_RefExt 0x0200
+
+/*
+ * What does it look like?
+ */
+typedef struct TimerStruct {
+ unsigned long TimerValue;
+ unsigned long TimerLoad;
+ unsigned long TimerMatch1;
+ unsigned long TimerMatch2;
+} TimerStruct_t;
+
diff --git a/arch/arm/mach-aspeed/include/mach/timex.h b/arch/arm/mach-aspeed/include/mach/timex.h
new file mode 100644
index 0000000..e907a30
--- /dev/null
+++ b/arch/arm/mach-aspeed/include/mach/timex.h
@@ -0,0 +1,21 @@
+/*
+ * timex.h
+ *
+ * Integrator architecture timex specifications
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#define CLOCK_TICK_RATE (50000000 / 16)
diff --git a/arch/arm/mach-aspeed/include/mach/uncompress.h b/arch/arm/mach-aspeed/include/mach/uncompress.h
new file mode 100644
index 0000000..3be04b0
--- /dev/null
+++ b/arch/arm/mach-aspeed/include/mach/uncompress.h
@@ -0,0 +1,38 @@
+/*
+ * uncompress.h
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#ifndef __ASM_ARCH_UNCOMPRESS_H
+#define __ASM_ARCH_UNCOMPRESS_H
+
+#include <mach/platform.h>
+#include <mach/aspeed_serial.h>
+
+#define UART_PUT_CHAR (*(volatile unsigned char *)(AST_UART_BASE + UART_THR))
+#define UART_GET_LSR (*(volatile unsigned char *)(AST_UART_BASE + UART_LSR))
+
+static void putc(int c)
+{
+
+ /* wait for space in the UART's transmitter */
+ while (!(UART_GET_LSR & UART_LSR_THRE))
+ barrier();
+
+ /* send the character out. */
+ UART_PUT_CHAR = c;
+}
+
+static inline void flush(void)
+{
+ while (UART_GET_LSR & (1 << 3))
+ barrier();
+}
+
+#define arch_decomp_setup()
+#define arch_decomp_wdog()
+
+#endif /* __ASM_ARCH_UNCOMPRESS_H */
diff --git a/arch/arm/mach-aspeed/include/mach/vmalloc.h b/arch/arm/mach-aspeed/include/mach/vmalloc.h
new file mode 100644
index 0000000..bc1b471
--- /dev/null
+++ b/arch/arm/mach-aspeed/include/mach/vmalloc.h
@@ -0,0 +1,29 @@
+/*
+ * vmalloc.h
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/*
+ * Just any arbitrary offset to the start of the vmalloc VM area: the
+ * current 8MB value just means that there will be a 8MB "hole" after the
+ * physical memory until the kernel virtual memory starts. That means that
+ * any out-of-bounds memory accesses will hopefully be caught.
+ * The vmalloc() routines leaves a hole of 4kB between each vmalloced
+ * area for the same reason. ;)
+ */
+#if 0
+#define VMALLOC_OFFSET (8*1024*1024)
+#define VMALLOC_START (((unsigned long)high_memory + VMALLOC_OFFSET) & ~(VMALLOC_OFFSET-1))
+#define VMALLOC_VMADDR(x) ((unsigned long)(x))
+#define VMALLOC_END (PAGE_OFFSET + 0x20000000)
+#else
+#define VMALLOC_END 0xf8000000UL
+#endif
OpenPOWER on IntegriCloud