Skip to contentSkip to conversation

Blackfin update for 2.6.22-rc2

PATCH In review Bryan Wu 5 participants 43 messages May 21, 2007 – May 23, 2007

lore
Share & tools
lore

Bryan Wu

author
#0 lore raw

cover Blackfin update for 2.6.22-rc2

Lots of update for 2.6.22-rc2 and tested on STAMP537 board.

author
#1 lore raw

PATCH 1/32 Blackfin arch: Add Workaround for ANOMALY 05000257

From: Michael Hennerich <[email protected]>

---
 arch/blackfin/lib/ins.S           |   20 ++++++++++++++------
 arch/blackfin/mach-common/entry.S |    6 ++++++
 2 files changed, 20 insertions(+), 6 deletions(-)
arch/blackfin/lib/ins.S +14 -6
index 730d2b4..7d5e984 100644
@@ -29,6 +29,7 @@
  */
 
 #include <linux/linkage.h>
+#include <asm/blackfin.h>
 
 .align 2
 
@@ -39,11 +40,14 @@ ENTRY(_insl)
 	P2 = R2;	/* P2 = count */
 	SSYNC;
 	LSETUP( .Llong_loop_s, .Llong_loop_e) LC0 = P2;
-.Llong_loop_s: R0 = [P0];
-.Llong_loop_e: [P1++] = R0;
+.Llong_loop_s:  R0 = [P0];
+		[P1++] = R0;
+		NOP;
+.Llong_loop_e: 	NOP;
 	sti R3;
 	RTS;
 
+
 ENTRY(_insw)
 	P0 = R0;	/* P0 = port */
 	cli R3;
@@ -51,8 +55,10 @@ ENTRY(_insw)
 	P2 = R2;	/* P2 = count */
 	SSYNC;
 	LSETUP( .Lword_loop_s, .Lword_loop_e) LC0 = P2;
-.Lword_loop_s: R0 = W[P0];
-.Lword_loop_e: W[P1++] = R0;
+.Lword_loop_s:  R0 = W[P0];
+		W[P1++] = R0;
+		NOP;
+.Lword_loop_e: 	NOP;
 	sti R3;
 	RTS;
 
@@ -63,7 +69,9 @@ ENTRY(_insb)
 	P2 = R2;	/* P2 = count */
 	SSYNC;
 	LSETUP( .Lbyte_loop_s, .Lbyte_loop_e) LC0 = P2;
-.Lbyte_loop_s: R0 = B[P0];
-.Lbyte_loop_e: B[P1++] = R0;
+.Lbyte_loop_s:  R0 = B[P0];
+		B[P1++] = R0;
+		NOP;
+.Lbyte_loop_e:  NOP;
 	sti R3;
 	RTS;
arch/blackfin/mach-common/entry.S +6 -0
index 8eb0a90..e463733 100644
@@ -181,6 +181,12 @@ ENTRY(_ex_single_step)
 
 _return_from_exception:
 	DEBUG_START_HWTRACE
+#ifdef ANOMALY_05000257
+	R7=LC0;
+	LC0=R7;
+	R7=LC1;
+	LC1=R7;
+#endif
 	(R7:6,P5:4) = [sp++];
 	ASTAT = [sp++];
 	sp = retn;
Signature · 1 line
1.5.1.2
author
#2 lore raw

PATCH 2/32 Blackfin arch: add SPI MMC driver support on bf533-stamp, tested on STAMP-BF533

In reply to Bryan Wu
---
 arch/blackfin/mach-bf533/boards/stamp.c |   28 ++++++++++++++++++++++++++++
 1 files changed, 28 insertions(+), 0 deletions(-)
arch/blackfin/mach-bf533/boards/stamp.c +28 -0
index d7b3a5d..7d3dfcb 100644
@@ -164,6 +164,13 @@ static struct bfin5xx_spi_chip ad5304_chip_info = {
 };
 #endif
 
