summaryrefslogtreecommitdiff
path: root/firmware/export
diff options
context:
space:
mode:
authorAndrew Ryabinin <ryabinin.a.a@gmail.com>2013-04-15 09:51:22 +0400
committerAndrew Ryabinin <ryabinin.a.a@gmail.com>2013-05-06 14:09:24 +0400
commitfa4e1baa83a5f3f28f98b5b744b7692be9fb4fca (patch)
treedbb558d0e36b25031131d0c1e62f8c1ff8238470 /firmware/export
parent3fd25dcbed6ef964b828698facf6cc15189441ca (diff)
downloadrockbox-fa4e1baa83a5f3f28f98b5b744b7692be9fb4fca.zip
rockbox-fa4e1baa83a5f3f28f98b5b744b7692be9fb4fca.tar.gz
rockbox-fa4e1baa83a5f3f28f98b5b744b7692be9fb4fca.tar.bz2
rockbox-fa4e1baa83a5f3f28f98b5b744b7692be9fb4fca.tar.xz
Introduce HiFi E.T MA9 port.
Change-Id: I79aadc958fd5222f26f91ed127f8c6fb2c465dc2
Diffstat (limited to 'firmware/export')
-rw-r--r--firmware/export/audiohw.h2
-rw-r--r--firmware/export/config.h4
-rw-r--r--firmware/export/config/hifietma9.h153
-rw-r--r--firmware/export/df1704.h94
-rw-r--r--firmware/export/pca9555.h49
5 files changed, 302 insertions, 0 deletions
diff --git a/firmware/export/audiohw.h b/firmware/export/audiohw.h
index 4379c20..28fa1b0 100644
--- a/firmware/export/audiohw.h
+++ b/firmware/export/audiohw.h
@@ -106,6 +106,8 @@ struct sound_settings_info
#include "imx233-codec.h"
#elif defined(HAVE_DUMMY_CODEC)
#include "dummy_codec.h"
+#elif defined(HAVE_DF1704_CODEC)
+#include "df1704.h"
#elif (CONFIG_PLATFORM & (PLATFORM_ANDROID | PLATFORM_MAEMO\
| PLATFORM_PANDORA | PLATFORM_SDL))
#include "hosted_codec.h"
diff --git a/firmware/export/config.h b/firmware/export/config.h
index 7d7a18c..7252d62 100644
--- a/firmware/export/config.h
+++ b/firmware/export/config.h
@@ -147,6 +147,7 @@
#define SAMSUNG_YPR0_PAD 53
#define CREATIVE_ZENXFI2_PAD 54
#define CREATIVE_ZENXFI3_PAD 55
+#define MA_PAD 56
/* CONFIG_REMOTE_KEYPAD */
#define H100_REMOTE 1
@@ -248,6 +249,7 @@
#define LCD_YPR0 47
#define LCD_CREATIVEZXFI2 48 /* as used by the Creative Zen X-Fi2 */
#define LCD_CREATIVEZXFI3 49 /* as used by the Creative Zen X-Fi3 */
+#define LCD_ILI9342 50 /* as used by HiFi E.T MA9/MA8 */
/* LCD_PIXELFORMAT */
#define HORIZONTAL_PACKING 1
@@ -505,6 +507,8 @@ Lyre prototype 1 */
#include "config/pandora.h"
#elif defined(SAMSUNG_YPR0)
#include "config/samsungypr0.h"
+#elif defined(MA9)
+#include "config/hifietma9.h"
#else
/* no known platform */
#endif
diff --git a/firmware/export/config/hifietma9.h b/firmware/export/config/hifietma9.h
new file mode 100644
index 0000000..516d1fe
--- /dev/null
+++ b/firmware/export/config/hifietma9.h
@@ -0,0 +1,153 @@
+/*
+ * This config file is for HiFiMAN HM-60x reference design
+ */
+
+/* For Rolo and boot loader */
+#define MODEL_NUMBER 83
+
+#define MODEL_NAME "HiFi E.T. MA9"
+
+/* 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_DF1704_CODEC
+
+#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
+
+/* commented for now */
+/* #define HAVE_HOTSWAP */
+
+#define NUM_DRIVES 2
+#define SECTOR_SIZE 512
+
+/* for small(ish) SD cards */
+#define HAVE_FAT16SUPPORT
+
+/* LCD dimensions */
+#define LCD_WIDTH 320
+#define LCD_HEIGHT 240
+#define LCD_DEPTH 16 /* pseudo 262.144 colors */
+#define LCD_PIXELFORMAT RGB565 /* rgb565 */
+
+/* Define this if your LCD can be enabled/disabled */
+#define HAVE_LCD_ENABLE
+
+#define CONFIG_KEYPAD MA_PAD
+
+/* Define this to enable morse code input */
+#define HAVE_MORSE_INPUT
+
+/* Define this if you do software codec */
+#define CONFIG_CODEC SWCODEC
+
+#define CONFIG_LCD LCD_ILI9342
+
+/* 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 600 /* default battery capacity */
+#define BATTERY_CAPACITY_MIN 300 /* min. capacity selectable */
+#define BATTERY_CAPACITY_MAX 600 /* 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
+
+/* USB On-the-go */
+#define CONFIG_USBOTG USBOTG_RK27XX
+
+/* enable these for the experimental usb stack */
+#define HAVE_USBSTACK
+
+#define USE_ROCKBOX_USB
+#define USB_VENDOR_ID 0x071b
+#define USB_PRODUCT_ID 0x3202
+#define HAVE_BOOTLOADER_USB_MODE
+
+/* Define this if your LCD can set contrast */
+/* #define HAVE_LCD_CONTRAST */
+
+/* The exact type of CPU */
+#define CONFIG_CPU RK27XX
+
+/* I2C interface */
+#define CONFIG_I2C I2C_RK27XX
+
+/* Define this to the CPU frequency */
+#define CPU_FREQ 200000000
+
+/* define this if the hardware can be powered off while charging */
+/* #define HAVE_POWEROFF_WHILE_CHARGING */
+
+/* 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
+
+#define RKW_FORMAT
+#define BOOTFILE_EXT "rkw"
+#define BOOTFILE "rockbox." BOOTFILE_EXT
+#define BOOTDIR "/.rockbox"
diff --git a/firmware/export/df1704.h b/firmware/export/df1704.h
new file mode 100644
index 0000000..59d1372
--- /dev/null
+++ b/firmware/export/df1704.h
@@ -0,0 +1,94 @@
+/***************************************************************************
+ * __________ __ ___.
+ * Open \______ \ ____ ____ | | _\_ |__ _______ ___
+ * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
+ * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
+ * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
+ * \/ \/ \/ \/ \/
+ * $Id$
+ *
+ *
+ * Copyright (c) 2013 Andrew Ryabinin
+ *
+ * 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 _DF1704_H
+#define _DF1704_H
+
+#define DF1704_VOLUME_MIN -1270
+#define DF1704_VOLUME_MAX 0
+
+AUDIOHW_SETTING(VOLUME, "dB", 0, 1, DF1704_VOLUME_MIN/10, DF1704_VOLUME_MAX/10, 0)
+
+#define DF1704_MODE(x) (((x)&0x03)<<9)
+
+/**
+ * MODE0 register settings
+ */
+/* Left channel attenuation data load control */
+#define DF1704_LDL_ON (1<<8)
+#define DF1704_LDL_OFF (0<<8)
+
+/**
+ * MODE1 register settings
+ */
+/* Right channel attenuation data load control */
+#define DF1704_LDR_ON (1<<8)
+#define DF1704_LDR_OFF (0<<8)
+
+/**
+ * MODE2 register settings
+ */
+#define DF1704_MUTE_ON (0<<0)
+#define DF1704_MUTE_OFF (1<<0)
+/* Digital De-Emphasis */
+#define DF1704_DEM_ON (1<<1)
+#define DF1704_DEM_OFF (0<<1)
+/* Input data format & word lengths */
+#define DF1704_IW_16_I2S (0<<3)
+#define DF1704_IW_24_I2S (1<<3)
+
+#define DF1704_IW_16_RJ (0<<3)
+#define DF1704_IW_20_RJ (1<<3)
+#define DF1704_IW_24_RJ (2<<3)
+#define DF1704_IW_24_LJ (3<<3)
+/* Output data format & word lengths */
+#define DF1704_OW_16 (0<<5)
+#define DF1704_OW_18 (1<<5)
+#define DF1704_OW_20 (2<<5)
+#define DF1704_OW_24 (3<<5)
+
+/**
+ * MODE3 register settings
+ */
+#define DF1704_I2S_OFF (0<<0)
+#define DF1704_I2S_ON (1<<0)
+#define DF1704_LRP_L (0<<1)
+#define DF1704_LRP_H (1<<1)
+#define DF1704_ATC_ON (1<<2)
+#define DF1704_ATC_OFF (0<<2)
+#define DF1704_SRO_SHARP (0<<3)
+#define DF1704_SRO_SLOW (1<<3)
+/* CLKO output frequency selection */
+#define DF1704_CKO_FULL (0<<5)
+#define DF1704_CKO_HALF (1<<5)
+/* Sampling freq selection for the De-Emphasis */
+#define DF1704_SF_44 (0<<6)
+#define DF1704_SF_32 (3<<6)
+#define DF1704_SF_48 (2<<6)
+
+void df1704_init(void);
+void df1704_mute(void);
+void df1704_set_ml(const int);
+void df1704_set_mc(const int);
+void df1704_set_md(const int);
+void df1704_set_ml_dir(const int);
+#endif
diff --git a/firmware/export/pca9555.h b/firmware/export/pca9555.h
new file mode 100644
index 0000000..3180114
--- /dev/null
+++ b/firmware/export/pca9555.h
@@ -0,0 +1,49 @@
+/***************************************************************************
+ * __________ __ ___.
+ * Open \______ \ ____ ____ | | _\_ |__ _______ ___
+ * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
+ * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
+ * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
+ * \/ \/ \/ \/ \/
+ * $Id$
+ *
+ * Copyright (C) 2013 Andrew Ryabinin
+ *
+ * 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 _PCA9555_H
+#define _PCA9555_H
+
+#include "pca9555-target.h"
+
+#define PCA9555_IN0_CMD 0
+#define PCA9555_IN1_CMD 1
+#define PCA9555_OUT0_CMD 2
+#define PCA9555_OUT1_CMD 3
+#define PCA9555_POL0_INV_CMD 4
+#define PCA9555_POL1_INV_CMD 5
+#define PCA9555_CFG0_CMD 6
+#define PCA9555_CFG1_CMD 7
+
+#define PCA9555_IN_CMD PCA9555_IN0_CMD
+#define PCA9555_OUT_CMD PCA9555_OUT0_CMD
+#define PCA9555_POL_INV_CMD PCA9555_POL0_INV_CMD
+#define PCA9555_CFG_CMD PCA9555_CFG0_CMD
+
+void pca9555_target_init(void);
+void pca9555_init(void);
+unsigned short pca9555_read_input(void);
+unsigned short pca9555_read_output(void);
+unsigned short pca9555_read_config(void);
+void pca9555_write_output(const unsigned short data, const unsigned short mask);
+void pca9555_write_config(const unsigned short data, const unsigned short mask);
+
+#endif