wm8978: Clean out silly macros. Use 'POS' convention instead for shifted bitfields...
[kugel-rb.git] / firmware / export / hwcompat.h
blob27fcb25e3683edaccb0da848f265aa56c8e47df1
1 /***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
10 * Copyright (C) 2002 by Linus Nielsen Feltzing
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
20 ****************************************************************************/
21 #ifndef HWCOMPAT_H
22 #define HWCOMPAT_H
24 #include <stdbool.h>
25 #include "config.h"
27 #if (CONFIG_CPU == SH7034) && !defined(SIMULATOR)
29 #define ROM_VERSION (*(short *)0x020000fe)
31 /* Bit mask values for HW compatibility */
32 #define ATA_ADDRESS_200 0x0100
33 #define USB_ACTIVE_HIGH 0x0100
34 #define PR_ACTIVE_HIGH 0x0100
35 #define LCD_CONTRAST_BIAS 0x0200
36 #define MMC_CLOCK_POLARITY 0x0400
37 #define TUNER_MODEL 0x0800
39 #ifdef ARCHOS_PLAYER
40 #define HW_MASK 0
41 #else /* Recorders, Ondios */
42 #define HW_MASK (*(short *)0x020000fc)
43 #endif
45 #ifdef CONFIG_TUNER_MULTI
46 static inline int tuner_detect_type(void)
48 return (HW_MASK & TUNER_MODEL) ? TEA5767 : S1A0903X01;
50 #endif
52 #endif /* (CONFIG_CPU == SH7034) && !SIMULATOR */
54 #ifdef ARCHOS_PLAYER
55 bool is_new_player(void);
56 #endif
58 #ifdef IPOD_ARCH
59 #ifdef IPOD_VIDEO
60 #ifdef BOOTLOADER
61 #define IPOD_HW_REVISION (*((unsigned long*)(0x0000405c)))
62 #else /* ROM is remapped */
63 #define IPOD_HW_REVISION (*((unsigned long*)(0x2000405c)))
64 #endif
65 #else /* !IPOD_VIDEO */
66 #ifdef BOOTLOADER
67 #define IPOD_HW_REVISION (*((unsigned long*)(0x00002084)))
68 #else /* ROM is remapped */
69 #define IPOD_HW_REVISION (*((unsigned long*)(0x20002084)))
70 #endif
71 #endif /* !IPOD_VIDEO */
72 #endif /* IPOD_ARCH */
74 #endif /* HWCOMPAT_H */