+#if defined(CONFIG_SPI_MMC) || defined(CONFIG_SPI_MMC_MODULE)
+static struct bfin5xx_spi_chip spi_mmc_chip_info = {
+	.enable_dma = 1,
+	.bits_per_word = 8,
+};
+#endif
+
 static struct spi_board_info bfin_spi_board_info[] __initdata = {
 #if defined(CONFIG_MTD_M25P80) || defined(CONFIG_MTD_M25P80_MODULE)
 	{
@@ -199,6 +206,27 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
 	},
 #endif
 
+#if defined(CONFIG_SPI_MMC) || defined(CONFIG_SPI_MMC_MODULE)
+	{
+		.modalias = "spi_mmc_dummy",
+		.max_speed_hz = 25000000,     /* max spi clock (SCK) speed in HZ */
+		.bus_num = 1,
+		.chip_select = 0,
+		.platform_data = NULL,
+		.controller_data = &spi_mmc_chip_info,
+		.mode = SPI_MODE_3,
+	},
+	{
+		.modalias = "spi_mmc",
+		.max_speed_hz = 25000000,     /* max spi clock (SCK) speed in HZ */
+		.bus_num = 1,
+		.chip_select = CONFIG_SPI_MMC_CS_CHAN,
+		.platform_data = NULL,
+		.controller_data = &spi_mmc_chip_info,
+		.mode = SPI_MODE_3,
+	},
+#endif
+
 #if defined(CONFIG_PBX)
 	{
 		.modalias	= "fxs-spi",
Signature · 1 line
1.5.1.2
author
#3 lore raw

PATCH 3/32 Blackfin arch: ISP1761 doesn't work for USB flash disk

In reply to Bryan Wu

From: Aubrey Li <[email protected]>

ZONE_DMA is required for some drivers subsystem, such as USB/SCSI.

---
 arch/blackfin/Kconfig   |    4 ++++
 arch/blackfin/mm/init.c |    3 ++-
 2 files changed, 6 insertions(+), 1 deletions(-)
arch/blackfin/Kconfig +4 -0
index d80e5b1..35b33a4 100644
@@ -25,6 +25,10 @@ config BLACKFIN
 	bool
 	default y
 
+config ZONE_DMA
+	bool
+	default y
+
 config BFIN
 	bool
 	default y
arch/blackfin/mm/init.c +2 -1
index 73f72ab..d6cf105 100644
@@ -116,7 +116,8 @@ void paging_init(void)
 	{
 		unsigned long zones_size[MAX_NR_ZONES] = { 0, };
 
-		zones_size[ZONE_NORMAL] = (end_mem - PAGE_OFFSET) >> PAGE_SHIFT;
+		zones_size[ZONE_DMA] = (end_mem - PAGE_OFFSET) >> PAGE_SHIFT;
+		zones_size[ZONE_NORMAL] = 0;
 #ifdef CONFIG_HIGHMEM
 		zones_size[ZONE_HIGHMEM] = 0;
 #endif
Signature · 1 line
1.5.1.2
author
#4 lore raw

PATCH 4/32 Blackfin arch: fix a few random warnings

In reply to Bryan Wu

From: Mike Frysinger <[email protected]>

---
 arch/blackfin/mach-bf537/cpu.c |   22 ++++++++++------------
 1 files changed, 10 insertions(+), 12 deletions(-)
arch/blackfin/mach-bf537/cpu.c +10 -12
index 2d83b7e..0442c4c 100644
@@ -43,13 +43,13 @@
 #define VCO1 (CONFIG_CLKIN_HZ*9)	/*99532800 */
 #define VCO(x) VCO##x
 
-#define FREQ(x) {VCO(x),VCO(x)/4},{VCO(x),VCO(x)/2},{VCO(x),VCO(x)}
+#define MFREQ(x) {VCO(x),VCO(x)/4},{VCO(x),VCO(x)/2},{VCO(x),VCO(x)}
 /* frequency */
 static struct cpufreq_frequency_table bf537_freq_table[] = {
-	FREQ(1),
-	FREQ(3),
+	MFREQ(1),
+	MFREQ(3),
 	{VCO4, VCO4 / 2}, {VCO4, VCO4},
-	FREQ(5),
+	MFREQ(5),
 	{0, CPUFREQ_TABLE_END},
 };
 
@@ -59,13 +59,14 @@ static struct cpufreq_frequency_table bf537_freq_table[] = {
  */
 static int bf537_getfreq(unsigned int cpu)
 {
-	unsigned long cclk_mhz, vco_mhz;
+	unsigned long cclk_mhz;
 
 	/* The driver only support single cpu */
 	if (cpu == 0)
 		dpmc_fops.ioctl(NULL, NULL, IOCTL_GET_CORECLOCK, &cclk_mhz);
 	else
 		cclk_mhz = -1;
+
 	return cclk_mhz;
 }
 
@@ -75,13 +76,12 @@ static int bf537_target(struct cpufreq_policy *policy,
 	unsigned long cclk_mhz;
 	unsigned long vco_mhz;
 	unsigned long flags;
-	unsigned int index, vco_index;
-	int i;
-
+	unsigned int index;
 	struct cpufreq_freqs freqs;
-	if (cpufreq_frequency_table_target
-	    (policy, bf537_freq_table, target_freq, relation, &index))
+
+	if (cpufreq_frequency_table_target(policy, bf537_freq_table, target_freq, relation, &index))
 		return -EINVAL;
+
 	cclk_mhz = bf537_freq_table[index].frequency;
 	vco_mhz = bf537_freq_table[index].index;
 
@@ -114,8 +114,6 @@ static int bf537_verify_speed(struct cpufreq_policy *policy)
 
 static int __init __bf537_cpu_init(struct cpufreq_policy *policy)
 {
-	int result;
-
 	if (policy->cpu != 0)
 		return -EINVAL;
 
Signature · 1 line
1.5.1.2
author
#5 lore raw

PATCH 5/32 Blackfin arch: Add configuration data for ISP176x on BF561

In reply to Bryan Wu

From: Michael Hennerich <[email protected]>

---
 arch/blackfin/mach-bf561/boards/ezkit.c |   49 +++++++++++++++++++++++++++++++
 1 files changed, 49 insertions(+), 0 deletions(-)
arch/blackfin/mach-bf561/boards/ezkit.c +49 -0
index 14eb4f9..e8d4058 100644
@@ -32,12 +32,61 @@
 #include <linux/spi/spi.h>
 #include <asm/irq.h>
 #include <asm/bfin5xx_spi.h>
+#include <linux/interrupt.h>
+#include <linux/irq.h>
 
 /*
  * Name the Board for the /proc/cpuinfo
  */
 char *bfin_board_name = "ADDS-BF561-EZKIT";
 
+#define ISP1761_BASE       0x2C0F0000
+#define ISP1761_IRQ        IRQ_PF10
+
+#if defined(CONFIG_USB_ISP1760_HCD) || defined(CONFIG_USB_ISP1760_HCD_MODULE)
+static struct resource bfin_isp1761_resources[] = {
+	[0] = {
+		.name	= "isp1761-regs",
+		.start  = ISP1761_BASE + 0x00000000,
+		.end    = ISP1761_BASE + 0x000fffff,
+		.flags  = IORESOURCE_MEM,
+	},
+	[1] = {
+		.start  = ISP1761_IRQ,
+		.end    = ISP1761_IRQ,
+		.flags  = IORESOURCE_IRQ,
+	},
+};
+
+static struct platform_device bfin_isp1761_device = {
+	.name           = "isp1761",
+	.id             = 0,
+	.num_resources  = ARRAY_SIZE(bfin_isp1761_resources),
+	.resource       = bfin_isp1761_resources,
+};
+
+static struct platform_device *bfin_isp1761_devices[] = {
+	&bfin_isp1761_device,
+};
+
+int __init bfin_isp1761_init(void)
+{
+	unsigned int num_devices=ARRAY_SIZE(bfin_isp1761_devices);
+
+	printk(KERN_INFO "%s(): registering device resources\n", __FUNCTION__);
+	set_irq_type(ISP1761_IRQ, IRQF_TRIGGER_FALLING);
+
+	return platform_add_devices(bfin_isp1761_devices, num_devices);
+}
+
+void __exit bfin_isp1761_exit(void)
+{
+	platform_device_unregister(&bfin_isp1761_device);
+}
+
+arch_initcall(bfin_isp1761_init);
+#endif
+
 /*
  *  USB-LAN EzExtender board
  *  Driver needs to know address, irq and flag pin.
Signature · 1 line
1.5.1.2
author
#6 lore raw

PATCH 6/32 Blackfin arch: mark a bunch of local functions as static

In reply to Bryan Wu

From: Mike Frysinger <[email protected]>

---
 arch/blackfin/kernel/bfin_dma_5xx.c |    2 +-
 arch/blackfin/kernel/bfin_gpio.c    |    7 +++----
 2 files changed, 4 insertions(+), 5 deletions(-)
arch/blackfin/kernel/bfin_dma_5xx.c +1 -1
index 8ea079e..1431424 100644
@@ -119,7 +119,7 @@ static void clear_dma_buffer(unsigned int channel)
 	SSYNC();
 }
 
-int __init blackfin_dma_init(void)
+static int __init blackfin_dma_init(void)
 {
 	int i;
 
arch/blackfin/kernel/bfin_gpio.c +3 -4
index e9f24a9..bc16252 100644
@@ -144,7 +144,7 @@ inline int check_gpio(unsigned short gpio)
 }
 
 #ifdef BF537_FAMILY
-void port_setup(unsigned short gpio, unsigned short usage)
+static void port_setup(unsigned short gpio, unsigned short usage)
 {
 	if (usage == GPIO_USAGE) {
 		if (*port_fer[gpio_bank(gpio)] & gpio_bit(gpio))
@@ -160,7 +160,7 @@ void port_setup(unsigned short gpio, unsigned short usage)
 #endif
 
 
-void default_gpio(unsigned short gpio)
+static void default_gpio(unsigned short gpio)
 {
 	unsigned short bank,bitmask;
 
@@ -177,8 +177,7 @@ void default_gpio(unsigned short gpio)
 	gpio_bankb[bank]->edge &= ~bitmask;
 }
 
-
-int __init bfin_gpio_init(void)
+static int __init bfin_gpio_init(void)
 {
 	int i;
 
Signature · 1 line
1.5.1.2
author
#7 lore raw

PATCH 7/32 Blackfin arch: Fix reserved map after we changed PORT_H definition

In reply to Bryan Wu

From: Michael Hennerich <[email protected]>

---
 arch/blackfin/kernel/bfin_gpio.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
arch/blackfin/kernel/bfin_gpio.c +2 -2
index bc16252..3f49fae 100644
@@ -188,9 +188,9 @@ static int __init bfin_gpio_init(void)
 
 #if defined(BF537_FAMILY) && (defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE))
 # if defined(CONFIG_BFIN_MAC_RMII)
-	reserved_map[PORT_H] = 0xC373;
+	reserved_map[gpio_bank(PORT_H)] = 0xC373;
 # else
-	reserved_map[PORT_H] = 0xFFFF;
+	reserved_map[gpio_bank(PORT_H)] = 0xFFFF;
 # endif
 #endif
 
Signature · 1 line
1.5.1.2
author
#8 lore raw

PATCH 8/32 Blackfin arch: Move write to VR_CTL closer to IDLE

In reply to Bryan Wu

From: Michael Hennerich <[email protected]>

---
 include/asm-blackfin/mach-bf533/cdefBF532.h |    6 ++++--
 include/asm-blackfin/mach-bf537/cdefBF534.h |    6 ++++--
 include/asm-blackfin/mach-bf561/cdefBF561.h |    6 ++++--
 3 files changed, 12 insertions(+), 6 deletions(-)
include/asm-blackfin/mach-bf533/cdefBF532.h +4 -2
index 1d7c494..521bdb4 100644
@@ -63,12 +63,14 @@ static __inline__ void bfin_write_VR_CTL(unsigned int val)
 {
 	unsigned long flags, iwr;
 
-	bfin_write16(VR_CTL, val);
-	__builtin_bfin_ssync();
 	/* Enable the PLL Wakeup bit in SIC IWR */
 	iwr = bfin_read32(SIC_IWR);
 	/* Only allow PPL Wakeup) */
 	bfin_write32(SIC_IWR, IWR_ENABLE(0));
+
+	bfin_write16(VR_CTL, val);
+	__builtin_bfin_ssync();
+
 	local_irq_save(flags);
 	asm("IDLE;");
 	local_irq_restore(flags);
include/asm-blackfin/mach-bf537/cdefBF534.h +4 -2
index 7b658c1..9a167f3 100644
@@ -51,12 +51,14 @@ static __inline__ void bfin_write_VR_CTL(unsigned int val)
 {
 	unsigned long flags, iwr;
 
-	bfin_write16(VR_CTL, val);
-	__builtin_bfin_ssync();
 	/* Enable the PLL Wakeup bit in SIC IWR */
 	iwr = bfin_read32(SIC_IWR);
 	/* Only allow PPL Wakeup) */
 	bfin_write32(SIC_IWR, IWR_ENABLE(0));
+
+	bfin_write16(VR_CTL, val);
+	__builtin_bfin_ssync();
+
 	local_irq_save(flags);
 	asm("IDLE;");
 	local_irq_restore(flags);
include/asm-blackfin/mach-bf561/cdefBF561.h +4 -2
index 5dc0ed8..b14f872 100644
@@ -59,12 +59,14 @@ static __inline__ void bfin_write_VR_CTL(unsigned int val)
 {
 	unsigned long flags, iwr;
 
-	bfin_write16(VR_CTL, val);
-	__builtin_bfin_ssync();
 	/* Enable the PLL Wakeup bit in SIC IWR */
 	iwr = bfin_read32(SICA_IWR0);
 	/* Only allow PPL Wakeup) */
 	bfin_write32(SICA_IWR0, IWR_ENABLE(0));
+
+	bfin_write16(VR_CTL, val);
+	__builtin_bfin_ssync();
+
 	local_irq_save(flags);
 	asm("IDLE;");
 	local_irq_restore(flags);
Signature · 1 line
1.5.1.2
author
#9 lore raw

PATCH 9/32 Blackfin arch: DMA operation cleanup

In reply to Bryan Wu

From: Michael Hennerich <[email protected]>

1) Disable Interrupts during DMA memcpy to avoid raise conditions.
2) Mark MDMA channel 0 as reserved, since were using it internally.
3) Add DMA based equivalents for insX and outsX.
4) Our insX and outsX only handles len <= 2^16.

---
 arch/blackfin/kernel/bfin_dma_5xx.c |  204 ++++++++++++++++++++++++++++++++++-
 include/asm-blackfin/io.h           |   20 +++-
 2 files changed, 214 insertions(+), 10 deletions(-)
arch/blackfin/kernel/bfin_dma_5xx.c +200 -4
index 1431424..1c344ac 100644
@@ -130,7 +130,9 @@ static int __init blackfin_dma_init(void)
 		dma_ch[i].regs = base_addr[i];
 		mutex_init(&(dma_ch[i].dmalock));
 	}
-
+	/* Mark MEMDMA Channel 0 as requested since we're using it internally */
+	dma_ch[CH_MEM_STREAM0_DEST].chan_status = DMA_CHANNEL_REQUESTED;
+	dma_ch[CH_MEM_STREAM0_SRC].chan_status = DMA_CHANNEL_REQUESTED;
 	return 0;
 }
 
@@ -598,9 +600,12 @@ void *dma_memcpy(void *dest, const void *src, size_t size)
 	int direction;	/* 1 - address decrease, 0 - address increase */
 	int flag_align;	/* 1 - address aligned,  0 - address unaligned */
 	int flag_2D;	/* 1 - 2D DMA needed,	 0 - 1D DMA needed */
+	unsigned long flags;
 
 	if (size <= 0)
 		return NULL;
+	
+	local_irq_save(flags);
 
 	if ((unsigned long)src < memory_end)
 		blackfin_dcache_flush_range((unsigned int)src,
@@ -725,6 +730,7 @@ void *dma_memcpy(void *dest, const void *src, size_t size)
 	if ((unsigned long)dest < memory_end)
 		blackfin_dcache_invalidate_range((unsigned int)dest,
 						 (unsigned int)(dest + size));
+	local_irq_restore(flags);
 
 	return dest;
 }
@@ -732,11 +738,201 @@ EXPORT_SYMBOL(dma_memcpy);
 
 void *safe_dma_memcpy(void *dest, const void *src, size_t size)
 {
-	int flags = 0;
 	void *addr;
-	local_irq_save(flags);
 	addr = dma_memcpy(dest, src, size);
-	local_irq_restore(flags);
 	return addr;
 }
 EXPORT_SYMBOL(safe_dma_memcpy);
+
+void dma_outsb(void __iomem *addr, const void *buf, unsigned short len)
+{
+
+	unsigned long flags;
+	
+	local_irq_save(flags);
+	
+	blackfin_dcache_flush_range((unsigned int)buf,(unsigned int)(buf) + len);
+
+   	bfin_write_MDMA_D0_START_ADDR(addr);
+	bfin_write_MDMA_D0_X_COUNT(len);
+	bfin_write_MDMA_D0_X_MODIFY(0);
+	bfin_write_MDMA_D0_IRQ_STATUS(DMA_DONE | DMA_ERR);
+
+	bfin_write_MDMA_S0_START_ADDR(buf);
+	bfin_write_MDMA_S0_X_COUNT(len);
+	bfin_write_MDMA_S0_X_MODIFY(1);
+	bfin_write_MDMA_S0_IRQ_STATUS(DMA_DONE | DMA_ERR);
+
+	bfin_write_MDMA_S0_CONFIG(DMAEN | WDSIZE_8);
+	bfin_write_MDMA_D0_CONFIG(WNR | DI_EN | DMAEN | WDSIZE_8);
+
+	while (!(bfin_read_MDMA_D0_IRQ_STATUS() & DMA_DONE));
+
+	bfin_write_MDMA_D0_IRQ_STATUS(DMA_DONE | DMA_ERR);
+
+	bfin_write_MDMA_S0_CONFIG(0);
+	bfin_write_MDMA_D0_CONFIG(0);
+	local_irq_restore(flags);
+
+}
+EXPORT_SYMBOL(dma_outsb);
+
+
+void dma_insb(const void __iomem *addr, void *buf, unsigned short len)
+{
+	unsigned long flags;
+		
+	local_irq_save(flags);
+   	bfin_write_MDMA_D0_START_ADDR(buf);
+	bfin_write_MDMA_D0_X_COUNT(len);
+	bfin_write_MDMA_D0_X_MODIFY(1);
+	bfin_write_MDMA_D0_IRQ_STATUS(DMA_DONE | DMA_ERR);
+
+	bfin_write_MDMA_S0_START_ADDR(addr);
+	bfin_write_MDMA_S0_X_COUNT(len);
+	bfin_write_MDMA_S0_X_MODIFY(0);
+	bfin_write_MDMA_S0_IRQ_STATUS(DMA_DONE | DMA_ERR);
+
+	bfin_write_MDMA_S0_CONFIG(DMAEN | WDSIZE_8);
+	bfin_write_MDMA_D0_CONFIG(WNR | DI_EN | DMAEN | WDSIZE_8);
+
+	blackfin_dcache_invalidate_range((unsigned int)buf, (unsigned int)(buf) + len);
+
+	while (!(bfin_read_MDMA_D0_IRQ_STATUS() & DMA_DONE));
+
+	bfin_write_MDMA_D0_IRQ_STATUS(DMA_DONE | DMA_ERR);
+
+	bfin_write_MDMA_S0_CONFIG(0);
+	bfin_write_MDMA_D0_CONFIG(0);
+	local_irq_restore(flags);
+
+}
+EXPORT_SYMBOL(dma_insb);
+
+void dma_outsw(void __iomem *addr, const void  *buf, unsigned short len)
+{
+	unsigned long flags;
+	
+	local_irq_save(flags);
+		
+	blackfin_dcache_flush_range((unsigned int)buf,(unsigned int)(buf) + len);
+
+   	bfin_write_MDMA_D0_START_ADDR(addr);
+	bfin_write_MDMA_D0_X_COUNT(len);
+	bfin_write_MDMA_D0_X_MODIFY(0);
+	bfin_write_MDMA_D0_IRQ_STATUS(DMA_DONE | DMA_ERR);
+
+	bfin_write_MDMA_S0_START_ADDR(buf);
+	bfin_write_MDMA_S0_X_COUNT(len);
+	bfin_write_MDMA_S0_X_MODIFY(2);
+	bfin_write_MDMA_S0_IRQ_STATUS(DMA_DONE | DMA_ERR);
+
+	bfin_write_MDMA_S0_CONFIG(DMAEN | WDSIZE_16);
+	bfin_write_MDMA_D0_CONFIG(WNR | DI_EN | DMAEN | WDSIZE_16);
+
+	while (!(bfin_read_MDMA_D0_IRQ_STATUS() & DMA_DONE));
+
+	bfin_write_MDMA_D0_IRQ_STATUS(DMA_DONE | DMA_ERR);
+
+	bfin_write_MDMA_S0_CONFIG(0);
+	bfin_write_MDMA_D0_CONFIG(0);
+	local_irq_restore(flags);
+
+}
+EXPORT_SYMBOL(dma_outsw);
+
+void dma_insw(const void __iomem *addr, void *buf, unsigned short len)
+{
+	unsigned long flags;
+		
+	local_irq_save(flags);
+	
+   	bfin_write_MDMA_D0_START_ADDR(buf);
+	bfin_write_MDMA_D0_X_COUNT(len);
+	bfin_write_MDMA_D0_X_MODIFY(2);
+	bfin_write_MDMA_D0_IRQ_STATUS(DMA_DONE | DMA_ERR);
+
+	bfin_write_MDMA_S0_START_ADDR(addr);
+	bfin_write_MDMA_S0_X_COUNT(len);
+	bfin_write_MDMA_S0_X_MODIFY(0);
+	bfin_write_MDMA_S0_IRQ_STATUS(DMA_DONE | DMA_ERR);
+
+	bfin_write_MDMA_S0_CONFIG(DMAEN | WDSIZE_16);
+	bfin_write_MDMA_D0_CONFIG(WNR | DI_EN | DMAEN | WDSIZE_16);
+
+	blackfin_dcache_invalidate_range((unsigned int)buf, (unsigned int)(buf) + len);
+
+	while (!(bfin_read_MDMA_D0_IRQ_STATUS() & DMA_DONE));
+
+	bfin_write_MDMA_D0_IRQ_STATUS(DMA_DONE | DMA_ERR);
+
+	bfin_write_MDMA_S0_CONFIG(0);
+	bfin_write_MDMA_D0_CONFIG(0);
+	local_irq_restore(flags);
+
+}
+EXPORT_SYMBOL(dma_insw);
+
+void dma_outsl(void __iomem *addr, const void *buf, unsigned short len)
+{
+	unsigned long flags;
+	
+	local_irq_save(flags);
+	
+	blackfin_dcache_flush_range((unsigned int)buf,(unsigned int)(buf) + len);
+
+   	bfin_write_MDMA_D0_START_ADDR(addr);
+	bfin_write_MDMA_D0_X_COUNT(len);
+	bfin_write_MDMA_D0_X_MODIFY(0);
+	bfin_write_MDMA_D0_IRQ_STATUS(DMA_DONE | DMA_ERR);
+
+	bfin_write_MDMA_S0_START_ADDR(buf);
+	bfin_write_MDMA_S0_X_COUNT(len);
+	bfin_write_MDMA_S0_X_MODIFY(4);
+	bfin_write_MDMA_S0_IRQ_STATUS(DMA_DONE | DMA_ERR);
+
+	bfin_write_MDMA_S0_CONFIG(DMAEN | WDSIZE_32);
+	bfin_write_MDMA_D0_CONFIG(WNR | DI_EN | DMAEN | WDSIZE_32);
+
+	while (!(bfin_read_MDMA_D0_IRQ_STATUS() & DMA_DONE));
+
+	bfin_write_MDMA_D0_IRQ_STATUS(DMA_DONE | DMA_ERR);
+
+	bfin_write_MDMA_S0_CONFIG(0);
+	bfin_write_MDMA_D0_CONFIG(0);
+	local_irq_restore(flags);
+
+}
+EXPORT_SYMBOL(dma_outsl);
+
+void dma_insl(const void __iomem *addr, void *buf, unsigned short len)
+{
+	unsigned long flags;
+	
+	local_irq_save(flags);
+	
+   	bfin_write_MDMA_D0_START_ADDR(buf);
+	bfin_write_MDMA_D0_X_COUNT(len);
+	bfin_write_MDMA_D0_X_MODIFY(4);
+	bfin_write_MDMA_D0_IRQ_STATUS(DMA_DONE | DMA_ERR);
+
+	bfin_write_MDMA_S0_START_ADDR(addr);
+	bfin_write_MDMA_S0_X_COUNT(len);
+	bfin_write_MDMA_S0_X_MODIFY(0);
+	bfin_write_MDMA_S0_IRQ_STATUS(DMA_DONE | DMA_ERR);
+
+	bfin_write_MDMA_S0_CONFIG(DMAEN | WDSIZE_32);
+	bfin_write_MDMA_D0_CONFIG(WNR | DI_EN | DMAEN | WDSIZE_32);
+
+	blackfin_dcache_invalidate_range((unsigned int)buf, (unsigned int)(buf) + len);
+
+	while (!(bfin_read_MDMA_D0_IRQ_STATUS() & DMA_DONE));
+
+	bfin_write_MDMA_D0_IRQ_STATUS(DMA_DONE | DMA_ERR);
+
+	bfin_write_MDMA_S0_CONFIG(0);
+	bfin_write_MDMA_D0_CONFIG(0);
+	local_irq_restore(flags);
+
+}
+EXPORT_SYMBOL(dma_insl);
include/asm-blackfin/io.h +14 -6
index 7e6995e..eac8bca 100644
@@ -115,13 +115,21 @@ static inline unsigned int readl(void __iomem *addr)
 
 #ifndef __ASSEMBLY__
 
-extern void outsb(void __iomem *port, const void *addr, unsigned long count);
-extern void outsw(void __iomem *port, const void *addr, unsigned long count);
-extern void outsl(void __iomem *port, const void *addr, unsigned long count);
+extern void outsb(void __iomem *port, const void *addr, unsigned short count);
+extern void outsw(void __iomem *port, const void *addr, unsigned short count);
+extern void outsl(void __iomem *port, const void *addr, unsigned short count);
 
-extern void insb(const void __iomem *port, void *addr, unsigned long count);
-extern void insw(const void __iomem *port, void *addr, unsigned long count);
-extern void insl(const void __iomem *port, void *addr, unsigned long count);
+extern void insb(const void __iomem *port, void *addr, unsigned short count);
+extern void insw(const void __iomem *port, void *addr, unsigned short count);
+extern void insl(const void __iomem *port, void *addr, unsigned short count);
+
+extern void dma_outsb(void __iomem *port, const void *addr, unsigned short count);
+extern void dma_outsw(void __iomem *port, const void *addr, unsigned short count);
+extern void dma_outsl(void __iomem *port, const void *addr, unsigned short count);
+
+extern void dma_insb(const void __iomem *port, void *addr, unsigned short count);
+extern void dma_insw(const void __iomem *port, void *addr, unsigned short count);
+extern void dma_insl(const void __iomem *port, void *addr, unsigned short count);
 
 /*
  * Map some physical address range into the kernel address space.
Signature · 1 line
1.5.1.2
author
#10 lore raw

PATCH 10/32 Blackfin arch: GPIO fix some defines

In reply to Bryan Wu

From: Michael Hennerich <[email protected]>

---
 include/asm-blackfin/gpio.h |   14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)
include/asm-blackfin/gpio.h +7 -7
index d16fe3c..aa0d550 100644
@@ -148,10 +148,6 @@
 
 #ifdef BF537_FAMILY
 #define MAX_BLACKFIN_GPIOS 48
-#define PORT_F 0
-#define PORT_G 1
-#define PORT_H 2
-#define PORT_J 3
 
 #define	GPIO_PF0	0
 #define	GPIO_PF1	1
@@ -202,13 +198,17 @@
 #define	GPIO_PH14      	46
 #define	GPIO_PH15      	47
 
+#define PORT_F GPIO_PF0
+#define PORT_G GPIO_PG0
+#define PORT_H GPIO_PH0
+
 #endif
 
 #ifdef BF561_FAMILY
 #define MAX_BLACKFIN_GPIOS 48
-#define PORT_FIO0 0
-#define PORT_FIO1 1
-#define PORT_FIO2 2
+#define PORT_FIO0 GPIO_0
+#define PORT_FIO1 GPIO_16
+#define PORT_FIO2 GPIO_32
 #endif
 
 #ifndef __ASSEMBLY__
Signature · 1 line
1.5.1.2
author
#11 lore raw

PATCH 11/32 Blackfin arch: fix trace output for FLAT binaries

In reply to Bryan Wu

From: Mike Frysinger <[email protected]>

---
 arch/blackfin/kernel/traps.c |   18 +++++++++++++-----
 1 files changed, 13 insertions(+), 5 deletions(-)
arch/blackfin/kernel/traps.c +13 -5
index 9556b73..9932ede 100644
@@ -59,9 +59,10 @@ static int printk_address(unsigned long address)
 	struct vm_list_struct *vml;
 	struct task_struct *p;
 	struct mm_struct *mm;
+	unsigned long offset;
 
 #ifdef CONFIG_KALLSYMS
-	unsigned long offset = 0, symsize;
+	unsigned long symsize;
 	const char *symname;
 	char *modname;
 	char *delim = ":";
@@ -106,12 +107,19 @@ static int printk_address(unsigned long address)
 					              sizeof(_tmpbuf));
 				}
 
+				/* FLAT does not have its text aligned to the start of
+				 * the map while FDPIC ELF does ...
+				 */
+				if (current->mm &&
+				    (address > current->mm->start_code) &&
+				    (address < current->mm->end_code))
+					offset = address - current->mm->start_code;
+				else
+					offset = (address - vma->vm_start) + (vma->vm_pgoff << PAGE_SHIFT);
+
 				write_unlock_irq(&tasklist_lock);
 				return printk("<0x%p> [ %s + 0x%lx ]",
-				              (void*)address, name,
-				              (unsigned long)
-				                ((address - vma->vm_start) +
-				                 (vma->vm_pgoff << PAGE_SHIFT)));
+				              (void*)address, name, offset);
 			}
 
 			vml = vml->next;
