@@ -40,6 +40,9 @@ extern struct platform_device spear13xx_kbd_device;
extern struct platform_device spear13xx_nand_device;
extern struct platform_device spear13xx_ohci0_device;
extern struct platform_device spear13xx_ohci1_device;
+extern struct platform_device spear13xx_pcie_gadget0_device;
+extern struct platform_device spear13xx_pcie_gadget1_device;
+extern struct platform_device spear13xx_pcie_gadget2_device;
extern struct platform_device spear13xx_rtc_device;
extern struct platform_device spear13xx_sdhci_device;
extern struct platform_device spear13xx_smi_device;
@@ -60,7 +60,7 @@
#define SPEAR13XX_SYS_LOCATION (SPEAR13XX_SYSRAM0_BASE + 0x600)
#define SPEAR13XX_SYSRAM1_BASE UL(0xE0800000)
-#define SPEAR13XX_SYSRAM1_SIZE 0x00800000
+#define SPEAR13XX_SYSRAM1_SIZE 0x00001000
#define SPEAR13XX_CLCD_BASE UL(0xE1000000)
#define SPEAR13XX_C3_BASE UL(0xE1800000)
#define SPEAR13XX_GETH_BASE UL(0xE2000000)
@@ -52,6 +52,7 @@ static struct platform_device *plat_devs[] __initdata = {
&spear13xx_nand_device,
&spear13xx_ohci0_device,
&spear13xx_ohci1_device,
+ &spear13xx_pcie_gadget0_device,
&spear13xx_rtc_device,
&spear13xx_sdhci_device,
&spear13xx_smi_device,
@@ -53,6 +53,7 @@ static struct platform_device *plat_devs[] __initdata = {
&spear13xx_nand_device,
&spear13xx_ohci0_device,
&spear13xx_ohci1_device,
+ &spear13xx_pcie_gadget0_device,
&spear13xx_rtc_device,
&spear13xx_sdhci_device,
&spear13xx_smi_device,
@@ -429,6 +429,100 @@ struct platform_device spear13xx_sdhci_device = {
.resource = sdhci_resources,
};
+/* pcie gadget registration */
+static struct resource pcie_gadget0_resources[] = {
+ {
+ .start = SPEAR13XX_PCIE0_APP_BASE,
+ .end = SPEAR13XX_PCIE0_APP_BASE + SZ_8K - 1,
+ .flags = IORESOURCE_MEM,
+ }, {
+ .start = SPEAR13XX_PCIE0_BASE,
+ .end = SPEAR13XX_PCIE0_BASE + SZ_8K - 1,
+ .flags = IORESOURCE_MEM,
+ }, {
+ .start = IRQ_PCIE0,
+ .flags = IORESOURCE_IRQ,
+ },
+};
+
+/* pcie_gadget0_id defaults to 0, being static variable */
+static int pcie_gadget0_id;
+static u64 pcie_gadget0_dmamask = ~0;
+
+struct platform_device spear13xx_pcie_gadget0_device = {
+ .name = "pcie-gadget-spear",
+ .id = 0,
+ .dev = {
+ .coherent_dma_mask = ~0,
+ .dma_mask = &pcie_gadget0_dmamask,
+ .platform_data = &pcie_gadget0_id,
+ },
+ .num_resources = ARRAY_SIZE(pcie_gadget0_resources),
+ .resource = pcie_gadget0_resources,
+};
+
+static struct resource pcie_gadget1_resources[] = {
+ {
+ .start = SPEAR13XX_PCIE1_APP_BASE,
+ .end = SPEAR13XX_PCIE1_APP_BASE + SZ_8K - 1,
+ .flags = IORESOURCE_MEM,
+ }, {
+ .start = SPEAR13XX_PCIE1_BASE,
+ .end = SPEAR13XX_PCIE1_BASE + SZ_8K - 1,
+ .flags = IORESOURCE_MEM,
+ }, {
+ .start = IRQ_PCIE1,
+ .flags = IORESOURCE_IRQ,
+ },
+};
+
+/* pcie_gadget1_id defaults to 0, being static variable */
+static int pcie_gadget1_id;
+static u64 pcie_gadget1_dmamask = ~0;
+
+struct platform_device spear13xx_pcie_gadget1_device = {
+ .name = "pcie-gadget-spear",
+ .id = 1,
+ .dev = {
+ .coherent_dma_mask = ~0,
+ .dma_mask = &pcie_gadget1_dmamask,
+ .platform_data = &pcie_gadget1_id,
+ },
+ .num_resources = ARRAY_SIZE(pcie_gadget1_resources),
+ .resource = pcie_gadget1_resources,
+};
+
+static struct resource pcie_gadget2_resources[] = {
+ {
+ .start = SPEAR13XX_PCIE2_APP_BASE,
+ .end = SPEAR13XX_PCIE2_APP_BASE + SZ_8K - 1,
+ .flags = IORESOURCE_MEM,
+ }, {
+ .start = SPEAR13XX_PCIE2_BASE,
+ .end = SPEAR13XX_PCIE2_BASE + SZ_8K - 1,
+ .flags = IORESOURCE_MEM,
+ }, {
+ .start = IRQ_PCIE2,
+ .flags = IORESOURCE_IRQ,
+ },
+};
+
+/* pcie_gadget2_id defaults to 0, being static variable */
+static int pcie_gadget2_id;
+static u64 pcie_gadget2_dmamask = ~0;
+
+struct platform_device spear13xx_pcie_gadget2_device = {
+ .name = "pcie-gadget-spear",
+ .id = 2,
+ .dev = {
+ .coherent_dma_mask = ~0,
+ .dma_mask = &pcie_gadget2_dmamask,
+ .platform_data = &pcie_gadget2_id,
+ },
+ .num_resources = ARRAY_SIZE(pcie_gadget2_resources),
+ .resource = pcie_gadget2_resources,
+};
+
/* Do spear13xx familiy common initialization part here */
void __init spear13xx_init(void)
{