From a9b2fb5ee3114fe835f6515b6aeae7454f66d821 Mon Sep 17 00:00:00 2001 From: Michael Sevakis Date: Tue, 16 Oct 2007 01:25:17 +0000 Subject: Finally full multicore support for PortalPlayer 502x targets with an eye towards the possibility of other types. All SVN targets the low-lag code to speed up blocking operations. Most files are modified here simple due to a name change to actually support a real event object and a param change to create_thread. Add some use of new features but just sit on things for a bit and leave full integration for later. Work will continue on to address size on sensitive targets and simplify things if possible. Any PP target having problems with SWP can easily be changed to sw corelocks with one #define change in config.h though only PP5020 has shown an issue and seems to work without any difficulties. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15134 a1c6a512-1295-4272-9138-f99709370657 --- firmware/target/arm/i2c-pp.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'firmware/target/arm/i2c-pp.c') diff --git a/firmware/target/arm/i2c-pp.c b/firmware/target/arm/i2c-pp.c index 1cc25a1a10..e5813f9f9a 100644 --- a/firmware/target/arm/i2c-pp.c +++ b/firmware/target/arm/i2c-pp.c @@ -132,18 +132,18 @@ static int pp_i2c_send_byte(unsigned int addr, int data0) } /* Public functions */ -static struct mutex i2c_mutex; +struct spinlock i2c_spin NOCACHEBSS_ATTR; int i2c_readbytes(unsigned int dev_addr, int addr, int len, unsigned char *data) { unsigned int temp; int i; - spinlock_lock(&i2c_mutex); + spinlock_lock(&i2c_spin); pp_i2c_send_byte(dev_addr, addr); for (i = 0; i < len; i++) { pp_i2c_read_byte(dev_addr, &temp); data[i] = temp; } - spinlock_unlock(&i2c_mutex); + spinlock_unlock(&i2c_spin); return i; } @@ -151,10 +151,10 @@ int i2c_readbyte(unsigned int dev_addr, int addr) { int data; - spinlock_lock(&i2c_mutex); + spinlock_lock(&i2c_spin); pp_i2c_send_byte(dev_addr, addr); pp_i2c_read_byte(dev_addr, &data); - spinlock_unlock(&i2c_mutex); + spinlock_unlock(&i2c_spin); return data; } @@ -167,9 +167,9 @@ int pp_i2c_send(unsigned int addr, int data0, int data1) data[0] = data0; data[1] = data1; - spinlock_lock(&i2c_mutex); + spinlock_lock(&i2c_spin); retval = pp_i2c_send_bytes(addr, 2, data); - spinlock_unlock(&i2c_mutex); + spinlock_unlock(&i2c_spin); return retval; } @@ -221,7 +221,7 @@ void i2c_init(void) #endif #endif - spinlock_init(&i2c_mutex); + spinlock_init(&i2c_spin IF_COP(, SPINLOCK_TASK_SWITCH)); i2c_readbyte(0x8, 0); } -- cgit v1.2.3