Signature · 1 line
1.5.1.2
author
#12 lore raw

PATCH 12/32 Blackfin arch: Fix bug using usb keyboard crashes kernel

In reply to Bryan Wu

From: Michael Hennerich <[email protected]>

---
 arch/blackfin/kernel/setup.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
arch/blackfin/kernel/setup.c +3 -1
index 342bb8d..c456ee5 100644
@@ -33,7 +33,6 @@
 #include <linux/seq_file.h>
 #include <linux/cpu.h>
 #include <linux/module.h>
-#include <linux/console.h>
 #include <linux/tty.h>
 
 #include <linux/ext2_fs.h>
@@ -175,6 +174,9 @@ void __init setup_arch(char **cmdline_p)
 	unsigned long mtd_phys = 0;
 #endif
 
+#ifdef CONFIG_DUMMY_CONSOLE
+	conswitchp = &dummy_con;
+#endif
 	cclk = get_cclk();
 	sclk = get_sclk();
 
Signature · 1 line
1.5.1.2
#13 lore raw

Re: [PATCH 12/32] Blackfin arch: Fix bug using usb keyboard crashes kernel

Hi Bryan,

arch/blackfin/kernel/setup.c void __init setup_arch(char **cmdline_p) · line 181

Quoted 5 lines · Bryan Wu
arch/blackfin/kernel/setup.c +3 -0
+#ifdef CONFIG_DUMMY_CONSOLE
+       conswitchp = &dummy_con;
+#endif
        cclk = get_cclk();
        sclk = get_sclk();

This patch has no changelog. While it is probably apparent to you why this fixes a crash when using an USB keyboard, it would be nice for the rest of us to know which crash it fixes and why.

author
#14 lore raw

PATCH 13/32 Blackfin arch: initial tepla-bf561 board support

In reply to Bryan Wu

From: Mike Frysinger <[email protected]>

---
 arch/blackfin/Kconfig                    |    8 +++-
 arch/blackfin/mach-bf561/boards/Makefile |    3 +-
 arch/blackfin/mach-bf561/boards/tepla.c  |   61 ++++++++++++++++++++++++++++++
 3 files changed, 70 insertions(+), 2 deletions(-)
 create mode 100644 arch/blackfin/mach-bf561/boards/tepla.c
arch/blackfin/Kconfig +7 -1
index 35b33a4..b1b111b 100644
@@ -193,7 +193,7 @@ config BFIN537_BLUETECHNIX_CM
 	  CM-BF537 support for EVAL- and DEV-Board.
 
 config BFIN561_BLUETECHNIX_CM
-	bool "BF561-CM"
+	bool "Bluetechnix CM-BF561"
 	depends on (BF561)
 	help
 	  CM-BF561 support for EVAL- and DEV-Board.
@@ -204,6 +204,12 @@ config BFIN561_EZKIT
 	help
 	  BF561-EZKIT-LITE board Support.
 
+config BFIN561_TEPLA
+	bool "BF561-TEPLA"
+	depends on (BF561)
+	help
+	 BF561-TEPLA board Support.
+
 config PNAV10
 	bool "PNAV 1.0 board"
 	depends on (BF537)
arch/blackfin/mach-bf561/boards/Makefile +2 -1
index 886edc7..495a1cf 100644
@@ -3,5 +3,6 @@
 #
 
 obj-$(CONFIG_GENERIC_BOARD)            += generic_board.o
-obj-$(CONFIG_BFIN561_EZKIT)            += ezkit.o
 obj-$(CONFIG_BFIN561_BLUETECHNIX_CM)   += cm_bf561.o
+obj-$(CONFIG_BFIN561_EZKIT)            += ezkit.o
+obj-$(CONFIG_BFIN561_TEPLA)            += tepla.o
arch/blackfin/mach-bf561/boards/tepla.c new file +61 -0

61 lines not on this page · raw message

Signature · 1 line
1.5.1.2
author
#15 lore raw

PATCH 14/32 Blackfin arch: make sure we declare the revid functions as pure (since they are)

In reply to Bryan Wu

From: Mike Frysinger <[email protected]>

---
 include/asm-blackfin/processor.h |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
include/asm-blackfin/processor.h +2 -2
index 0336ff1..aba2b30 100644
@@ -104,13 +104,13 @@ unsigned long get_wchan(struct task_struct *p);
 #define cpu_relax()    	barrier()
 
 /* Get the Silicon Revision of the chip */
