New Port: Eros Q Native

What works:
- LCD: 16-bit RGB565
- all buttons, including scrollwheel
- SD Card
- Battery level and charging/not charging status
- USB
- audio
- sample rate switching
- HP / LO detect, with "safe" fixed LO volume -
   LO volume will only be put to user-defined max volume
   if headphones are not present.
- rtc
- Plugins build, tried a couple and they seem OK
- Bootloader, installable to nand via usbboot

What doesn't work:
- Dual Boot
- power on/off has intermittent, low volume audio click
   (sometimes it's completely silent, sometimes there's
    a click)
- Audio uses 16-bit volume scaling, so clicking/popping
   is pretty bad at lower volumes - need 32 bit volume
   scaling, 24 bit I2S data
- USB HID keys not yet defined
- no jztool support

Unknowns:
- Stereo Switch pins: Direction select, AC_DC
   (probably not even hooked up)
- What is the actual purpose of the Stereo Swtich?
- How does the bluetooth module connect?

"Someday" stuff:
- get LCD working at higher bit depth
- Bluetooth

Change-Id: I70dda8fc092c6e3f4352f2245e4164193f803c33
This commit is contained in:
Dana Conrad 2021-06-26 12:07:11 -05:00 committed by Aidan MacDonald
parent 64a24591ae
commit 3e7a09cb0d
28 changed files with 1283 additions and 5 deletions

View file

@ -210,6 +210,8 @@ struct sound_settings_info
#include "df1704.h"
#elif defined(HAVE_PCM1792_CODEC)
#include "pcm1792.h"
#elif defined(HAVE_EROS_QN_CODEC)
#include "eros_qn_codec.h"
#elif defined(HAVE_NWZ_LINUX_CODEC)
#include "nwzlinux_codec.h"
#elif defined(HAVE_CS4398)

View file

@ -276,6 +276,7 @@
#define LCD_IHIFI800 68 /* as used by IHIFI 800 */
#define LCD_FIIOM3K 69 /* as used by the FiiO M3K */
#define LCD_SHANLING_Q1 70 /* as used by the Shanling Q1 */
#define LCD_EROSQ 71 /* as used by the ErosQ (native) */
/* LCD_PIXELFORMAT */
#define HORIZONTAL_PACKING 1
@ -596,6 +597,8 @@ Lyre prototype 1 */
#include "config/aigoerosq.h"
#elif defined(SHANLING_Q1)
#include "config/shanlingq1.h"
#elif defined(EROS_QN)
#include "config/erosqnative.h"
#else
//#error "unknown hwardware platform!"
#endif

View file

