From 8636e6949e802556da1588b814e454155358df90 Mon Sep 17 00:00:00 2001 From: Jens Arnold Date: Wed, 11 Apr 2007 23:51:00 +0000 Subject: Moved SH1 system code to target tree. * First shot at hwcompat cleanup. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13114 a1c6a512-1295-4272-9138-f99709370657 --- firmware/target/sh/archos/ata-archos.c | 2 +- firmware/target/sh/archos/fm_v2/usb-fm_v2.c | 2 +- firmware/target/sh/archos/lcd-archos-bitmap.c | 2 +- firmware/target/sh/archos/ondio/usb-ondio.c | 4 ++-- firmware/target/sh/archos/player/hwcompat-player.c | 26 ++++++++++++++++++++++ firmware/target/sh/archos/recorder/usb-recorder.c | 2 +- 6 files changed, 32 insertions(+), 6 deletions(-) create mode 100644 firmware/target/sh/archos/player/hwcompat-player.c (limited to 'firmware/target/sh/archos') diff --git a/firmware/target/sh/archos/ata-archos.c b/firmware/target/sh/archos/ata-archos.c index 5ad30d6891..53276ce8df 100644 --- a/firmware/target/sh/archos/ata-archos.c +++ b/firmware/target/sh/archos/ata-archos.c @@ -57,7 +57,7 @@ void ata_device_init(void) or_b(0x02, &PADRH); /* release ATA reset */ PACR2 &= 0xBFFF; /* GPIO function for PA7 (IDE enable) */ - if (read_hw_mask() & ATA_ADDRESS_200) + if (HW_MASK & ATA_ADDRESS_200) ata_control = ATA_CONTROL1; else ata_control = ATA_CONTROL2; diff --git a/firmware/target/sh/archos/fm_v2/usb-fm_v2.c b/firmware/target/sh/archos/fm_v2/usb-fm_v2.c index 2b4632e4f7..3dcc3559a3 100644 --- a/firmware/target/sh/archos/fm_v2/usb-fm_v2.c +++ b/firmware/target/sh/archos/fm_v2/usb-fm_v2.c @@ -30,7 +30,7 @@ bool usb_detect(void) void usb_enable(bool on) { - if(read_hw_mask() & USB_ACTIVE_HIGH) + if(HW_MASK & USB_ACTIVE_HIGH) on = !on; if(on) diff --git a/firmware/target/sh/archos/lcd-archos-bitmap.c b/firmware/target/sh/archos/lcd-archos-bitmap.c index b458c81098..28600a9769 100644 --- a/firmware/target/sh/archos/lcd-archos-bitmap.c +++ b/firmware/target/sh/archos/lcd-archos-bitmap.c @@ -73,7 +73,7 @@ static int xoffset; /* needed for flip */ int lcd_default_contrast(void) { - return (read_hw_mask() & LCD_CONTRAST_BIAS) ? 31 : 49; + return (HW_MASK & LCD_CONTRAST_BIAS) ? 31 : 49; } void lcd_set_contrast(int val) diff --git a/firmware/target/sh/archos/ondio/usb-ondio.c b/firmware/target/sh/archos/ondio/usb-ondio.c index 7c09bf3877..c856f3ae2c 100644 --- a/firmware/target/sh/archos/ondio/usb-ondio.c +++ b/firmware/target/sh/archos/ondio/usb-ondio.c @@ -35,14 +35,14 @@ void usb_enable(bool on) { mmc_enable_int_flash_clock(!mmc_detect()); - if (!(read_hw_mask() & MMC_CLOCK_POLARITY)) + if (!(HW_MASK & MMC_CLOCK_POLARITY)) and_b(~0x20, &PBDRH); /* old circuit needs SCK1 = low while on USB */ or_b(0x20, &PADRL); /* enable USB */ and_b(~0x08, &PADRL); /* assert card detect */ } else { - if (!(read_hw_mask() & MMC_CLOCK_POLARITY)) + if (!(HW_MASK & MMC_CLOCK_POLARITY)) or_b(0x20, &PBDRH); /* reset SCK1 = high for old circuit */ and_b(~0x20, &PADRL); /* disable USB */ or_b(0x08, &PADRL); /* deassert card detect */ diff --git a/firmware/target/sh/archos/player/hwcompat-player.c b/firmware/target/sh/archos/player/hwcompat-player.c new file mode 100644 index 0000000000..71bdea383f --- /dev/null +++ b/firmware/target/sh/archos/player/hwcompat-player.c @@ -0,0 +1,26 @@ +/*************************************************************************** + * __________ __ ___. + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ + * \/ \/ \/ \/ \/ + * $Id$ + * + * Copyright (C) 2002 by Linus Nielsen Feltzing + * + * All files in this archive are subject to the GNU General Public License. + * See the file COPYING in the source tree root for full license agreement. + * + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY + * KIND, either express or implied. + * + ****************************************************************************/ + +#include +#include "hwcompat.h" + +bool is_new_player(void) +{ + return (ROM_VERSION > 449) || (ROM_VERSION == 116); +} diff --git a/firmware/target/sh/archos/recorder/usb-recorder.c b/firmware/target/sh/archos/recorder/usb-recorder.c index 2934b32a3c..7ed237068e 100644 --- a/firmware/target/sh/archos/recorder/usb-recorder.c +++ b/firmware/target/sh/archos/recorder/usb-recorder.c @@ -30,7 +30,7 @@ bool usb_detect(void) void usb_enable(bool on) { - if(read_hw_mask() & USB_ACTIVE_HIGH) + if(HW_MASK & USB_ACTIVE_HIGH) on = !on; if(on) -- cgit v1.2.3