-static inline uint32_t bfin_revid(void)
+static inline __attribute_pure__ uint32_t bfin_revid(void)
 {
 	/* stored in the upper 4 bits */
 	return bfin_read_CHIPID() >> 28;
 }
 
-static inline uint32_t bfin_compiled_revid(void)
+static inline __attribute_pure__ uint32_t bfin_compiled_revid(void)
 {
 #if defined(CONFIG_BF_REV_0_0)
 	return 0;
Signature · 1 line
1.5.1.2
author
#16 lore raw

PATCH 15/32 Blackfin arch: dont clear status register bits in SWRST so we can actually use it

In reply to Bryan Wu

From: Mike Frysinger <[email protected]>

---
 arch/blackfin/mach-bf533/head.S |    6 ------
 arch/blackfin/mach-bf537/head.S |    6 ------
 arch/blackfin/mach-bf561/head.S |    6 ------
 3 files changed, 0 insertions(+), 18 deletions(-)
arch/blackfin/mach-bf533/head.S +0 -6
index 4808edb..7cb8258 100644
@@ -468,12 +468,6 @@ ENTRY(_bfin_reset)
 	w[p0] = r0.l;
 #endif
 
-	/* Clear the bits 13-15 in SWRST if they werent cleared */
-	p0.h = hi(SWRST);
-	p0.l = lo(SWRST);
-	csync;
-	r0.l = w[p0];
-
 	/* Clear the IMASK register */
 	p0.h = hi(IMASK);
 	p0.l = lo(IMASK);
arch/blackfin/mach-bf537/head.S +0 -6
index d104e1d..de78e42 100644
@@ -504,12 +504,6 @@ _delay_lab1_end:
 	nop;
 #endif
 
-	/* Clear the bits 13-15 in SWRST if they werent cleared */
-	p0.h = hi(SWRST);
-	p0.l = lo(SWRST);
-	csync;
-	r0.l = w[p0];
-
 	/* Clear the IMASK register */
 	p0.h = hi(IMASK);
 	p0.l = lo(IMASK);
arch/blackfin/mach-bf561/head.S +0 -6
index 7bca478..462c39e 100644
@@ -414,12 +414,6 @@ ENTRY(_bfin_reset)
 	w[p0] = r0.l;
 #endif
 
-	/* Clear the bits 13-15 in SWRST if they werent cleared */
-	p0.h = hi(SICA_SWRST);
-	p0.l = lo(SICA_SWRST);
-	csync;
-	r0.l = w[p0];
-
 	/* Clear the IMASK register */
 	p0.h = hi(IMASK);
 	p0.l = lo(IMASK);
Signature · 1 line
1.5.1.2
author
#17 lore raw

PATCH 16/32 Blackfin arch: finish removing p* volatile defines for MMRs

In reply to Bryan Wu

From: Mike Frysinger <[email protected]>

---
 include/asm-blackfin/mach-bf537/cdefBF534.h        |    3 -
 include/asm-blackfin/mach-bf537/cdefBF537.h        |    3 -
 include/asm-blackfin/mach-common/cdef_LPBlackfin.h |  143 --------------------
 3 files changed, 0 insertions(+), 149 deletions(-)
include/asm-blackfin/mach-bf537/cdefBF534.h +0 -3
index 9a167f3..d4d3663 100644
@@ -75,7 +75,6 @@ static __inline__ void bfin_write_VR_CTL(unsigned int val)
 #define bfin_write_SWRST(val)                bfin_write16(SWRST,val)
 #define bfin_read_SYSCR()                    bfin_read16(SYSCR)
 #define bfin_write_SYSCR(val)                bfin_write16(SYSCR,val)
-#define	pSIC_RVECT			((void * volatile *)SIC_RVECT)
 #define bfin_read_SIC_RVECT()                bfin_read32(SIC_RVECT)
 #define bfin_write_SIC_RVECT(val)            bfin_write32(SIC_RVECT,val)
 #define bfin_read_SIC_IMASK()                bfin_read32(SIC_IMASK)
@@ -400,10 +399,8 @@ static __inline__ void bfin_write_VR_CTL(unsigned int val)
 #define bfin_write_EBIU_SDSTAT(val)          bfin_write16(EBIU_SDSTAT,val)
 
 /* DMA Traffic Control Registers													*/
-#define	pDMA_TCPER			((volatile unsigned short *)DMA_TCPER)
 #define bfin_read_DMA_TCPER()                bfin_read16(DMA_TCPER)
 #define bfin_write_DMA_TCPER(val)            bfin_write16(DMA_TCPER,val)
-#define	pDMA_TCCNT			((volatile unsigned short *)DMA_TCCNT)
 #define bfin_read_DMA_TCCNT()                bfin_read16(DMA_TCCNT)
 #define bfin_write_DMA_TCCNT(val)            bfin_write16(DMA_TCCNT,val)
 
include/asm-blackfin/mach-bf537/cdefBF537.h +0 -3
index 932a1b6..b8fc949 100644
@@ -40,7 +40,6 @@
 
 /* Include Macro "Defines" For EMAC (Unique to BF536/BF537		*/
 /* 10/100 Ethernet Controller	(0xFFC03000 - 0xFFC031FF) 						*/
-#define	pEMAC_OPMODE		((volatile unsigned long  *)EMAC_OPMODE)
 #define bfin_read_EMAC_OPMODE()              bfin_read32(EMAC_OPMODE)
 #define bfin_write_EMAC_OPMODE(val)          bfin_write32(EMAC_OPMODE,val)
 #define bfin_read_EMAC_ADDRLO()              bfin_read32(EMAC_ADDRLO)
@@ -80,7 +79,6 @@
 #define bfin_read_EMAC_WKUP_FFCRC1()         bfin_read32(EMAC_WKUP_FFCRC1)
 #define bfin_write_EMAC_WKUP_FFCRC1(val)     bfin_write32(EMAC_WKUP_FFCRC1,val)
 
-#define	pEMAC_SYSCTL		((volatile unsigned long  *)EMAC_SYSCTL)
 #define bfin_read_EMAC_SYSCTL()              bfin_read32(EMAC_SYSCTL)
 #define bfin_write_EMAC_SYSCTL(val)          bfin_write32(EMAC_SYSCTL,val)
 #define bfin_read_EMAC_SYSTAT()              bfin_read32(EMAC_SYSTAT)
@@ -147,7 +145,6 @@
 #define bfin_write_EMAC_RXC_SHORT(val)       bfin_write32(EMAC_RXC_SHORT,val)
 #define bfin_read_EMAC_RXC_EQ64()            bfin_read32(EMAC_RXC_EQ64)
 #define bfin_write_EMAC_RXC_EQ64(val)        bfin_write32(EMAC_RXC_EQ64,val)
-#define	pEMAC_RXC_LT128		((volatile unsigned long  *)EMAC_RXC_LT128)
 #define bfin_read_EMAC_RXC_LT128()           bfin_read32(EMAC_RXC_LT128)
 #define bfin_write_EMAC_RXC_LT128(val)       bfin_write32(EMAC_RXC_LT128,val)
 #define bfin_read_EMAC_RXC_LT256()           bfin_read32(EMAC_RXC_LT256)
include/asm-blackfin/mach-common/cdef_LPBlackfin.h +0 -143

435 lines not on this page · raw message

Signature · 1 line
1.5.1.2
author
#18 lore raw

PATCH 17/32 Blackfin arch: move board specific setup out of common init code and into the board specific init code

In reply to Bryan Wu

From: Mike Frysinger <[email protected]>

---
 arch/blackfin/kernel/setup.c            |   20 ++------------------
 arch/blackfin/mach-bf533/boards/stamp.c |   19 ++++++++++++++++---
 arch/blackfin/mach-bf561/boards/ezkit.c |   15 ++++++++++-----
 3 files changed, 28 insertions(+), 26 deletions(-)
arch/blackfin/kernel/setup.c +2 -18
index c456ee5..b6ac6f8 100644
@@ -383,35 +383,19 @@ void __init setup_arch(char **cmdline_p)
 
 	bf53x_cache_init();
 
-#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
-# if defined(CONFIG_BFIN_SHARED_FLASH_ENET) && defined(CONFIG_BFIN533_STAMP)
-	/* setup BF533_STAMP CPLD to route AMS3 to Ethernet MAC */
-	bfin_write_FIO_DIR(bfin_read_FIO_DIR() | (1 << CONFIG_ENET_FLASH_PIN));
-	bfin_write_FIO_FLAG_S(1 << CONFIG_ENET_FLASH_PIN);
-	SSYNC();
-# endif
-# if defined (CONFIG_BFIN561_EZKIT)
-	bfin_write_FIO0_DIR(bfin_read_FIO0_DIR() | (1 << 12));
-	SSYNC();
-# endif /* defined (CONFIG_BFIN561_EZKIT) */
-#endif
-
 	printk(KERN_INFO "Hardware Trace Enabled\n");
 	bfin_write_TBUFCTL(0x03);
 }
 
-#if defined(CONFIG_BF561)
-static struct cpu cpu[2];
-#else
-static struct cpu cpu[1];
-#endif
 static int __init topology_init(void)
 {
 #if defined (CONFIG_BF561)
+	static struct cpu cpu[2];
 	register_cpu(&cpu[0], 0);
 	register_cpu(&cpu[1], 1);
 	return 0;
 #else
+	static struct cpu cpu[1];
 	return register_cpu(cpu, 0);
 #endif
 }
arch/blackfin/mach-bf533/boards/stamp.c +16 -3
index 7d3dfcb..9a472fe 100644
@@ -338,12 +338,25 @@ static struct platform_device *stamp_devices[] __initdata = {
 
 static int __init stamp_init(void)
 {
+	int ret;
+
 	printk(KERN_INFO "%s(): registering device resources\n", __FUNCTION__);
-	platform_add_devices(stamp_devices, ARRAY_SIZE(stamp_devices));
+	ret = platform_add_devices(stamp_devices, ARRAY_SIZE(stamp_devices));
+	if (ret < 0)
+		return ret;
+
+#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
+# if defined(CONFIG_BFIN_SHARED_FLASH_ENET)
+	/* setup BF533_STAMP CPLD to route AMS3 to Ethernet MAC */
+	bfin_write_FIO_DIR(bfin_read_FIO_DIR() | (1 << CONFIG_ENET_FLASH_PIN));
+	bfin_write_FIO_FLAG_S(1 << CONFIG_ENET_FLASH_PIN);
+	SSYNC();
+# endif
+#endif
+
 #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
-	spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info));
+	return spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info));
 #endif
-	return 0;
 }
 
 arch_initcall(stamp_init);
arch/blackfin/mach-bf561/boards/ezkit.c +10 -5
index e8d4058..9720b5c 100644
@@ -184,13 +184,18 @@ static int __init ezkit_init(void)
 {
 	int ret;
 
-	printk(KERN_INFO "%s(): registering device resources\n", __FUNCTION__);
-	ret = platform_add_devices(ezkit_devices,
-		 ARRAY_SIZE(ezkit_devices));
+	printk(KERN_INFO "%s(): registering device resources\n", __func__);
+
+	ret = platform_add_devices(ezkit_devices, ARRAY_SIZE(ezkit_devices));
 	if (ret < 0)
 		return ret;
-	return spi_register_board_info(bfin_spi_board_info,
-				ARRAY_SIZE(bfin_spi_board_info));
+
+#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
+	bfin_write_FIO0_DIR(bfin_read_FIO0_DIR() | (1 << 12));
+	SSYNC();
+#endif
+
+	return spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info));
 }
 
 arch_initcall(ezkit_init);
Signature · 1 line
1.5.1.2
author
#19 lore raw

PATCH 18/32 Blackfin arch: issue reset via SWRST so we dont clobber the watchdog state

In reply to Bryan Wu

From: Mike Frysinger <[email protected]>

---
 arch/blackfin/mach-bf533/head.S |   68 +++++++++-----------------------------
 arch/blackfin/mach-bf537/head.S |   70 +++++++++------------------------------
 arch/blackfin/mach-bf561/head.S |   70 +++++++++------------------------------
 3 files changed, 48 insertions(+), 160 deletions(-)
arch/blackfin/mach-bf533/head.S +16 -52
index 7cb8258..1a54ff5 100644
@@ -481,66 +481,30 @@ ENTRY(_bfin_reset)
 	[p0] = r0;
 	SSYNC;
 
-	/* Disable the WDOG TIMER */
-	p0.h = hi(WDOG_CTL);
-	p0.l = lo(WDOG_CTL);
-	r0.l = 0xAD6;
-	w[p0] = r0.l;
-	SSYNC;
-
-	/* Clear the sticky bit incase it is already set */
-	p0.h = hi(WDOG_CTL);
-	p0.l = lo(WDOG_CTL);
-	r0.l = 0x8AD6;
-	w[p0] = r0.l;
+	/* make sure SYSCR is set to use BMODE */
+	P0.h = hi(SYSCR);
+	P0.l = lo(SYSCR);
+	R0.l = 0x0;
+	W[P0] = R0.l;
 	SSYNC;
 