@ -0,0 +1,125 @@
/*
* This config file is for the AIGO EROS Q / EROS K (and its clones)
*/
/* For Rolo and boot loader */
#define MODEL_NAME "AIGO Eros Q Native"
#define MODEL_NUMBER 116
#define BOOTFILE_EXT "erosq"
#define BOOTFILE "rockbox." BOOTFILE_EXT
#define BOOTDIR "/.rockbox"
#define FIRMWARE_OFFSET_FILE_CRC 0
#define FIRMWARE_OFFSET_FILE_DATA 8
/* CPU defines */
#define CONFIG_CPU X1000
#define X1000_EXCLK_FREQ 24000000
#define CPU_FREQ 1008000000
#define HAVE_FPU
#ifndef SIMULATOR
#define TIMER_FREQ X1000_EXCLK_FREQ
#endif
/* kernel defines */
#define INCLUDE_TIMEOUT_API
#define HAVE_SEMAPHORE_OBJECTS
/* drivers */
#define HAVE_I2C_ASYNC
/* Buffers for plugsins and codecs */
#define PLUGIN_BUFFER_SIZE 0x200000 /* 2 MiB */
#define CODEC_SIZE 0x100000 /* 1 MiB */
/* LCD defines */
#define CONFIG_LCD LCD_EROSQ
#define LCD_WIDTH 320
#define LCD_HEIGHT 240
#define LCD_DEPTH 16 /* Future Improvement: 18 or 24 bpp if display supports it */
#define LCD_PIXELFORMAT RGB565
/* sqrt(240^2 + 320^2) / 2.0 = 200 */
#define LCD_DPI 200
#define HAVE_LCD_COLOR
#define HAVE_LCD_BITMAP
#define HAVE_LCD_ENABLE
#define HAVE_LCD_SHUTDOWN
#define LCD_X1000_FASTSLEEP
//#define LCD_X1000_DMA_WAITFORFRAME
#define HAVE_BACKLIGHT
#define HAVE_BACKLIGHT_BRIGHTNESS
#define MIN_BRIGHTNESS_SETTING 1
#define MAX_BRIGHTNESS_SETTING 255
#define BRIGHTNESS_STEP 5
#define DEFAULT_BRIGHTNESS_SETTING 70
#define CONFIG_BACKLIGHT_FADING BACKLIGHT_FADING_SW_SETTING
/* RTC settings */
#define CONFIG_RTC RTC_X1000
/* Codec / audio hardware defines */
#define HW_SAMPR_CAPS SAMPR_CAP_ALL_192
#define HAVE_EROS_QN_CODEC
#define HAVE_SW_TONE_CONTROLS
#define HAVE_SW_VOLUME_CONTROL
/* Button defines */
#define CONFIG_KEYPAD EROSQ_PAD
#define HAVE_SCROLLWHEEL
#define HAVE_HEADPHONE_DETECTION
#define HAVE_LINEOUT_DETECTION
/* Storage defines */
#define CONFIG_STORAGE STORAGE_SD
#define HAVE_HOTSWAP
#define HAVE_HOTSWAP_STORAGE_AS_MAIN
#define HAVE_MULTIDRIVE
#define NUM_DRIVES 1
#define STORAGE_WANTS_ALIGN
#define STORAGE_NEEDS_BOUNCE_BUFFER
/* Power management */
#define CONFIG_BATTERY_MEASURE VOLTAGE_MEASURE
#define CONFIG_CHARGING CHARGING_MONITOR
#define HAVE_SW_POWEROFF
#ifndef SIMULATOR
#define HAVE_AXP_PMU 192
#define HAVE_POWEROFF_WHILE_CHARGING
#endif
/* Battery */
#define BATTERY_TYPES_COUNT 1
#define BATTERY_CAPACITY_DEFAULT 1300 /* default battery capacity */
#define BATTERY_CAPACITY_MIN 1300 /* min. capacity selectable */
#define BATTERY_CAPACITY_MAX 1300 /* max. capacity selectable */
#define BATTERY_CAPACITY_INC 0 /* capacity increment */
#define CURRENT_NORMAL 100 // 1.7mA * 60s
#define CURRENT_BACKLIGHT 180
#define CURRENT_MAX_CHG 500 // bursts higher if needed
/* USB support */
#ifndef SIMULATOR
#define CONFIG_USBOTG USBOTG_DESIGNWARE
#define USB_DW_ARCH_SLAVE
#define USB_DW_TURNAROUND 5
#define HAVE_USBSTACK
#define USB_VENDOR_ID 0xc502
#define USB_PRODUCT_ID 0x0023
#define USB_DEVBSS_ATTR __attribute__((aligned(32)))
#define HAVE_USB_POWER
#define HAVE_USB_CHARGING_ENABLE
#define HAVE_BOOTLOADER_USB_MODE
#endif
/* Rockbox capabilities */
#define HAVE_VOLUME_IN_LIST
#define HAVE_FAT16SUPPORT
#define HAVE_ALBUMART
#define HAVE_BMP_SCALING
#define HAVE_JPEG
#define HAVE_TAGCACHE
#define HAVE_QUICKSCREEN
#define HAVE_HOTKEY

View file

@ -0,0 +1,35 @@
/***************************************************************************
* __________ __ ___.
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
* \/ \/ \/ \/ \/
* $Id$
*
*
* Copyright (c) 2021 Andrew Ryabinin, Dana Conrad
*
* 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 _EROS_QN_CODEC_H
#define _EROS_QN_CODEC_H
#define PCM5102A_VOLUME_MIN -740
#define PCM5102A_VOLUME_MAX 0
AUDIOHW_SETTING(VOLUME, "dB", 0, 1, PCM5102A_VOLUME_MIN/10, PCM5102A_VOLUME_MAX/10, 0)
/* this just calls audiohw_set_volume() with the last (locally) known volume,
* used for switching to/from fixed line out volume. */
void pcm5102_set_outputs(void);
#endif