summaryrefslogtreecommitdiff
path: root/firmware/export
diff options
context:
space:
mode:
authorSolomon Peachy <pizza@shaftnet.org>2018-06-29 16:09:28 -0400
committerSolomon Peachy <pizza@shaftnet.org>2019-01-02 08:10:01 -0500
commitd4942cc74c82c465ea395637c77ed06565b8b497 (patch)
tree8c1fa737c93f8a2ade5a1566857dc4dc8f578bd6 /firmware/export
parentaf9459a7992596e932c6d8cc0a6366ff0f0b0fca (diff)
Add Xuelin iHIFI 770/770C/800 support
Taken from the xvortex fork (Roman Stolyarov) Ported, rebased, and cleaned up by myself. Change-Id: I7b2bca2d29502f2e4544e42f3d122786dd4b7978
Diffstat (limited to 'firmware/export')
-rw-r--r--firmware/export/audiohw.h6
-rw-r--r--firmware/export/config.h17
-rw-r--r--firmware/export/config/ihifi770.h197
-rw-r--r--firmware/export/config/ihifi770c.h197
-rw-r--r--firmware/export/config/ihifi800.h198
-rw-r--r--firmware/export/config/rk27generic.h2
-rw-r--r--firmware/export/es9018.h39
-rw-r--r--firmware/export/rk27xx.h5
-rw-r--r--firmware/export/wm8740.h83
9 files changed, 738 insertions, 6 deletions
diff --git a/firmware/export/audiohw.h b/firmware/export/audiohw.h
index 09001c8045..458fba3412 100644
--- a/firmware/export/audiohw.h
+++ b/firmware/export/audiohw.h
@@ -165,6 +165,8 @@ struct sound_settings_info
#include "uda1380.h"
#elif defined(HAVE_UDA1341)
#include "uda1341.h"
+#elif defined(HAVE_WM8740)
+#include "wm8740.h"
#elif defined(HAVE_WM8750) || defined(HAVE_WM8751)
#include "wm8751.h"
#elif defined(HAVE_WM8978)
@@ -211,6 +213,8 @@ struct sound_settings_info
#include "nwzlinux_codec.h"
#elif defined(HAVE_CS4398)
#include "cs4398.h"
+#elif defined(HAVE_ES9018)
+#include "es9018.h"
#elif (CONFIG_PLATFORM & (PLATFORM_ANDROID | PLATFORM_MAEMO\
| PLATFORM_PANDORA | PLATFORM_SDL))
#include "hosted_codec.h"
@@ -571,7 +575,7 @@ void audiohw_set_depth_3d(int val);
#ifdef AUDIOHW_HAVE_FILTER_ROLL_OFF
/**
* Set DAC's oversampling filter roll-off.
- * @param val 0 - sharp roll-off, 1 - slow roll-off.
+ * @param val 0 - sharp roll-off, 1 - slow roll-off, 2 - short roll-off, 3 - bypass.
* NOTE: AUDIOHW_CAPS need to contain
* FILTER_ROLL_OFF_CAP
*/
diff --git a/firmware/export/config.h b/firmware/export/config.h
index 8b177963d3..2db12bea4a 100644
--- a/firmware/export/config.h
+++ b/firmware/export/config.h
@@ -169,6 +169,8 @@
#define SONY_NWZA860_PAD 64 /* The NWZ-A860 is too different (touchscreen) */
#define AGPTEK_ROCKER_PAD 65
#define XDUOO_X3_PAD 66
+#define IHIFI_770_PAD 67
+#define IHIFI_800_PAD 68
/* CONFIG_REMOTE_KEYPAD */
#define H100_REMOTE 1
@@ -284,6 +286,9 @@
#define LCD_NWZ_LINUX 63 /* as used in the Linux-based NWZ series */
#define LCD_INGENIC_LINUX 64
#define LCD_XDUOOX3 65 /* as used by the xDuoo X3 */
+#define LCD_IHIFI770 66 /* as used by IHIFI 770 */
+#define LCD_IHIFI770C 67 /* as used by IHIFI 770C */
+#define LCD_IHIFI800 68 /* as used by IHIFI 800 */
/* LCD_PIXELFORMAT */
#define HORIZONTAL_PACKING 1
@@ -581,6 +586,12 @@ Lyre prototype 1 */
#include "config/samsungypz5.h"
#elif defined(IHIFI760)
#include "config/ihifi760.h"
+#elif defined(IHIFI770)
+#include "config/ihifi770.h"
+#elif defined(IHIFI770C)
+#include "config/ihifi770c.h"
+#elif defined(IHIFI800)
+#include "config/ihifi800.h"
#elif defined(IHIFI960)
#include "config/ihifi960.h"
#elif defined(CREATIVE_ZENXFISTYLE)
@@ -974,7 +985,6 @@ Lyre prototype 1 */
#define USB_STATUS_BY_EVENT
#define USB_DETECT_BY_REQUEST
#elif CONFIG_USBOTG == USBOTG_RK27XX
-#define USB_STATUS_BY_EVENT
#define USB_DETECT_BY_REQUEST
#endif /* CONFIG_USB == */
#endif /* HAVE_USBSTACK */
@@ -1193,7 +1203,7 @@ Lyre prototype 1 */
#endif /* HAVE_USB_CHARGING_ENABLE && HAVE_USBSTACK */
#ifndef SIMULATOR
-#if defined(HAVE_USBSTACK) || (CONFIG_STORAGE & STORAGE_NAND)
+#if defined(HAVE_USBSTACK) || (CONFIG_STORAGE & STORAGE_NAND) || (CONFIG_STORAGE & STORAGE_RAMDISK)
#define STORAGE_GET_INFO
#endif
#endif
@@ -1211,7 +1221,8 @@ Lyre prototype 1 */
(CONFIG_USBOTG == USBOTG_JZ4760) || \
(CONFIG_USBOTG == USBOTG_M66591) || \
(CONFIG_USBOTG == USBOTG_DESIGNWARE) || \
- (CONFIG_USBOTG == USBOTG_AS3525)
+ (CONFIG_USBOTG == USBOTG_AS3525) || \
+ (CONFIG_USBOTG == USBOTG_RK27XX)
#define USB_HAS_BULK
#define USB_HAS_INTERRUPT
#elif defined(CPU_TCC780X) || defined(CPU_TCC77X)
diff --git a/firmware/export/config/ihifi770.h b/firmware/export/config/ihifi770.h
new file mode 100644
index 0000000000..af7acff206
--- /dev/null
+++ b/firmware/export/config/ihifi770.h
@@ -0,0 +1,197 @@
+/*
+ * This config file is for IHIFI 770
+ */
+
+/* For Rolo and boot loader */
+#define MODEL_NUMBER 108
+
+#define MODEL_NAME "IHIFI 770"
+
+/* Define bitmask of input sources - recordable bitmask can be defined
+ explicitly if different */
+/* #define INPUT_SRC_CAPS (SRC_CAP_MIC | SRC_CAP_FM) */
+
+/* define the bitmask of hardware sample rates */
+#define HW_SAMPR_CAPS (SAMPR_CAP_96 | SAMPR_CAP_48 | SAMPR_CAP_44 | \
+ SAMPR_CAP_32 | SAMPR_CAP_24 | SAMPR_CAP_22 | \
+ SAMPR_CAP_16 | SAMPR_CAP_12 | SAMPR_CAP_11 | SAMPR_CAP_8)
+
+#define HAVE_WM8740
+#define CODEC_SLAVE
+
+/* define this if you have a bitmap LCD display */
+#define HAVE_LCD_BITMAP
+
+/* define this if you can flip your LCD */
+/* #define HAVE_LCD_FLIP */
+
+/* define this if you have a colour LCD */
+#define HAVE_LCD_COLOR
+
+/* define this if you want album art for this target */
+#define HAVE_ALBUMART
+
+/* define this to enable bitmap scaling */
+#define HAVE_BMP_SCALING
+
+/* define this to enable JPEG decoding */
+#define HAVE_JPEG
+
+/* define this if you can invert the colours on your LCD */
+/* #define HAVE_LCD_INVERT */
+
+/* define this if you have access to the quickscreen */
+#define HAVE_QUICKSCREEN
+
+/* define this if you would like tagcache to build on this target */
+#define HAVE_TAGCACHE
+
+/* define this if you have a flash memory storage */
+#define HAVE_FLASH_STORAGE
+
+#define CONFIG_STORAGE (STORAGE_SD | STORAGE_NAND)
+
+#define CONFIG_NAND NAND_RK27XX
+#define HAVE_SW_TONE_CONTROLS
+
+#define HAVE_HOTSWAP
+
+#define NUM_DRIVES 1
+#define SECTOR_SIZE 512
+
+/* for small(ish) SD cards */
+#define HAVE_FAT16SUPPORT
+
+/* LCD dimensions */
+#define LCD_WIDTH 320
+#define LCD_HEIGHT 240
+/* sqrt(320^2 + 240^2) / 2.4 = 166.7 */
+#define LCD_DPI 167
+#define LCD_DEPTH 16 /* pseudo 262.144 colors */
+#define LCD_PIXELFORMAT RGB565 /* rgb565 */
+
+/* Define this if the LCD can shut down */
+/* #define HAVE_LCD_SHUTDOWN */
+
+/* Define this if your LCD can be enabled/disabled */
+#define HAVE_LCD_ENABLE
+
+/* Define this if your LCD can be put to sleep. HAVE_LCD_ENABLE
+ should be defined as well. */
+#ifndef BOOTLOADER
+/* TODO: #define HAVE_LCD_SLEEP */
+/* TODO: #define HAVE_LCD_SLEEP_SETTING */
+#endif
+
+#define CONFIG_KEYPAD IHIFI_770_PAD
+
+/* define this if the target has volume keys which can be used in the lists */
+#define HAVE_VOLUME_IN_LIST
+
+/* Define this if a programmable hotkey is mapped */
+/* #define HAVE_HOTKEY */
+
+/* Define this if you do software codec */
+#define CONFIG_CODEC SWCODEC
+
+/* define this if you have a real-time clock */
+/* #define CONFIG_RTC RTC_NANO2G */
+
+/* Define if the device can wake from an RTC alarm */
+/* #define HAVE_RTC_ALARM */
+
+/* Define the type of audio codec */
+/*#define HAVE_RK27XX_CODEC */
+
+/* #define HAVE_PCM_DMA_ADDRESS */
+
+/* Define this for LCD backlight available */
+#define HAVE_BACKLIGHT
+#define HAVE_BACKLIGHT_BRIGHTNESS
+#define MIN_BRIGHTNESS_SETTING 0
+#define MAX_BRIGHTNESS_SETTING 31
+#define DEFAULT_BRIGHTNESS_SETTING 31
+#define CONFIG_BACKLIGHT_FADING BACKLIGHT_FADING_SW_HW_REG
+
+/* Define this if you have a software controlled poweroff */
+#define HAVE_SW_POWEROFF
+
+/* The number of bytes reserved for loadable codecs */
+#define CODEC_SIZE 0x100000
+
+/* The number of bytes reserved for loadable plugins */
+#define PLUGIN_BUFFER_SIZE 0x80000
+
+#define BATTERY_CAPACITY_DEFAULT 1050 /* default battery capacity */
+#define BATTERY_CAPACITY_MIN 500 /* min. capacity selectable */
+#define BATTERY_CAPACITY_MAX 1050 /* max. capacity selectable */
+#define BATTERY_CAPACITY_INC 10 /* capacity increment */
+#define BATTERY_TYPES_COUNT 1 /* only one type */
+
+#define CONFIG_BATTERY_MEASURE VOLTAGE_MEASURE
+
+/* Hardware controlled charging with monitoring */
+#define CONFIG_CHARGING CHARGING_MONITOR
+
+/* define current usage levels */
+/* TODO: #define CURRENT_NORMAL
+ * TODO: #define CURRENT_BACKLIGHT 23
+ */
+
+/* define this if the unit can be powered or charged via USB */
+#define HAVE_USB_POWER
+
+/* Define this if your LCD can set contrast */
+/* #define HAVE_LCD_CONTRAST */
+
+/* Offset ( in the firmware file's header ) to the file CRC */
+#define FIRMWARE_OFFSET_FILE_CRC 0
+
+/* Offset ( in the firmware file's header ) to the real data */
+#define FIRMWARE_OFFSET_FILE_DATA 8
+
+#define STORAGE_NEEDS_ALIGN
+
+/* Define this if you have adjustable CPU frequency */
+#define HAVE_ADJUSTABLE_CPU_FREQ
+
+/* Virtual LED (icon) */
+#define CONFIG_LED LED_VIRTUAL
+
+/** Non-simulator section **/
+#ifndef SIMULATOR
+
+/* The exact type of CPU */
+#define CONFIG_CPU RK27XX
+
+/* Define this to the CPU frequency */
+#define CPU_FREQ 200000000
+
+/* I2C interface */
+#define CONFIG_I2C I2C_RK27XX
+
+/* define this if the hardware can be powered off while charging */
+/* #define HAVE_POWEROFF_WHILE_CHARGING */
+
+/* Type of LCD */
+#define CONFIG_LCD LCD_IHIFI770
+
+/* USB On-the-go */
+#define CONFIG_USBOTG USBOTG_RK27XX
+
+/* enable these for the experimental usb stack */
+#define HAVE_USBSTACK
+
+#define USB_VENDOR_ID 0x071b
+#define USB_PRODUCT_ID 0x3202
+#define HAVE_BOOTLOADER_USB_MODE
+
+#define RKW_FORMAT
+#define BOOTFILE_EXT "rkw"
+#define BOOTFILE "rockbox." BOOTFILE_EXT
+#define BOOTDIR "/.rockbox"
+
+/* disabled for now */
+#undef HAVE_HOTSWAP
+
+#endif /* SIMULATOR */
diff --git a/firmware/export/config/ihifi770c.h b/firmware/export/config/ihifi770c.h
new file mode 100644
index 0000000000..c4058f337b
--- /dev/null
+++ b/firmware/export/config/ihifi770c.h
@@ -0,0 +1,197 @@
+/*
+ * This config file is for IHIFI 770C
+ */
+
+/* For Rolo and boot loader */
+#define MODEL_NUMBER 108
+
+#define MODEL_NAME "IHIFI 770C"
+
+/* Define bitmask of input sources - recordable bitmask can be defined
+ explicitly if different */
+/* #define INPUT_SRC_CAPS (SRC_CAP_MIC | SRC_CAP_FM) */
+
+/* define the bitmask of hardware sample rates */
+#define HW_SAMPR_CAPS (SAMPR_CAP_96 | SAMPR_CAP_48 | SAMPR_CAP_44 | \
+ SAMPR_CAP_32 | SAMPR_CAP_24 | SAMPR_CAP_22 | \
+ SAMPR_CAP_16 | SAMPR_CAP_12 | SAMPR_CAP_11 | SAMPR_CAP_8)
+
+#define HAVE_WM8740
+#define CODEC_SLAVE
+
+/* define this if you have a bitmap LCD display */
+#define HAVE_LCD_BITMAP
+
+/* define this if you can flip your LCD */
+/* #define HAVE_LCD_FLIP */
+
+/* define this if you have a colour LCD */
+#define HAVE_LCD_COLOR
+
+/* define this if you want album art for this target */
+#define HAVE_ALBUMART
+
+/* define this to enable bitmap scaling */
+#define HAVE_BMP_SCALING
+
+/* define this to enable JPEG decoding */
+#define HAVE_JPEG
+
+/* define this if you can invert the colours on your LCD */
+/* #define HAVE_LCD_INVERT */
+
+/* define this if you have access to the quickscreen */
+#define HAVE_QUICKSCREEN
+
+/* define this if you would like tagcache to build on this target */
+#define HAVE_TAGCACHE
+
+/* define this if you have a flash memory storage */
+#define HAVE_FLASH_STORAGE
+
+#define CONFIG_STORAGE (STORAGE_SD | STORAGE_NAND)
+
+#define CONFIG_NAND NAND_RK27XX
+#define HAVE_SW_TONE_CONTROLS
+
+#define HAVE_HOTSWAP
+
+#define NUM_DRIVES 1
+#define SECTOR_SIZE 512
+
+/* for small(ish) SD cards */
+#define HAVE_FAT16SUPPORT
+
+/* LCD dimensions */
+#define LCD_WIDTH 320
+#define LCD_HEIGHT 240
+/* sqrt(320^2 + 240^2) / 2.4 = 166.7 */
+#define LCD_DPI 167
+#define LCD_DEPTH 16 /* pseudo 262.144 colors */
+#define LCD_PIXELFORMAT RGB565 /* rgb565 */
+
+/* Define this if the LCD can shut down */
+/* #define HAVE_LCD_SHUTDOWN */
+
+/* Define this if your LCD can be enabled/disabled */
+#define HAVE_LCD_ENABLE
+
+/* Define this if your LCD can be put to sleep. HAVE_LCD_ENABLE
+ should be defined as well. */
+#ifndef BOOTLOADER
+/* TODO: #define HAVE_LCD_SLEEP */
+/* TODO: #define HAVE_LCD_SLEEP_SETTING */
+#endif
+
+#define CONFIG_KEYPAD IHIFI_770_PAD
+
+/* define this if the target has volume keys which can be used in the lists */
+#define HAVE_VOLUME_IN_LIST
+
+/* Define this if a programmable hotkey is mapped */
+/* #define HAVE_HOTKEY */
+
+/* Define this if you do software codec */
+#define CONFIG_CODEC SWCODEC
+
+/* define this if you have a real-time clock */
+/* #define CONFIG_RTC RTC_NANO2G */
+
+/* Define if the device can wake from an RTC alarm */
+/* #define HAVE_RTC_ALARM */
+
+/* Define the type of audio codec */
+/*#define HAVE_RK27XX_CODEC */
+
+/* #define HAVE_PCM_DMA_ADDRESS */
+
+/* Define this for LCD backlight available */
+#define HAVE_BACKLIGHT
+#define HAVE_BACKLIGHT_BRIGHTNESS
+#define MIN_BRIGHTNESS_SETTING 0
+#define MAX_BRIGHTNESS_SETTING 31
+#define DEFAULT_BRIGHTNESS_SETTING 31
+#define CONFIG_BACKLIGHT_FADING BACKLIGHT_FADING_SW_HW_REG
+
+/* Define this if you have a software controlled poweroff */
+#define HAVE_SW_POWEROFF
+
+/* The number of bytes reserved for loadable codecs */
+#define CODEC_SIZE 0x100000
+
+/* The number of bytes reserved for loadable plugins */
+#define PLUGIN_BUFFER_SIZE 0x80000
+
+#define BATTERY_CAPACITY_DEFAULT 1050 /* default battery capacity */
+#define BATTERY_CAPACITY_MIN 500 /* min. capacity selectable */
+#define BATTERY_CAPACITY_MAX 1050 /* max. capacity selectable */
+#define BATTERY_CAPACITY_INC 10 /* capacity increment */
+#define BATTERY_TYPES_COUNT 1 /* only one type */
+
+#define CONFIG_BATTERY_MEASURE VOLTAGE_MEASURE
+
+/* Hardware controlled charging with monitoring */
+#define CONFIG_CHARGING CHARGING_MONITOR
+
+/* define current usage levels */
+/* TODO: #define CURRENT_NORMAL
+ * TODO: #define CURRENT_BACKLIGHT 23
+ */
+
+/* define this if the unit can be powered or charged via USB */
+#define HAVE_USB_POWER
+
+/* Define this if your LCD can set contrast */
+/* #define HAVE_LCD_CONTRAST */
+
+/* Offset ( in the firmware file's header ) to the file CRC */
+#define FIRMWARE_OFFSET_FILE_CRC 0
+
+/* Offset ( in the firmware file's header ) to the real data */
+#define FIRMWARE_OFFSET_FILE_DATA 8
+
+#define STORAGE_NEEDS_ALIGN
+
+/* Define this if you have adjustable CPU frequency */
+#define HAVE_ADJUSTABLE_CPU_FREQ
+
+/* Virtual LED (icon) */
+#define CONFIG_LED LED_VIRTUAL
+
+/** Non-simulator section **/
+#ifndef SIMULATOR
+
+/* The exact type of CPU */
+#define CONFIG_CPU RK27XX
+
+/* Define this to the CPU frequency */
+#define CPU_FREQ 200000000
+
+/* I2C interface */
+#define CONFIG_I2C I2C_RK27XX
+
+/* define this if the hardware can be powered off while charging */
+/* #define HAVE_POWEROFF_WHILE_CHARGING */
+
+/* Type of LCD */
+#define CONFIG_LCD LCD_IHIFI770C
+
+/* USB On-the-go */
+#define CONFIG_USBOTG USBOTG_RK27XX
+
+/* enable these for the experimental usb stack */
+#define HAVE_USBSTACK
+
+#define USB_VENDOR_ID 0x071b
+#define USB_PRODUCT_ID 0x3202
+#define HAVE_BOOTLOADER_USB_MODE
+
+#define RKW_FORMAT
+#define BOOTFILE_EXT "rkw"
+#define BOOTFILE "rockbox." BOOTFILE_EXT
+#define BOOTDIR "/.rockbox"
+
+/* disabled for now */
+#undef HAVE_HOTSWAP
+
+#endif /* SIMULATOR */
diff --git a/firmware/export/config/ihifi800.h b/firmware/export/config/ihifi800.h
new file mode 100644
index 0000000000..eb1c2015ad
--- /dev/null
+++ b/firmware/export/config/ihifi800.h
@@ -0,0 +1,198 @@
+/*
+ * This config file is for IHIFI 800
+ */
+
+/* For Rolo and boot loader */
+#define MODEL_NUMBER 109
+
+#define MODEL_NAME "IHIFI 800"
+
+/* Define bitmask of input sources - recordable bitmask can be defined
+ explicitly if different */
+/* #define INPUT_SRC_CAPS (SRC_CAP_MIC | SRC_CAP_FM) */
+
+/* define the bitmask of hardware sample rates */
+#define HW_SAMPR_CAPS (SAMPR_CAP_96 | SAMPR_CAP_48 | SAMPR_CAP_44 | \
+ SAMPR_CAP_32 | SAMPR_CAP_24 | SAMPR_CAP_22 | \
+ SAMPR_CAP_16 | SAMPR_CAP_12 | SAMPR_CAP_11 | SAMPR_CAP_8)
+
+#define HAVE_ES9018
+#define CODEC_SLAVE
+
+/* define this if you have a bitmap LCD display */
+#define HAVE_LCD_BITMAP
+
+/* define this if you can flip your LCD */
+/* #define HAVE_LCD_FLIP */
+
+/* define this if you have a colour LCD */
+#define HAVE_LCD_COLOR
+
+/* define this if you want album art for this target */
+#define HAVE_ALBUMART
+
+/* define this to enable bitmap scaling */
+#define HAVE_BMP_SCALING
+
+/* define this to enable JPEG decoding */
+#define HAVE_JPEG
+
+/* define this if you can invert the colours on your LCD */
+/* #define HAVE_LCD_INVERT */
+
+/* define this if you have access to the quickscreen */
+#define HAVE_QUICKSCREEN
+
+/* define this if you would like tagcache to build on this target */
+#define HAVE_TAGCACHE
+
+/* define this if you have a flash memory storage */
+#define HAVE_FLASH_STORAGE
+
+#define CONFIG_STORAGE (STORAGE_SD | STORAGE_NAND)
+
+#define CONFIG_NAND NAND_RK27XX
+#define HAVE_SW_TONE_CONTROLS
+
+#define HAVE_HOTSWAP
+
+#define NUM_DRIVES 1
+#define SECTOR_SIZE 512
+
+/* for small(ish) SD cards */
+#define HAVE_FAT16SUPPORT
+
+/* LCD dimensions */
+#define LCD_WIDTH 240
+#define LCD_HEIGHT 320
+/* sqrt(240^2 + 320^2) / 2.4 = 166.7 */
+#define LCD_DPI 167
+#define LCD_DEPTH 16 /* pseudo 262.144 colors */
+#define LCD_PIXELFORMAT RGB565 /* rgb565 */
+
+/* Define this if the LCD can shut down */
+/* #define HAVE_LCD_SHUTDOWN */
+
+/* Define this if your LCD can be enabled/disabled */
+#define HAVE_LCD_ENABLE
+
+/* Define this if your LCD can be put to sleep. HAVE_LCD_ENABLE
+ should be defined as well. */
+#ifndef BOOTLOADER
+/* TODO: #define HAVE_LCD_SLEEP */
+/* TODO: #define HAVE_LCD_SLEEP_SETTING */
+#endif
+
+#define CONFIG_KEYPAD IHIFI_800_PAD
+
+/* define this if the target has volume keys which can be used in the lists */
+#define HAVE_VOLUME_IN_LIST
+
+/* Define this if a programmable hotkey is mapped */
+/* #define HAVE_HOTKEY */
+
+/* Define this if you do software codec */
+#define CONFIG_CODEC SWCODEC
+
+/* define this if you have a real-time clock */
+/* #define CONFIG_RTC RTC_NANO2G */
+
+/* Define if the device can wake from an RTC alarm */
+/* #define HAVE_RTC_ALARM */
+
+/* Define the type of audio codec */
+/*#define HAVE_RK27XX_CODEC */
+
+/* #define HAVE_PCM_DMA_ADDRESS */
+
+/* Define this for LCD backlight available */
+#define HAVE_BACKLIGHT
+#define HAVE_BACKLIGHT_BRIGHTNESS
+#define MIN_BRIGHTNESS_SETTING 0
+#define MAX_BRIGHTNESS_SETTING 31
+#define DEFAULT_BRIGHTNESS_SETTING 31
+#define CONFIG_BACKLIGHT_FADING BACKLIGHT_FADING_SW_HW_REG
+
+/* Define this if you have a software controlled poweroff */
+#define HAVE_SW_POWEROFF
+
+/* The number of bytes reserved for loadable codecs */
+#define CODEC_SIZE 0x100000
+
+/* The number of bytes reserved for loadable plugins */
+#define PLUGIN_BUFFER_SIZE 0x80000
+
+/* TODO: Figure out real values */
+#define BATTERY_CAPACITY_DEFAULT 1400 /* default battery capacity */
+#define BATTERY_CAPACITY_MIN 700 /* min. capacity selectable */
+#define BATTERY_CAPACITY_MAX 1400 /* max. capacity selectable */
+#define BATTERY_CAPACITY_INC 10 /* capacity increment */
+#define BATTERY_TYPES_COUNT 1 /* only one type */
+
+#define CONFIG_BATTERY_MEASURE VOLTAGE_MEASURE
+
+/* Hardware controlled charging with monitoring */
+#define CONFIG_CHARGING CHARGING_MONITOR
+
+/* define current usage levels */
+/* TODO: #define CURRENT_NORMAL
+ * TODO: #define CURRENT_BACKLIGHT 23
+ */
+
+/* define this if the unit can be powered or charged via USB */
+#define HAVE_USB_POWER
+
+/* Define this if your LCD can set contrast */
+/* #define HAVE_LCD_CONTRAST */
+
+/* Offset ( in the firmware file's header ) to the file CRC */
+#define FIRMWARE_OFFSET_FILE_CRC 0
+
+/* Offset ( in the firmware file's header ) to the real data */
+#define FIRMWARE_OFFSET_FILE_DATA 8
+
+#define STORAGE_NEEDS_ALIGN
+
+/* Define this if you have adjustable CPU frequency */
+#define HAVE_ADJUSTABLE_CPU_FREQ
+
+/* Virtual LED (icon) */
+#define CONFIG_LED LED_VIRTUAL
+
+/** Non-simulator section **/
+#ifndef SIMULATOR
+
+/* The exact type of CPU */
+#define CONFIG_CPU RK27XX
+
+/* Define this to the CPU frequency */
+#define CPU_FREQ 200000000
+
+/* I2C interface */
+#define CONFIG_I2C I2C_RK27XX
+
+/* define this if the hardware can be powered off while charging */
+/* #define HAVE_POWEROFF_WHILE_CHARGING */
+
+/* Type of LCD */
+#define CONFIG_LCD LCD_IHIFI800
+
+/* USB On-the-go */
+#define CONFIG_USBOTG USBOTG_RK27XX
+
+/* enable these for the experimental usb stack */
+#define HAVE_USBSTACK
+
+#define USB_VENDOR_ID 0x071b
+#define USB_PRODUCT_ID 0x3202
+#define HAVE_BOOTLOADER_USB_MODE
+
+#define RKW_FORMAT
+#define BOOTFILE_EXT "rkw"
+#define BOOTFILE "rockbox." BOOTFILE_EXT
+#define BOOTDIR "/.rockbox"
+
+/* disabled for now */
+#undef HAVE_HOTSWAP
+
+#endif /* SIMULATOR */
diff --git a/firmware/export/config/rk27generic.h b/firmware/export/config/rk27generic.h
index 503857bd43..69cf9f3758 100644
--- a/firmware/export/config/rk27generic.h
+++ b/firmware/export/config/rk27generic.h
@@ -63,7 +63,7 @@
/* commented for now */
/* #define HAVE_HOTSWAP */
-#define NUM_DRIVES 2
+#define NUM_DRIVES 1
#define SECTOR_SIZE 512
/* for small(ish) SD cards */
diff --git a/firmware/export/es9018.h b/firmware/export/es9018.h
new file mode 100644
index 0000000000..41ea0d0b1c
--- /dev/null
+++ b/firmware/export/es9018.h
@@ -0,0 +1,39 @@
+/***************************************************************************
+ * __________ __ ___.
+ * Open \______ \ ____ ____ | | _\_ |__ _______ ___
+ * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
+ * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
+ * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
+ * \/ \/ \/ \/ \/
+ * $Id$
+ *
+ * Copyright (C) 2016 by Roman Stolyarov
+ *
+ * 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 software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
+ * KIND, either express or implied.
+ *
+ ****************************************************************************/
+
+#ifndef _ES9018_H
+#define _ES9018_H
+
+#define ES9018_VOLUME_MIN -1270
+#define ES9018_VOLUME_MAX 0
+
+#define AUDIOHW_CAPS (FILTER_ROLL_OFF_CAP)
+#define AUDIOHW_HAVE_SHORT_ROLL_OFF
+AUDIOHW_SETTING(VOLUME, "dB", 0, 1, ES9018_VOLUME_MIN/10, ES9018_VOLUME_MAX/10, 0)
+AUDIOHW_SETTING(FILTER_ROLL_OFF, "", 0, 1, 0, 3, 0)
+
+void es9018_write_reg(uint8_t reg, uint8_t val);
+uint8_t es9018_read_reg(uint8_t reg);
+
+void audiohw_mute(void);
+void audiohw_unmute(void);
+
+#endif
diff --git a/firmware/export/rk27xx.h b/firmware/export/rk27xx.h
index 58b3fe8166..dc6bca7cbd 100644
--- a/firmware/export/rk27xx.h
+++ b/firmware/export/rk27xx.h
@@ -8,7 +8,8 @@
#define FLASH_BANK1 0x11000000
#define USB_NUM_ENDPOINTS 16
-#define USB_DEVBSS_ATTR
+/* cache aligned */
+#define USB_DEVBSS_ATTR __attribute__((aligned(CACHEALIGN_SIZE)))
/* Timers */
#define APB0_TIMER (ARM_BUS0_BASE + 0x00000000)
@@ -811,6 +812,7 @@
#define RXVOIDINTEN (1<<5)
#define RXERRINTEN (1<<6)
#define RXACKINTEN (1<<7)
+#define RXCFINTE (1<<12)
/* bits 31:8 reserved for EP0 */
/* bits 31:14 reserved for others */
@@ -833,6 +835,7 @@
#define TXERRINTEN (1<<5)
#define TXACKINTEN (1<<6)
#define TXDMADNEN (1<<7) /* reserved for EP0 */
+#define TXCFINTE (1<<12)
/* bits 31:8 reserved */
/* TXnBUF bits */
diff --git a/firmware/export/wm8740.h b/firmware/export/wm8740.h
new file mode 100644
index 0000000000..ff27a7e41e
--- /dev/null
+++ b/firmware/export/wm8740.h
@@ -0,0 +1,83 @@
+/***************************************************************************
+ * __________ __ ___.
+ * Open \______ \ ____ ____ | | _\_ |__ _______ ___
+ * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
+ * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
+ * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
+ * \/ \/ \/ \/ \/
+ * $Id$
+ *
+ * Copyright (C) 2016 by Roman Stolyarov
+ *
+ * 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 software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
+ * KIND, either express or implied.
+ *
+ ****************************************************************************/
+
+#ifndef _WM8740_H
+#define _WM8740_H
+
+#define WM8740_VOLUME_MIN -1270
+#define WM8740_VOLUME_MAX 0
+
+#define AUDIOHW_CAPS (FILTER_ROLL_OFF_CAP)
+AUDIOHW_SETTING(VOLUME, "dB", 0, 1, WM8740_VOLUME_MIN/10, WM8740_VOLUME_MAX/10, 0)
+AUDIOHW_SETTING(FILTER_ROLL_OFF, "", 0, 1, 0, 1, 0)
+
+#define WM8740_REG0 0x0000
+#define WM8740_REG1 0x0200
+#define WM8740_REG2 0x0400
+#define WM8740_REG3 0x0600
+#define WM8740_REG4 0x0C00
+
+/**
+ * Register #0
+ */
+#define WM8740_LDL (1<<8)
+
+/**
+ * Register #1
+ */
+#define WM8740_LDR (1<<8)
+
+/**
+ * Register #2
+ */
+#define WM8740_MUT (1<<0)
+#define WM8740_DEM (1<<1)
+#define WM8740_OPE (1<<2)
+#define WM8740_IW0 (1<<3)
+#define WM8740_IW1 (1<<4)
+
+/**
+ * Register #3
+ */
+#define WM8740_I2S (1<<0)
+#define WM8740_LRP (1<<1)
+#define WM8740_ATC (1<<2)
+#define WM8740_SR0 (1<<3)
+#define WM8740_REV (1<<4)
+#define WM8740_SF0 (1<<6)
+#define WM8740_SF1 (1<<7)
+#define WM8740_IZD (1<<8)
+
+/**
+ * Register #4
+ */
+#define WM8740_DIFF0 (1<<4)
+#define WM8740_DIFF1 (1<<5)
+#define WM8740_CDD (1<<6)
+
+void audiohw_mute(void);
+void audiohw_unmute(void);
+
+void wm8740_set_ml(const int);
+void wm8740_set_mc(const int);
+void wm8740_set_md(const int);
+
+#endif