-	/* Program the count value */
-	R0.l = 0x100;
-	R0.h = 0x0;
-	P0.h = hi(WDOG_CNT);
-	P0.l = lo(WDOG_CNT);
-	[P0] = R0;
+	/* issue a system soft reset */
+	P1.h = hi(SWRST);
+	P1.l = lo(SWRST);
+	R1.l = 0x0007;
+	W[P1] = R1;
 	SSYNC;
 
-	/* Program WDOG_STAT if necessary */
-	P0.h = hi(WDOG_CTL);
-	P0.l = lo(WDOG_CTL);
-	R0 = W[P0](Z);
-	CC = BITTST(R0,1);
-	if !CC JUMP .LWRITESTAT;
-	CC = BITTST(R0,2);
-	if !CC JUMP .LWRITESTAT;
-	JUMP .LSKIP_WRITE;
-
-.LWRITESTAT:
-	/* When watch dog timer is enabled, a write to STAT will load the contents of CNT to STAT */
-	R0 = 0x0000(z);
-	P0.h = hi(WDOG_STAT);
-	P0.l = lo(WDOG_STAT)
-	[P0] = R0;
-	SSYNC;
-
-.LSKIP_WRITE:
-	/* Enable the reset event */
-	P0.h = hi(WDOG_CTL);
-	P0.l = lo(WDOG_CTL);
-	R0 = W[P0](Z);
-	BITCLR(R0,1);
-	BITCLR(R0,2);
-	W[P0] = R0.L;
-	SSYNC;
-	NOP;
-
-	/* Enable the wdog counter */
-	R0 = W[P0](Z);
-	BITCLR(R0,4);
-	W[P0] = R0.L;
+	/* clear system soft reset */
+	R0.l = 0x0000;
+	W[P0] = R0;
 	SSYNC;
 
-	IDLE;
+	/* issue core reset */
+	raise 1;
 
 	RTS;
+ENDPROC(_bfin_reset)
 
 #if CONFIG_DEBUG_KERNEL_START
 debug_kernel_start_trap:
arch/blackfin/mach-bf537/head.S +16 -54

84 lines not on this page · raw message

arch/blackfin/mach-bf561/head.S +16 -54

84 lines not on this page · raw message

Signature · 1 line
1.5.1.2
author
#20 lore raw

PATCH 19/32 Blackfin arch: document why we have to touch the UART peripheral in our boot up code

In reply to Bryan Wu

From: Mike Frysinger <[email protected]>

---
 arch/blackfin/mach-bf533/head.S |    3 ++-
 arch/blackfin/mach-bf537/head.S |    3 ++-
 arch/blackfin/mach-bf561/head.S |    3 ++-
 3 files changed, 6 insertions(+), 3 deletions(-)
arch/blackfin/mach-bf533/head.S +2 -1
index 1a54ff5..4db9e62 100644
@@ -173,7 +173,8 @@ ENTRY(__stext)
 	STI R2;
 #endif
 
-	/* Initialise UART */
+	/* Initialise UART - when booting from u-boot, the UART is not disabled
+	 * so if we dont initalize here, our serial console gets hosed */
 	p0.h = hi(UART_LCR);
 	p0.l = lo(UART_LCR);
 	r0 = 0x0(Z);
arch/blackfin/mach-bf537/head.S +2 -1
index aafc686..b4377dd 100644
@@ -181,7 +181,8 @@ ENTRY(__stext)
 	SSYNC;
 #endif
 
-	/*Initialise UART*/
+	/* Initialise UART - when booting from u-boot, the UART is not disabled
+	 * so if we dont initalize here, our serial console gets hosed */
 	p0.h = hi(UART_LCR);
 	p0.l = lo(UART_LCR);
 	r0 = 0x0(Z);
arch/blackfin/mach-bf561/head.S +2 -1
index 04f3ac3..9c8e688 100644
@@ -127,7 +127,8 @@ ENTRY(__stext)
 	STI R2;
 #endif
 
-	/* Initialise UART*/
+	/* Initialise UART - when booting from u-boot, the UART is not disabled
+	 * so if we dont initalize here, our serial console gets hosed */
 	p0.h = hi(UART_LCR);
 	p0.l = lo(UART_LCR);
 	r0 = 0x0(Z);
Signature · 1 line
1.5.1.2
author
#21 lore raw

PATCH 20/32 Blackfin arch: dma_memcpy borken for > 64K

In reply to Bryan Wu

From: Aubrey Li <[email protected]>

---
 arch/blackfin/kernel/bfin_dma_5xx.c |   17 ++++++++++++++++-
 1 files changed, 16 insertions(+), 1 deletions(-)
arch/blackfin/kernel/bfin_dma_5xx.c +16 -1
index 1c344ac..0ccb0dc 100644
@@ -595,7 +595,7 @@ unsigned short get_dma_curr_ycount(unsigned int channel)
 }
 EXPORT_SYMBOL(get_dma_curr_ycount);
 
-void *dma_memcpy(void *dest, const void *src, size_t size)
+void *_dma_memcpy(void *dest, const void *src, size_t size)
 {
 	int direction;	/* 1 - address decrease, 0 - address increase */
 	int flag_align;	/* 1 - address aligned,  0 - address unaligned */
@@ -734,6 +734,21 @@ void *dma_memcpy(void *dest, const void *src, size_t size)
 
 	return dest;
 }
+
+void *dma_memcpy(void *dest, const void *src, size_t size)
+{
+	size_t bulk;
+	size_t rest;
+	void * addr;
+
+	bulk = (size >> 16) << 16;
+	rest = size - bulk;
+	if (bulk)
+		_dma_memcpy(dest, src, bulk);
+	addr = _dma_memcpy(dest+bulk, src+bulk, rest);
+	return addr;
+}
+
 EXPORT_SYMBOL(dma_memcpy);
 
 void *safe_dma_memcpy(void *dest, const void *src, size_t size)
Signature · 1 line
1.5.1.2
#22 lore raw

Re: [PATCH 20/32] Blackfin arch: dma_memcpy borken for > 64K

Hi Bryan,

arch/blackfin/kernel/bfin_dma_5xx.c unsigned short get_dma_curr_ycount(unsigned int channel) · line 598

Quoted 2 lines · Bryan Wu
arch/blackfin/kernel/bfin_dma_5xx.c +1 -1
-void *dma_memcpy(void *dest, const void *src, size_t size)
+void *_dma_memcpy(void *dest, const void *src, size_t size)

Minor nitpick: the established naming convention is two underscores, not one.

arch/blackfin/kernel/bfin_dma_5xx.c void *dma_memcpy(void *dest, const void *src, size_t size) · line 744

