summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cleopatre/linux-2.6.25.10-spc300/arch/arm/mach-spc300/spc300.c3
-rw-r--r--cleopatre/linux-2.6.25.10-spc300/drivers/net/arm/synop3504.c11
-rw-r--r--cleopatre/linux-2.6.25.10-spc300/include/asm-arm/arch-spc300/.gitignore1
-rw-r--r--cleopatre/u-boot-1.1.6/include/asm-arm/arch-spc300/.gitignore1
-rw-r--r--common/include/asm/arch/ips/ahb2miu.h30
-rw-r--r--common/include/asm/arch/ips/hardware/ahb2miu.h57
-rw-r--r--common/include/asm/arch/ips/hardware/sys_apb.h5
7 files changed, 107 insertions, 1 deletions
diff --git a/cleopatre/linux-2.6.25.10-spc300/arch/arm/mach-spc300/spc300.c b/cleopatre/linux-2.6.25.10-spc300/arch/arm/mach-spc300/spc300.c
index 7e7bdfe231..dc7c048498 100644
--- a/cleopatre/linux-2.6.25.10-spc300/arch/arm/mach-spc300/spc300.c
+++ b/cleopatre/linux-2.6.25.10-spc300/arch/arm/mach-spc300/spc300.c
@@ -74,6 +74,9 @@ static struct map_desc spc300_io_desc[] __initdata = {
{ IO_ADDRESS(ARM_UART2_BASE) , __phys_to_pfn(ARM_UART2_BASE) , SZ_1K , MT_DEVICE },
{ IO_ADDRESS(SPI_BASE) , __phys_to_pfn(SPI_BASE) , SZ_1K , MT_DEVICE },
{ IO_ADDRESS(MARIA_REGBANK_BASE) , __phys_to_pfn(MARIA_REGBANK_BASE) , SZ_4K , MT_DEVICE },
+#ifdef CONFIG_CHIP_FEATURE_MIU_CTRL
+ { IO_ADDRESS(AHB2MIU_BASE) , __phys_to_pfn(AHB2MIU_BASE) , SZ_1K , MT_DEVICE },
+#endif
{ IO_ADDRESS(ARM_GPIO_BASE) , __phys_to_pfn(ARM_GPIO_BASE) , SZ_1K , MT_DEVICE },
{ IO_ADDRESS(ARM_WDT_BASE) , __phys_to_pfn(ARM_WDT_BASE) , SZ_1K , MT_DEVICE }
};
diff --git a/cleopatre/linux-2.6.25.10-spc300/drivers/net/arm/synop3504.c b/cleopatre/linux-2.6.25.10-spc300/drivers/net/arm/synop3504.c
index f2dd1e42d9..68f4cd2f69 100644
--- a/cleopatre/linux-2.6.25.10-spc300/drivers/net/arm/synop3504.c
+++ b/cleopatre/linux-2.6.25.10-spc300/drivers/net/arm/synop3504.c
@@ -54,6 +54,7 @@
#include <linux/kthread.h>
#include <net/seq_check.h>
#include <linux/if_vlan.h>
+#include <asm/arch/ips/ahb2miu.h>
#include "synop3504_hw.h"
#include "synop3504.h"
@@ -815,6 +816,7 @@ static int synop3504_tx(struct sk_buff *skb, struct net_device *dev)
tx->ring[n].addr1 = dma_map_single(NULL, skb->data, skb->len, DMA_TO_DEVICE);
tx->ring[n].status.val = 0;
+ barrier();
tx->ring[n].status.bf.dma_own = 1;
//Starting DMA transfert
@@ -941,6 +943,7 @@ reuse_buffer:
//Reset current descriptor status
rx->ring[n].status.val = 0;
+ barrier ();
rx->ring[n].status.bf.dma_own = 1;
//Increase head pointer and check end of ring
@@ -1004,10 +1007,11 @@ static void synop3504_tx_done(struct net_device *dev, enum tx_clean_buff clean)
dma_unmap_single(NULL, tx->ring[n].addr1, tx->skbs[n]->len, DMA_TO_DEVICE);
//Update the current buffer descriptor
- tx->ring[n].status.val = 0;
tx->ring[n].ctrl.val = 0;
tx->ring[n].ctrl.bf.addr2en = 1;
tx->ring[n].addr1 = 0;
+ barrier();
+ tx->ring[n].status.val = 0;
//Freeing skbuff
dev_kfree_skb_any(tx->skbs[n]);
@@ -1045,6 +1049,11 @@ static int synop3504_poll(struct napi_struct *napi, int budget)
do
{
+ //Flush AHB2MIU
+ AHB2MIU_FLUSH_REG_VA = AHB2MIU_BF (FLUSH_ETH1_DMA, 1);
+ while (AHB2MIU_BFEXT (FLUSH_ETH1_DMA, AHB2MIU_FLUSH_REG_VA))
+ ;
+
//Get IRQ status
SynopsysGetIntStatus(synop, &status);
//Suppress rx, tx states and error bits (not needed in this function)
diff --git a/cleopatre/linux-2.6.25.10-spc300/include/asm-arm/arch-spc300/.gitignore b/cleopatre/linux-2.6.25.10-spc300/include/asm-arm/arch-spc300/.gitignore
index a2ad947475..09d2b18c3e 100644
--- a/cleopatre/linux-2.6.25.10-spc300/include/asm-arm/arch-spc300/.gitignore
+++ b/cleopatre/linux-2.6.25.10-spc300/include/asm-arm/arch-spc300/.gitignore
@@ -25,6 +25,7 @@ ips/timer.h
ips/uart.h
ips/wdt.h
+ips/hardware/ahb2miu.h
ips/hardware/arm_apb.h
ips/hardware/arm_gpio.h
ips/hardware/arm_ictl.h
diff --git a/cleopatre/u-boot-1.1.6/include/asm-arm/arch-spc300/.gitignore b/cleopatre/u-boot-1.1.6/include/asm-arm/arch-spc300/.gitignore
index a2ad947475..09d2b18c3e 100644
--- a/cleopatre/u-boot-1.1.6/include/asm-arm/arch-spc300/.gitignore
+++ b/cleopatre/u-boot-1.1.6/include/asm-arm/arch-spc300/.gitignore
@@ -25,6 +25,7 @@ ips/timer.h
ips/uart.h
ips/wdt.h
+ips/hardware/ahb2miu.h
ips/hardware/arm_apb.h
ips/hardware/arm_gpio.h
ips/hardware/arm_ictl.h
diff --git a/common/include/asm/arch/ips/ahb2miu.h b/common/include/asm/arch/ips/ahb2miu.h
new file mode 100644
index 0000000000..95749b0282
--- /dev/null
+++ b/common/include/asm/arch/ips/ahb2miu.h
@@ -0,0 +1,30 @@
+/*
+ * include/asm/arch/ips/ahb2miu.h
+ *
+ * Copyright (C) 2012 MStar Semiconductor.
+ *
+ * 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,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+#ifndef __ASM_ARCH_IPS_AHB2MIU_H
+#define __ASM_ARCH_IPS_AHB2MIU_H
+
+#include <asm/arch/ips/ips_access.h>
+
+#ifndef __ASSEMBLY__
+/** Virtual Address for ahb2miu */
+#define AHB2MIU_FLUSH_REG_VA (*((volatile uint32_t *)(IO_ADDRESS(AHB2MIU_BASE) + AHB2MIU_FLUSH_REG_OFFSET)))
+#endif /* __ASSEMBLY__ */
+
+#endif /* __ASM_ARCH_IPS_AHB2MIU_H */
diff --git a/common/include/asm/arch/ips/hardware/ahb2miu.h b/common/include/asm/arch/ips/hardware/ahb2miu.h
new file mode 100644
index 0000000000..0219a26d87
--- /dev/null
+++ b/common/include/asm/arch/ips/hardware/ahb2miu.h
@@ -0,0 +1,57 @@
+/*
+ * include/asm/arch/ips/hardware/ahb2miu.h
+ *
+ * Copyright (C) 2012 MStar Semiconductor.
+ *
+ * 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,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+#ifndef __ASM_ARCH_IPS_HW_AHB2MIU_H
+#define __ASM_ARCH_IPS_HW_AHB2MIU_H
+
+#ifndef AHB2MIU_BASE
+ #error "AHB2MIU_BASE macro needs to be defined before including file ahb2miu.h"
+#endif
+
+#define AHB2MIU_FLUSH_REG_OFFSET (0x00)
+
+#define AHB2MIU_FLUSH_REG (AHB2MIU_BASE + AHB2MIU_FLUSH_REG_OFFSET)
+
+#define AHB2MIU_FLUSH_ARM_INST_MASK (0x1)
+#define AHB2MIU_FLUSH_ARM_INST_SHIFT (1)
+#define AHB2MIU_FLUSH_ARM_DATA_MASK (0x1)
+#define AHB2MIU_FLUSH_ARM_DATA_SHIFT (2)
+#define AHB2MIU_FLUSH_BRIDGE_DMA_MASK (0x1)
+#define AHB2MIU_FLUSH_BRIDGE_DMA_SHIFT (3)
+#define AHB2MIU_FLUSH_MODEM_MASK (0x1)
+#define AHB2MIU_FLUSH_MODEM_SHIFT (4)
+#define AHB2MIU_FLUSH_PHYCPU_MASK (0x1)
+#define AHB2MIU_FLUSH_PHYCPU_SHIFT (5)
+#define AHB2MIU_FLUSH_ETH2_DMA_MASK (0x1)
+#define AHB2MIU_FLUSH_ETH2_DMA_SHIFT (6)
+#define AHB2MIU_FLUSH_ETH1_DMA_MASK (0x1)
+#define AHB2MIU_FLUSH_ETH1_DMA_SHIFT (7)
+
+/* Bit manipulation macros. */
+#define AHB2MIU_BIT(name) \
+ (1 << AHB2MIU_##name##_SHIFT)
+#define AHB2MIU_BF(name,value) \
+ (((value) & (AHB2MIU_##name##_MASK)) << AHB2MIU_##name##_SHIFT)
+#define AHB2MIU_BFEXT(name,value) \
+ (((value) >> AHB2MIU_##name##_SHIFT) & (AHB2MIU_##name##_MASK))
+#define AHB2MIU_BFINS(name,value,old) \
+ ( ((old) & ~((AHB2MIU_##name##_MASK) << AHB2MIU_##name##_SHIFT)) \
+ | AHB2MIU_BF(name,value))
+
+#endif /* __ASM_ARCH_IPS_HW_AHB2MIU_H */
diff --git a/common/include/asm/arch/ips/hardware/sys_apb.h b/common/include/asm/arch/ips/hardware/sys_apb.h
index 9b839fe65c..4037c03e55 100644
--- a/common/include/asm/arch/ips/hardware/sys_apb.h
+++ b/common/include/asm/arch/ips/hardware/sys_apb.h
@@ -29,6 +29,11 @@
#include "i2s.h"
#endif
+#ifdef CONFIG_CHIP_FEATURE_MIU_CTRL
+#define AHB2MIU_BASE (SYS_APB_BASE)
+#include "ahb2miu.h"
+#endif
+
#ifdef CONFIG_CHIP_FEATURE_MPEGTS
#define MPEG_TS_BASE (SYS_APB_BASE+0x010000)
#include "mpeg_ts.h"