Quoted 7 lines
arch/blackfin/kernel/bfin_dma_5xx.c +7 -0
+void *dma_memcpy(void *dest, const void *src, size_t size)
+{
+       size_t bulk;
+       size_t rest;
+       void * addr;
+
+       bulk = (size >> 16) << 16;

I assume this is significantly faster on your architecture than:

  bulk = size & ~0xFFFFUL;

which is more readable?

arch/blackfin/kernel/bfin_dma_5xx.c void *dma_memcpy(void *dest, const void *src, size_t size) · line 749

Quoted 5 lines
arch/blackfin/kernel/bfin_dma_5xx.c +5 -0
+       rest = size - bulk;
+       if (bulk)
+               _dma_memcpy(dest, src, bulk);
+       addr = _dma_memcpy(dest+bulk, src+bulk, rest);
+       return addr;

Does this work for 128K and up? Why?

#23 lore raw

Re: [PATCH 20/32] Blackfin arch: dma_memcpy borken for > 64K

Quoted 5 lines · Pekka Enberg

arch/blackfin/kernel/bfin_dma_5xx.c unsigned short get_dma_curr_ycount(unsigned int channel) · line 598

Quoted 2 lines · Bryan Wu
arch/blackfin/kernel/bfin_dma_5xx.c +1 -1
-void *dma_memcpy(void *dest, const void *src, size_t size)
+void *_dma_memcpy(void *dest, const void *src, size_t size)

Minor nitpick: the established naming convention is two underscores, not one.

that should be marked as static now actually since the function isnt for use outside of this file

Quoted 10 lines

arch/blackfin/kernel/bfin_dma_5xx.c void *dma_memcpy(void *dest, const void *src, size_t size) · line 744

Quoted 7 lines
arch/blackfin/kernel/bfin_dma_5xx.c +7 -0
+void *dma_memcpy(void *dest, const void *src, size_t size)
+{
+       size_t bulk;
+       size_t rest;
+       void * addr;
+
+       bulk = (size >> 16) << 16;

I assume this is significantly faster on your architecture than:

Quoted 3 lines
   bulk = size & ~0xFFFFUL;

which is more readable?

actually they should get optimized to the same thing -mike

author
#24 lore raw

PATCH 21/32 Blackfin arch: dont clear the bit that tells coreb to start booting

In reply to Bryan Wu

From: Mike Frysinger <[email protected]>

---
 arch/blackfin/mach-bf561/head.S |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
arch/blackfin/mach-bf561/head.S +1 -1
index 9c8e688..ad9187a 100644
@@ -431,7 +431,7 @@ ENTRY(_bfin_reset)
 	/* make sure SYSCR is set to use BMODE */
 	P0.h = hi(SICA_SYSCR);
 	P0.l = lo(SICA_SYSCR);
-	R0.l = 0x0;
+	R0.l = 0x20;
 	W[P0] = R0.l;
 	SSYNC;
 
Signature · 1 line
1.5.1.2
author
#25 lore raw

PATCH 22/32 Blackfin arch: make sure we use local labels

In reply to Bryan Wu

From: Mike Frysinger <[email protected]>

---
 arch/blackfin/mach-bf537/head.S |   24 ++++++++++++------------
 1 files changed, 12 insertions(+), 12 deletions(-)
arch/blackfin/mach-bf537/head.S +12 -12
index b4377dd..2c2652b 100644
@@ -470,38 +470,38 @@ ENTRY(_bfin_reset)
 	SSYNC;
 
 #if defined(CONFIG_MTD_M25P80)
-/*
- * The following code fix the SPI flash reboot issue,
- * /CS signal of the chip which is using PF10 return to GPIO mode
- */
+	/*
+	 * The following code fix the SPI flash reboot issue,
+	 * /CS signal of the chip which is using PF10 return to GPIO mode
+	 */
 	p0.h = hi(PORTF_FER);
 	p0.l = lo(PORTF_FER);
 	r0.l = 0x0000;
 	w[p0] = r0.l;
 	SSYNC;
 
-/* /CS return to high */
+	/* /CS return to high */
 	p0.h = hi(PORTFIO);
 	p0.l = lo(PORTFIO);
 	r0.l = 0xFFFF;
 	w[p0] = r0.l;
 	SSYNC;
 
-/* Delay some time, This is necessary */
+	/* Delay some time, This is necessary */
 	r1.h = 0;
 	r1.l = 0x400;
 	p1   = r1;
-	lsetup (_delay_lab1,_delay_lab1_end ) lc1 = p1;
-_delay_lab1:
+	lsetup (.L_delay_lab1, .L_delay_lab1_end) lc1 = p1;
+.L_delay_lab1:
 	r0.h = 0;
 	r0.l = 0x8000;
 	p0   = r0;
-	lsetup (_delay_lab0,_delay_lab0_end ) lc0 = p0;
-_delay_lab0:
+	lsetup (.L_delay_lab0, .L_delay_lab0_end) lc0 = p0;
+.L_delay_lab0:
 	nop;
-_delay_lab0_end:
+.L_delay_lab0_end:
 	nop;
-_delay_lab1_end:
+.L_delay_lab1_end:
 	nop;
 #endif
 
Signature · 1 line
1.5.1.2
author
#26 lore raw

PATCH 24/32 Blackfin arch: cache SWRST value at bootup so other things like watchdog can non-destructively query it

In reply to Bryan Wu

From: Mike Frysinger <[email protected]>

---
 arch/blackfin/kernel/setup.c       |    8 ++++++++
 include/asm-blackfin/bfin-global.h |    1 +
 2 files changed, 9 insertions(+), 0 deletions(-)
arch/blackfin/kernel/setup.c +8 -0
index b6ac6f8..02dc743 100644
@@ -43,6 +43,8 @@
 #include <asm/blackfin.h>
 #include <asm/cplbinit.h>
 
+u16 _bfin_swrst;
+
 unsigned long memory_start, memory_end, physical_mem_end;
 unsigned long reserved_mem_dcache_on;
 unsigned long reserved_mem_icache_on;
@@ -381,6 +383,12 @@ void __init setup_arch(char **cmdline_p)
 	if (l1_length > L1_DATA_A_LENGTH)
 		panic("L1 memory overflow\n");
 
+#ifdef BF561_FAMILY
+	_bfin_swrst = bfin_read_SICA_SWRST();
+#else
+	_bfin_swrst = bfin_read_SWRST();
+#endif
+
 	bf53x_cache_init();
 
 	printk(KERN_INFO "Hardware Trace Enabled\n");
include/asm-blackfin/bfin-global.h +1 -0
index e37f816..57f37cc 100644
@@ -104,6 +104,7 @@ extern unsigned long dpdt_swapcount_table[];
 
 extern unsigned long table_start, table_end;
 
+extern u16 _bfin_swrst; /* shadow for Software Reset Register (SWRST) */
 extern struct file_operations dpmc_fops;
 extern char _start;
 extern unsigned long _ramstart, _ramend, _rambase;
Signature · 1 line
1.5.1.2
author
#27 lore raw

PATCH 25/32 Blackfin arch: fix signal handling bug

In reply to Bryan Wu

From: Bernd Schmidt <[email protected]>

There's a forum thread at
https://blackfin.uclinux.org/gf/project/uclinux-dist/forum/?action=ForumBrowse&_forum_action=MessageReply&message_id=24741

which has a testcase involving signal handling that crashes quite readily. Inspecting the code I believe what happens is that signal handling can become confused when it is invoked on return from an interrupt, if the contents of P0 and R0 at the time of the interrupt happen to be such that P0 is larger than zero (indicating to the signal code that we're in a syscall), and R0 happens to have a value of something like -EINTR or -ERESTARTSYS. Fixed by setting orig_p0 to -1 if we're returning from an interrupt. The testcase now seems to run without problems.

---
 arch/blackfin/mach-common/entry.S |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
arch/blackfin/mach-common/entry.S +5 -0
index e463733..7d03687 100644
@@ -712,6 +712,11 @@ _schedule_and_signal_from_int:
 	p1.h = _evt_system_call;
 	[p0] = p1;
 	csync;
+
+	/* Set orig_p0 to -1 to indicate this isn't the end of a syscall.  */
+	r0 = -1 (x);
+	[sp + PT_ORIG_P0] = r0;
+
 	p1 = rets;
 	[sp + PT_RESERVED] = p1;
 
Signature · 1 line
1.5.1.2
author
#28 lore raw

PATCH 26/32 Blackfin arch: Change NO_ACCESS_CHECK to ACCESS_CHECK

In reply to Bryan Wu

From: Sonic Zhang <[email protected]>

---
 include/asm-blackfin/uaccess.h |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
include/asm-blackfin/uaccess.h +2 -2
index bfcb679..2233f8f 100644
@@ -14,7 +14,7 @@
 #include <linux/string.h>
 
 #include <asm/segment.h>
-#ifndef CONFIG_NO_ACCESS_CHECK
+#ifdef CONFIG_ACCESS_CHECK
 # include <asm/bfin-global.h>
 #endif
 
@@ -56,7 +56,7 @@ static inline int is_in_rom(unsigned long addr)
  * get_fs() == KERNEL_DS, checking is bypassed.
  */
 
-#ifdef CONFIG_NO_ACCESS_CHECK
+#ifndef CONFIG_ACCESS_CHECK
 static inline int _access_ok(unsigned long addr, unsigned long size) { return 1; }
 #else
 #ifdef CONFIG_ACCESS_OK_L1
Signature · 1 line
1.5.1.2
author
#29 lore raw

PATCH 27/32 Blackfin arch: add board default configs to blackfin arch

In reply to Bryan Wu

From: Mike Frysinger <[email protected]>

---
 arch/blackfin/Makefile                      |    1 +
 arch/blackfin/configs/BF533-EZKIT_defconfig | 1014 ++++++++++++++++++++
 arch/blackfin/configs/BF533-STAMP_defconfig | 1296 ++++++++++++++++++++++++++
 arch/blackfin/configs/BF537-STAMP_defconfig | 1332 +++++++++++++++++++++++++++
 arch/blackfin/configs/BF561-EZKIT_defconfig | 1073 +++++++++++++++++++++
 arch/blackfin/configs/PNAV-10_defconfig     | 1253 +++++++++++++++++++++++++
 6 files changed, 5969 insertions(+), 0 deletions(-)
 create mode 100644 arch/blackfin/configs/BF533-EZKIT_defconfig
 create mode 100644 arch/blackfin/configs/BF533-STAMP_defconfig
 create mode 100644 arch/blackfin/configs/BF537-STAMP_defconfig
 create mode 100644 arch/blackfin/configs/BF561-EZKIT_defconfig
 create mode 100644 arch/blackfin/configs/PNAV-10_defconfig
arch/blackfin/Makefile +1 -0
index 52d4dbd..75e89c3 100644
@@ -15,6 +15,7 @@ GZFLAGS          := -9
 CFLAGS_MODULE    += -mlong-calls
 KALLSYMS         += --symbol-prefix=_
 
+KBUILD_DEFCONFIG := BF537-STAMP_defconfig
 
 # setup the machine name and the machine dependent settings
 machine-$(CONFIG_BF531) := bf533
arch/blackfin/configs/BF533-EZKIT_defconfig new file +1014 -0

1,014 lines not on this page · raw message

arch/blackfin/configs/BF533-STAMP_defconfig new file +1296 -0

1,296 lines not on this page · raw message

arch/blackfin/configs/BF537-STAMP_defconfig new file +1332 -0

683 lines not on this page · raw message

arch/blackfin/configs/BF561-EZKIT_defconfig new file +1073 -0

1,073 lines not on this page · raw message

arch/blackfin/configs/PNAV-10_defconfig new file +1253 -0

1,253 lines not on this page · raw message

The rest of this diff is not shown. View the raw message.

Signature · 1 line
1.5.1.2

Part of the diff is not shown here. View the raw message.

author
#30 lore raw

PATCH 28/32 Blackfin arch: update defconfig files

In reply to Bryan Wu
---
 arch/blackfin/defconfig |   43 ++++++++++++++++++++++++++++---------------
 1 files changed, 28 insertions(+), 15 deletions(-)
arch/blackfin/defconfig +28 -15
index d5904ca..a513fbe 100644
@@ -1,19 +1,20 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.20
+# Linux kernel version: 2.6.20.4
 #
 # CONFIG_MMU is not set
 # CONFIG_FPU is not set
 CONFIG_RWSEM_GENERIC_SPINLOCK=y
 # CONFIG_RWSEM_XCHGADD_ALGORITHM is not set
+CONFIG_BLACKFIN=y
 CONFIG_BFIN=y
 CONFIG_SEMAPHORE_SLEEPERS=y
 CONFIG_GENERIC_FIND_NEXT_BIT=y
 CONFIG_GENERIC_HWEIGHT=y
 CONFIG_GENERIC_HARDIRQS=y
 CONFIG_GENERIC_IRQ_PROBE=y
+# CONFIG_GENERIC_TIME is not set
 CONFIG_GENERIC_CALIBRATE_DELAY=y
-CONFIG_UCLINUX=y
 CONFIG_FORCE_MAX_ZONEORDER=14
 CONFIG_IRQCHIP_DEMUX_GPIO=y
 CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
@@ -55,6 +56,7 @@ CONFIG_ELF_CORE=y
 CONFIG_BASE_FULL=y
 CONFIG_FUTEX=y
 CONFIG_EPOLL=y
+CONFIG_BIG_ORDER_ALLOC_NOFAIL_MAGIC=3
 # CONFIG_LIMIT_PAGECACHE is not set
 CONFIG_BUDDY=y
 # CONFIG_NP2 is not set
@@ -95,6 +97,9 @@ CONFIG_DEFAULT_AS=y
 # CONFIG_DEFAULT_CFQ is not set
 # CONFIG_DEFAULT_NOOP is not set
 CONFIG_DEFAULT_IOSCHED="anticipatory"
+# CONFIG_PREEMPT_NONE is not set
+CONFIG_PREEMPT_VOLUNTARY=y
+# CONFIG_PREEMPT is not set
 
 #
 # Blackfin Processor Options
@@ -107,7 +112,6 @@ CONFIG_DEFAULT_IOSCHED="anticipatory"
 # CONFIG_BF532 is not set
 # CONFIG_BF533 is not set
 # CONFIG_BF534 is not set
-# CONFIG_BF535 is not set
 # CONFIG_BF536 is not set
 CONFIG_BF537=y
 # CONFIG_BF561 is not set
@@ -115,7 +119,6 @@ CONFIG_BF_REV_0_2=y
 # CONFIG_BF_REV_0_3 is not set
 # CONFIG_BF_REV_0_4 is not set
 # CONFIG_BF_REV_0_5 is not set
-CONFIG_BLACKFIN=y
 CONFIG_BFIN_SINGLE_CORE=y
 # CONFIG_BFIN533_EZKIT is not set
 # CONFIG_BFIN533_STAMP is not set
@@ -182,6 +185,7 @@ CONFIG_IRQ_WATCH=13
 #
 # Board customizations
 #
+# CONFIG_CMDLINE_BOOL is not set
 
 #
 # Board Setup
@@ -221,6 +225,19 @@ CONFIG_HZ=250
 # Memory Optimizations
 #
 CONFIG_I_ENTRY_L1=y
+CONFIG_EXCPT_IRQ_SYSC_L1=y
+CONFIG_DO_IRQ_L1=y
+CONFIG_CORE_TIMER_IRQ_L1=y
+CONFIG_IDLE_L1=y
+CONFIG_SCHEDULE_L1=y
+CONFIG_ARITHMETIC_OPS_L1=y
+CONFIG_ACCESS_OK_L1=y
+CONFIG_MEMSET_L1=y
+CONFIG_MEMCPY_L1=y
+CONFIG_SYS_BFIN_SPINLOCK_L1=y
+# CONFIG_IP_CHECKSUM_L1 is not set
+# CONFIG_SYSCALL_TAB_L1 is not set
+# CONFIG_CPLB_SWITCH_TAB_L1 is not set
 CONFIG_RAMKERNEL=y
 # CONFIG_ROMKERNEL is not set
 CONFIG_SELECT_MEMORY_MODEL=y
@@ -243,6 +260,7 @@ CONFIG_DMA_UNCACHED_1M=y
 #
 CONFIG_BLKFIN_CACHE=y
 CONFIG_BLKFIN_DCACHE=y
+# CONFIG_BLKFIN_DCACHE_BANKA is not set
 # CONFIG_BLKFIN_CACHE_LOCK is not set
 # CONFIG_BLKFIN_WB is not set
 CONFIG_BLKFIN_WT=y
@@ -815,9 +833,8 @@ CONFIG_I2C_CHARDEV=m
 #
 # I2C Hardware Bus support
 #
-# CONFIG_I2C_BFIN_GPIO is not set
-CONFIG_I2C_BFIN_TWI=m
-CONFIG_TWICLK_KHZ=50
+# CONFIG_I2C_BLACKFIN_GPIO is not set
+# CONFIG_I2C_BLACKFIN_TWI is not set
 # CONFIG_I2C_OCORES is not set
 # CONFIG_I2C_PARPORT_LIGHT is not set
 # CONFIG_I2C_STUB is not set
@@ -832,6 +849,7 @@ CONFIG_SENSORS_AD5252=m
 # CONFIG_SENSORS_EEPROM is not set
 # CONFIG_SENSORS_PCF8574 is not set
 # CONFIG_SENSORS_PCF8575 is not set
+# CONFIG_SENSORS_PCA9543 is not set
 # CONFIG_SENSORS_PCA9539 is not set
 # CONFIG_SENSORS_PCF8591 is not set
 # CONFIG_SENSORS_MAX6875 is not set
@@ -850,11 +868,11 @@ CONFIG_SPI_MASTER=y
 # SPI Master Controller Drivers
 #
 # CONFIG_SPI_BITBANG is not set
-CONFIG_SPI_BFIN=y
 
 #
 # SPI Protocol Masters
 #
+CONFIG_SPI_BFIN=y
 
 #
 # Dallas's 1-wire bus
@@ -940,10 +958,6 @@ CONFIG_NTSC=y
 # CONFIG_PAL_YCBCR is not set
 CONFIG_ADV7393_1XMEM=y
 # CONFIG_ADV7393_2XMEM is not set
-CONFIG_FB_BF537_LQ035=m
-CONFIG_LQ035_SLAVE_ADDR=0x58
-# CONFIG_FB_BFIN_LANDSCAPE is not set
-# CONFIG_FB_BFIN_BGR is not set
 # CONFIG_FB_S1D13XXX is not set
 # CONFIG_FB_VIRTUAL is not set
 
@@ -1280,12 +1294,11 @@ CONFIG_ENABLE_MUST_CHECK=y
 # CONFIG_DEBUG_KERNEL is not set
 CONFIG_LOG_BUF_SHIFT=14
 # CONFIG_DEBUG_BUGVERBOSE is not set
+# CONFIG_DEBUG_SERIAL_EARLY_INIT is not set
 CONFIG_DEBUG_HUNT_FOR_ZERO=y
 # CONFIG_DEBUG_BFIN_NO_KERN_HWTRACE is not set
-# CONFIG_BOOTPARAM is not set
-# CONFIG_NO_KERNEL_MSG is not set
 CONFIG_CPLB_INFO=y
-# CONFIG_NO_ACCESS_CHECK is not set
+CONFIG_ACCESS_CHECK=y
 
 #
 # Security options
Signature · 1 line
1.5.1.2
author
#31 lore raw

PATCH 29/32 Blackfin arch: update pm.c according to power management API change.

In reply to Bryan Wu
---
 arch/blackfin/mach-common/pm.c |   12 ++----------
 1 files changed, 2 insertions(+), 10 deletions(-)
arch/blackfin/mach-common/pm.c +2 -10
index deb2727..afed524 100644
@@ -102,10 +102,8 @@ static int bfin_pm_prepare(suspend_state_t state)
 	switch (state) {
 	case PM_SUSPEND_STANDBY:
 		break;
-	case PM_SUSPEND_MEM:
-		return -ENOTSUPP;
 
-	case PM_SUSPEND_DISK:
+	case PM_SUSPEND_MEM:
 		return -ENOTSUPP;
 
 	default:
@@ -126,10 +124,8 @@ static int bfin_pm_enter(suspend_state_t state)
 	case PM_SUSPEND_STANDBY:
 		bfin_pm_suspend_standby_enter();
 		break;
-	case PM_SUSPEND_MEM:
-		return -ENOTSUPP;
 
-	case PM_SUSPEND_DISK:
+	case PM_SUSPEND_MEM:
 		return -ENOTSUPP;
 
 	default:
@@ -155,9 +151,6 @@ static int bfin_pm_finish(suspend_state_t state)
 	case PM_SUSPEND_MEM:
 		return -ENOTSUPP;
 
-	case PM_SUSPEND_DISK:
-		return -ENOTSUPP;
-
 	default:
 		return -EINVAL;
 	}
@@ -166,7 +159,6 @@ static int bfin_pm_finish(suspend_state_t state)
 }
 
 struct pm_ops bfin_pm_ops = {
-	.pm_disk_mode = PM_DISK_PLATFORM,
 	.prepare = bfin_pm_prepare,
 	.enter = bfin_pm_enter,
 	.finish = bfin_pm_finish,
Signature · 1 line
1.5.1.2
author
#32 lore raw

PATCH 30/32 Blackfin serial driver: fix overhead issue

In reply to Bryan Wu

From: Aubrey Li <[email protected]>

---
 drivers/serial/bfin_5xx.c |   28 +++++++++++++++++-----------
 1 files changed, 17 insertions(+), 11 deletions(-)
drivers/serial/bfin_5xx.c +17 -11
index 408390f..a8271d9 100644
@@ -240,24 +240,30 @@ static void bfin_serial_tx_chars(struct bfin_serial_port *uart)
 		bfin_serial_stop_tx(&uart->port);
 }
 
-static irqreturn_t bfin_serial_int(int irq, void *dev_id)
+static irqreturn_t bfin_serial_rx_int(int irq, void *dev_id)
+{
+	struct bfin_serial_port *uart = dev_id;
+
+	spin_lock(&uart->port.lock);
+	while ((UART_GET_IIR(uart) & IIR_STATUS) == IIR_RX_READY)
+		bfin_serial_rx_chars(uart);
+	spin_unlock(&uart->port.lock);
+	return IRQ_HANDLED;
+}
+
+static irqreturn_t bfin_serial_tx_int(int irq, void *dev_id)
 {
 	struct bfin_serial_port *uart = dev_id;
 	unsigned short status;
 
 	spin_lock(&uart->port.lock);
-	status = UART_GET_IIR(uart);
-	do {
-		if ((status & IIR_STATUS) == IIR_TX_READY)
-			bfin_serial_tx_chars(uart);
-		if ((status & IIR_STATUS) == IIR_RX_READY)
-			bfin_serial_rx_chars(uart);
-		status = UART_GET_IIR(uart);
-	} while (status & (IIR_TX_READY | IIR_RX_READY));
+	while ((UART_GET_IIR(uart) & IIR_STATUS) == IIR_TX_READY)
+		bfin_serial_tx_chars(uart);
 	spin_unlock(&uart->port.lock);
 	return IRQ_HANDLED;
 }
 
+
 static void bfin_serial_do_work(struct work_struct *work)
 {
 	struct bfin_serial_port *uart = container_of(work, struct bfin_serial_port, cts_workqueue);
@@ -545,14 +551,14 @@ static int bfin_serial_startup(struct uart_port *port)
 	add_timer(&(uart->rx_dma_timer));
 #else
 	if (request_irq
-	    (uart->port.irq, bfin_serial_int, IRQF_DISABLED,
+	    (uart->port.irq, bfin_serial_rx_int, IRQF_DISABLED,
 	     "BFIN_UART_RX", uart)) {
 		printk(KERN_NOTICE "Unable to attach BlackFin UART RX interrupt\n");
 		return -EBUSY;
 	}
 
 	if (request_irq
-	    (uart->port.irq+1, bfin_serial_int, IRQF_DISABLED,
+	    (uart->port.irq+1, bfin_serial_tx_int, IRQF_DISABLED,
 	     "BFIN_UART_TX", uart)) {
 		printk(KERN_NOTICE "Unable to attach BlackFin UART TX interrupt\n");
 		free_irq(uart->port.irq, uart);
Signature · 1 line
1.5.1.2
author
#33 lore raw

PATCH 31/32 Blackfin serial driver: implement support for ignoring parity/break errors

In reply to Bryan Wu

From: Mike Frysinger <[email protected]>

properly setting up and respecting the read_status_mask / ignore_status_mask fields of the serial core

---
 drivers/serial/bfin_5xx.c |   97 ++++++++++++++++++++++++++++-----------------
 1 files changed, 61 insertions(+), 36 deletions(-)
drivers/serial/bfin_5xx.c +61 -36
index a8271d9..787dc71 100644
@@ -6,8 +6,6 @@
  * Created:
  * Description:  Driver for blackfin 5xx serial ports
  *
- * Rev:          $Id: bfin_5xx.c,v 1.19 2006/09/24 02:33:53 aubrey Exp $
- *
  * Modified:
  *               Copyright 2006 Analog Devices Inc.
  *
@@ -152,7 +150,7 @@ static void local_put_char(struct bfin_serial_port *uart, char ch)
 
 static void bfin_serial_rx_chars(struct bfin_serial_port *uart)
 {
-	struct tty_struct *tty = uart->port.info?uart->port.info->tty:0;
+	struct tty_struct *tty = uart->port.info->tty;
 	unsigned int status, ch, flg;
 #ifdef BF533_FAMILY
 	static int in_break = 0;
@@ -173,8 +171,10 @@ static void bfin_serial_rx_chars(struct bfin_serial_port *uart)
 		if (ch != 0) {
 			in_break = 0;
 			ch = UART_GET_CHAR(uart);
-		}
-		return;
+			if (bfin_revid() < 5)
+				return;
+		} else
+			return;
 	}
 #endif
 
@@ -185,27 +185,32 @@ static void bfin_serial_rx_chars(struct bfin_serial_port *uart)
 		uart->port.icount.brk++;
 		if (uart_handle_break(&uart->port))
 			goto ignore_char;
-		flg = TTY_BREAK;
-	} else if (status & PE) {
-		flg = TTY_PARITY;
+	}
+	if (status & PE)
 		uart->port.icount.parity++;
-	} else if (status & OE) {
-		flg = TTY_OVERRUN;
+	if (status & OE)
 		uart->port.icount.overrun++;
-	} else if (status & FE) {
-		flg = TTY_FRAME;
+	if (status & FE)
 		uart->port.icount.frame++;
-	} else
+
+	status &= uart->port.read_status_mask;
+
+	if (status & BI)
+		flg = TTY_BREAK;
+	else if (status & PE)
+		flg = TTY_PARITY;
+	else if (status & FE)
+		flg = TTY_FRAME;
+	else
 		flg = TTY_NORMAL;
 
 	if (uart_handle_sysrq_char(&uart->port, ch))
 		goto ignore_char;
-	if (tty)
-		uart_insert_char(&uart->port, status, 2, ch, flg);
 
-ignore_char:
-	if (tty)
-		tty_flip_buffer_push(tty);
+	uart_insert_char(&uart->port, status, OE, ch, flg);
+
+ ignore_char:
+	tty_flip_buffer_push(tty);
 }
 
 static void bfin_serial_tx_chars(struct bfin_serial_port *uart)
@@ -254,7 +259,6 @@ static irqreturn_t bfin_serial_rx_int(int irq, void *dev_id)
 static irqreturn_t bfin_serial_tx_int(int irq, void *dev_id)
 {
 	struct bfin_serial_port *uart = dev_id;
-	unsigned short status;
 
 	spin_lock(&uart->port.lock);
 	while ((UART_GET_IIR(uart) & IIR_STATUS) == IIR_TX_READY)
@@ -325,7 +329,7 @@ static void bfin_serial_dma_tx_chars(struct bfin_serial_port *uart)
 	spin_unlock_irqrestore(&uart->port.lock, flags);
 }
 
-static void bfin_serial_dma_rx_chars(struct bfin_serial_port * uart)
+static void bfin_serial_dma_rx_chars(struct bfin_serial_port *uart)
 {
 	struct tty_struct *tty = uart->port.info->tty;
 	int i, flg, status;
@@ -337,25 +341,32 @@ static void bfin_serial_dma_rx_chars(struct bfin_serial_port * uart)
 		uart->port.icount.brk++;
 		if (uart_handle_break(&uart->port))
 			goto dma_ignore_char;
-		flg = TTY_BREAK;
-	} else if (status & PE) {
-		flg = TTY_PARITY;
+	}
+	if (status & PE)
 		uart->port.icount.parity++;
-	} else if (status & OE) {
-		flg = TTY_OVERRUN;
+	if (status & OE)
 		uart->port.icount.overrun++;
-	} else if (status & FE) {
-		flg = TTY_FRAME;
+	if (status & FE)
 		uart->port.icount.frame++;
-	} else
+
+	status &= uart->port.read_status_mask;
+
+	if (status & BI)
+		flg = TTY_BREAK;
+	else if (status & PE)
+		flg = TTY_PARITY;
+	else if (status & FE)
+		flg = TTY_FRAME;
+	else
 		flg = TTY_NORMAL;
 
 	for (i = uart->rx_dma_buf.head; i < uart->rx_dma_buf.tail; i++) {
 		if (uart_handle_sysrq_char(&uart->port, uart->rx_dma_buf.buf[i]))
 			goto dma_ignore_char;
-		uart_insert_char(&uart->port, status, 2, uart->rx_dma_buf.buf[i], flg);
+		uart_insert_char(&uart->port, status, OE, uart->rx_dma_buf.buf[i], flg);
 	}
-dma_ignore_char:
+
+ dma_ignore_char:
 	tty_flip_buffer_push(tty);
 }
 
@@ -620,13 +631,27 @@ bfin_serial_set_termios(struct uart_port *port, struct ktermios *termios,
 			lcr |= EPS;
 	}
 
-	/* These controls are not implemented for this port */
-	termios->c_iflag |= INPCK | BRKINT | PARMRK;
-	termios->c_iflag &= ~(IGNPAR | IGNBRK);
+	port->read_status_mask = OE;
+	if (termios->c_iflag & INPCK)
+		port->read_status_mask |= (FE | PE);
+	if (termios->c_iflag & (BRKINT | PARMRK))
+		port->read_status_mask |= BI;
 
-	/* These controls are not implemented for this port */
-	termios->c_iflag |= INPCK | BRKINT | PARMRK;
-	termios->c_iflag &= ~(IGNPAR | IGNBRK);
+	/*
+	 * Characters to ignore
+	 */
+	port->ignore_status_mask = 0;
+	if (termios->c_iflag & IGNPAR)
+		port->ignore_status_mask |= FE | PE;
+	if (termios->c_iflag & IGNBRK) {
+		port->ignore_status_mask |= BI;
+		/*
+		 * If we're ignoring parity and break indicators,
+		 * ignore overruns too (for real raw support).
+		 */
+		if (termios->c_iflag & IGNPAR)
+			port->ignore_status_mask |= OE;
+	}
 
 	baud = uart_get_baud_rate(port, termios, old, 0, port->uartclk/16);
 	quot = uart_get_divisor(port, baud);
Signature · 1 line
1.5.1.2
#35 lore raw
In reply to Bryan Wu

On Mon 21 May 2007 06:09, Bryan Wu pondered:

Quoted 2 lines

Lots of update for 2.6.22-rc2 and tested on STAMP537 board.

One of the things I noticed when trying out 2.6.22-rc1, on blackfin was:

CALL scripts/checksyscalls.sh
<stdin>:96:2: warning: #warning syscall restart_syscall not implemented <stdin>:216:2: warning: #warning syscall utime not implemented <stdin>:424:2: warning: #warning syscall select not implemented <stdin>:440:2: warning: #warning syscall uselib not implemented <stdin>:444:2: warning: #warning syscall swapon not implemented <stdin>:456:2: warning: #warning syscall mmap not implemented <stdin>:556:2: warning: #warning syscall swapoff not implemented <stdin>:636:2: warning: #warning syscall sysfs not implemented <stdin>:672:2: warning: #warning syscall msync not implemented <stdin>:696:2: warning: #warning syscall mlock not implemented <stdin>:700:2: warning: #warning syscall munlock not implemented <stdin>:704:2: warning: #warning syscall mlockall not implemented <stdin>:708:2: warning: #warning syscall munlockall not implemented <stdin>:748:2: warning: #warning syscall mremap not implemented <stdin>:768:2: warning: #warning syscall poll not implemented <stdin>:772:2: warning: #warning syscall nfsservctl not implemented <stdin>:816:2: warning: #warning syscall pread64 not implemented <stdin>:820:2: warning: #warning syscall pwrite64 not implemented <stdin>:968:2: warning: #warning syscall mincore not implemented <stdin>:972:2: warning: #warning syscall madvise not implemented <stdin>:992:2: warning: #warning syscall readahead not implemented <stdin>:1092:2: warning: #warning syscall fadvise64 not implemented <stdin>:1116:2: warning: #warning syscall remap_file_pages not implemented <stdin>:1184:2: warning: #warning syscall mbind not implemented <stdin>:1188:2: warning: #warning syscall get_mempolicy not implemented <stdin>:1192:2: warning: #warning syscall set_mempolicy not implemented <stdin>:1220:2: warning: #warning syscall kexec_load not implemented <stdin>:1260:2: warning: #warning syscall migrate_pages not implemented <stdin>:1328:2: warning: #warning syscall set_robust_list not implemented <stdin>:1332:2: warning: #warning syscall get_robust_list not implemented <stdin>:1336:2: warning: #warning syscall splice not implemented <stdin>:1340:2: warning: #warning syscall sync_file_range not implemented <stdin>:1344:2: warning: #warning syscall tee not implemented <stdin>:1348:2: warning: #warning syscall vmsplice not implemented <stdin>:1352:2: warning: #warning syscall move_pages not implemented <stdin>:1356:2: warning: #warning syscall getcpu not implemented <stdin>:1360:2: warning: #warning syscall epoll_pwait not implemented <stdin>:1364:2: warning: #warning syscall utimensat not implemented <stdin>:1368:2: warning: #warning syscall signalfd not implemented <stdin>:1372:2: warning: #warning syscall timerfd not implemented <stdin>:1376:2: warning: #warning syscall eventfd not implemented

since there is noMMU, are we better:
- putting stubs (return ENOSYS - give runtime errors), or
- just ignore the errors - and give compile errors? (Is there any way to put
something into the syscall table, as not to get the warnings?)

Thanks
- Robin

#36 lore raw
Quoted 4 lines · Robin Getz

since there is noMMU, are we better:
- putting stubs (return ENOSYS - give runtime errors), or
- just ignore the errors - and give compile errors? (Is there any way to put
something into the syscall table, as not to get the warnings?)

there are no compile errors ... having a stub that returns -ENOSYS is the same thing as not having a stub as the fallback code when given an unknown syscall # will return -ENOSYS ...
-mike

#37 lore raw

On Mon 21 May 2007 13:36, Mike Frysinger pondered:

Quoted 9 lines · Robin Getz
Quoted 4 lines

since there is noMMU, are we better:
- putting stubs (return ENOSYS - give runtime errors), or
- just ignore the errors - and give compile errors? (Is there any way to
put something into the syscall table, as not to get the warnings?)

there are no compile errors ... having a stub that returns -ENOSYS is the same thing as not having a stub as the fallback code when given an unknown syscall # will return -ENOSYS ...

So, is there a way to tell ./scripts/checksyscalls.sh that here is a list of syscalls that we can't do/have chosen not to implement - so we can live with the common fallback code, and not get the warnings?

-Robin

#38 lore raw
Quoted 7 lines · Robin Getz

On Mon 21 May 2007 13:36, Mike Frysinger pondered:

Quoted 6 lines · Robin Getz
Quoted 4 lines

since there is noMMU, are we better:
- putting stubs (return ENOSYS - give runtime errors), or
- just ignore the errors - and give compile errors? (Is there any way to
put something into the syscall table, as not to get the warnings?)

Quoted 7 lines
Quoted 3 lines

there are no compile errors ... having a stub that returns -ENOSYS is the same thing as not having a stub as the fallback code when given an unknown syscall # will return -ENOSYS ...

So, is there a way to tell ./scripts/checksyscalls.sh that here is a list of syscalls that we can't do/have chosen not to implement - so we can live with the common fallback code, and not get the warnings?

we'd have to define some lists ... like an "obsolete" list where we could say "do not warn about function XXX if function YYY is supplied" ... for example, we dont provide mmap() because we only use mmap2()
...

then we'd need a list for no-mmu where we could list ones that dont make sense for us ...

to be sure, there are functions in that list we should be implementing but no one has noticed/complained so it hasnt been an issue ;) -mike

author
#39 lore raw
In reply to Robin Getz
Quoted 11 lines · Robin Getz

On Mon 21 May 2007 13:36, Mike Frysinger pondered:

Quoted 9 lines · Robin Getz
Quoted 4 lines

since there is noMMU, are we better:
- putting stubs (return ENOSYS - give runtime errors), or
- just ignore the errors - and give compile errors? (Is there any way to
put something into the syscall table, as not to get the warnings?)

there are no compile errors ... having a stub that returns -ENOSYS is the same thing as not having a stub as the fallback code when given an unknown syscall # will return -ENOSYS ...

Quoted 5 lines

So, is there a way to tell ./scripts/checksyscalls.sh that here is a list of syscalls that we can't do/have chosen not to implement - so we can live with the common fallback code, and not get the warnings?

-Robin

Can we copy the new syscall numbers from i386 to asm-blackfin/unistd.h and fill out the syscall table in entry.S too, as David Howells' patch for FRV?

---

 arch/frv/kernel/entry.S  |   10 ++++++++++
 arch/frv/kernel/setup.c  |    4 ++--
 arch/frv/mm/elf-fdpic.c  |    1 +
 include/asm-frv/unistd.h |   16 +++++++++++++---
 4 files changed, 26 insertions(+), 5 deletions(-)
arch/frv/kernel/entry.S +10 -0
index 940ac30..43dc08e 100644
@@ -1482,6 +1482,16 @@ sys_call_table:
       .long sys_faccessat
       .long sys_pselect6
       .long sys_ppoll
+       .long sys_unshare               /* 310 */
+       .long sys_set_robust_list
+       .long sys_get_robust_list
+       .long sys_splice
+       .long sys_sync_file_range
+       .long sys_tee                   /* 315 */
+       .long sys_vmsplice
+       .long sys_move_pages
+       .long sys_getcpu
+       .long sys_epoll_pwait
 
 
 syscall_table_size = (. - sys_call_table)
arch/frv/kernel/setup.c +2 -2
index 8ea3ca2..aa3c795 100644
@@ -191,7 +191,7 @@ static struct clock_cmode __pminitdata clock_cmodes_fr555[16] = {
 static const struct clock_cmode __pminitdata *clock_cmodes;
 static int __pminitdata clock_doubled;
 
-static struct uart_port __initdata __frv_uart0 = {
+static struct uart_port __pminitdata __frv_uart0 = {
       .uartclk                = 0,
       .membase                = (char *) UART0_BASE,
       .irq                    = IRQ_CPU_UART0,
@@ -200,7 +200,7 @@ static struct uart_port __initdata __frv_uart0 = {
       .flags                  = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
 };
 
-static struct uart_port __initdata __frv_uart1 = {
+static struct uart_port __pminitdata __frv_uart1 = {
       .uartclk                = 0,
       .membase                = (char *) UART1_BASE,
       .irq                    = IRQ_CPU_UART1,
arch/frv/mm/elf-fdpic.c +1 -0
index cac2c01..385fd30 100644
@@ -13,6 +13,7 @@
 #include <linux/mm.h>
 #include <linux/fs.h>
 #include <linux/elf-fdpic.h>
+#include <asm/mman.h>
 
 /*****************************************************************************/
 /*
include/asm-frv/unistd.h +13 -3
index 584c041..d0ea678 100644
@@ -186,8 +186,8 @@
 #define __NR_rt_sigtimedwait   177
 #define __NR_rt_sigqueueinfo   178
 #define __NR_rt_sigsuspend     179
-#define __NR_pread             180
-#define __NR_pwrite            181
+#define __NR_pread64           180
+#define __NR_pwrite64          181
 #define __NR_chown             182
 #define __NR_getcwd            183
 #define __NR_capget            184
@@ -316,10 +316,20 @@
 #define __NR_faccessat         307
 #define __NR_pselect6          308
 #define __NR_ppoll             309
+#define __NR_unshare           310
+#define __NR_set_robust_list   311
+#define __NR_get_robust_list   312
+#define __NR_splice            313
+#define __NR_sync_file_range   314
+#define __NR_tee               315
+#define __NR_vmsplice          316
+#define __NR_move_pages                317
+#define __NR_getcpu            318
+#define __NR_epoll_pwait       319
 
 #ifdef __KERNEL__
 
-#define NR_syscalls 310
+#define NR_syscalls 320
 
 #define __ARCH_WANT_IPC_PARSE_VERSION
 /* #define __ARCH_WANT_OLD_READDIR */

---

Thanks
-Bryan Wu

#40 lore raw
In reply to Robin Getz
Quoted 7 lines · Robin Getz

On Mon 21 May 2007 06:09, Bryan Wu pondered:

Quoted 2 lines

Lots of update for 2.6.22-rc2 and tested on STAMP537 board.

One of the things I noticed when trying out 2.6.22-rc1, on blackfin was:

CALL scripts/checksyscalls.sh

[snip syscalls]

Quoted 6 lines

since there is noMMU, are we better:
- putting stubs (return ENOSYS - give runtime errors), or
- just ignore the errors - and give compile errors? (Is there any way to put
something into the syscall table, as not to get the warnings?)

No, you'd be better of figuring out which ones you can support and which ones you have to -ENOSYS. CONFIG_MMU=n is not a "get out of syscalls free" card. Many of these have no dependency on CONFIG_MMU, anyways.

#41 lore raw
Quoted 10 lines · Paul Mundt
Quoted 7 lines · Robin Getz

On Mon 21 May 2007 06:09, Bryan Wu pondered:

Quoted 2 lines

Lots of update for 2.6.22-rc2 and tested on STAMP537 board.

One of the things I noticed when trying out 2.6.22-rc1, on blackfin was:

CALL scripts/checksyscalls.sh

[snip syscalls]

Quoted 1 line
Quoted 8 lines
Quoted 4 lines

since there is noMMU, are we better:
- putting stubs (return ENOSYS - give runtime errors), or
- just ignore the errors - and give compile errors? (Is there any way to put
something into the syscall table, as not to get the warnings?)

No, you'd be better of figuring out which ones you can support and which ones you have to -ENOSYS. CONFIG_MMU=n is not a "get out of syscalls free" card. Many of these have no dependency on CONFIG_MMU, anyways.

when you say -ENOSYS, do you mean we need sys_foo() that simply does return -ENOSYS or do we just let the default syscall code go "__NR_foo is not registered, return -ENOSYS"
-mike

#42 lore raw
Quoted 17 lines · Mike Frysinger
Quoted 16 lines · Paul Mundt
Quoted 7 lines · Robin Getz

On Mon 21 May 2007 06:09, Bryan Wu pondered:

Quoted 2 lines

Lots of update for 2.6.22-rc2 and tested on STAMP537 board.

One of the things I noticed when trying out 2.6.22-rc1, on blackfin was:

CALL scripts/checksyscalls.sh

[snip syscalls]

Quoted 4 lines

since there is noMMU, are we better:
- putting stubs (return ENOSYS - give runtime errors), or
- just ignore the errors - and give compile errors? (Is there any way

to put

Quoted 1 line

something into the syscall table, as not to get the warnings?)

Quoted 7 lines
Quoted 3 lines

No, you'd be better of figuring out which ones you can support and which ones you have to -ENOSYS. CONFIG_MMU=n is not a "get out of syscalls free" card. Many of these have no dependency on CONFIG_MMU, anyways.

when you say -ENOSYS, do you mean we need sys_foo() that simply does return -ENOSYS or do we just let the default syscall code go "__NR_foo is not registered, return -ENOSYS"

The checksyscalls.sh errors come from the fact you have missing definitions in asm-blackfin/unistd.h, however, you still have reserved slots for most of these syscalls (and explicit sys_ni_syscall wrapping in the syscall table), just no __NR_foo definition.

It's also not clear which of these you are explicitly never going to support versus the ones that simply haven't been implemented yet (ie, kexec support, restartable system calls -- how do you even do ppoll/pselect6 without supporting these?, and so on).

I would suggest simply defining the __NR_foo values based on the reserved slots that they already occupy in order to silence these warnings, at least that's a closer approximation of "we've actually looked at these syscalls" than "new or otherwise unintentionally unimplemented", which is what the script aims to help with.