From e8a8a1be43afe63079ae48ce1a9eb3052df3b1a4 Mon Sep 17 00:00:00 2001 From: Tomasz Moń Date: Wed, 16 Nov 2011 14:08:01 +0000 Subject: Sandisk Sansa Connect port (FS #12363) Included are drivers for buttons, backlight, lcd, audio and storage. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31000 a1c6a512-1295-4272-9138-f99709370657 --- firmware/export/aic3x.h | 77 +++++++++++++ firmware/export/audiohw.h | 2 + firmware/export/config.h | 6 + firmware/export/config/sansaconnect.h | 201 ++++++++++++++++++++++++++++++++++ firmware/export/dm320.h | 51 +++++++++ 5 files changed, 337 insertions(+) create mode 100644 firmware/export/aic3x.h create mode 100644 firmware/export/config/sansaconnect.h (limited to 'firmware/export') diff --git a/firmware/export/aic3x.h b/firmware/export/aic3x.h new file mode 100644 index 0000000000..17e5ea019a --- /dev/null +++ b/firmware/export/aic3x.h @@ -0,0 +1,77 @@ +/*************************************************************************** + * __________ __ ___. + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ + * \/ \/ \/ \/ \/ + * $Id: $ + * + * Copyright (C) 2011 by Tomasz Moń + * + * 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 _AIC3X_H_ +#define _AIC3X_H_ + +#define VOLUME_MIN -630 +#define VOLUME_MAX 0 + +extern int tenthdb2master(int db); + +/*** definitions ***/ +extern void audiohw_set_headphone_vol(int vol_l, int vol_r); + +/* Page 0 registers */ +#define AIC3X_PAGE_SELECT 0 +#define AIC3X_SOFT_RESET 1 +#define AIC3X_SMPL_RATE 2 +#define AIC3X_PLL_REG_A 3 +#define AIC3X_PLL_REG_B 4 +#define AIC3X_PLL_REG_C 5 +#define AIC3X_PLL_REG_D 6 +#define AIC3X_DATAPATH 7 +#define AIC3X_DATA_REG_A 8 +#define AIC3X_DATA_REG_B 9 +#define AIC3X_DATA_REG_C 10 + +#define AIC3X_DAC_POWER 37 +#define AIC3X_HIGH_POWER 38 + +#define AIC3X_POP_REDUCT 42 +#define AIC3X_LEFT_VOL 43 +#define AIC3X_RIGHT_VOL 44 + +#define AIC3X_DAC_L1_VOL 47 +#define AIC3X_HPLOUT_LVL 51 + +#define AIC3X_HPLCOM_LVL 58 + +#define AIC3X_DAC_R1_VOL 64 +#define AIC3X_HPROUT_LVL 65 + +#define AIC3X_DAC_L1_MONO_LOP_M_VOL 75 + +#define AIC3X_DAC_R1_MONO_LOP_M_VOL 76 + +#define AIC3X_MONO_LOP_M_LVL 79 + +#define AIC3X_DAC_L1_LEFT_LOP_M_VOL 82 + +#define AIC3X_LEFT_LOP_M_LVL 86 + +#define AIC3X_DAC_R1_RIGHT_LOP_M_VOL 92 +#define AIC3X_RIGHT_LOP_M_LVL 93 +#define AIC3X_MOD_POWER 94 + +#define AIC3X_GPIO1_CTRL 98 + +#endif /*_AIC3X_H_*/ diff --git a/firmware/export/audiohw.h b/firmware/export/audiohw.h index 6bf4d71810..102d107d8a 100644 --- a/firmware/export/audiohw.h +++ b/firmware/export/audiohw.h @@ -70,6 +70,8 @@ #include "ak4537.h" #elif defined(HAVE_RK27XX_CODEC) #include "rk27xx_codec.h" +#elif defined(HAVE_AIC3X) +#include "aic3x.h" #elif defined(HAVE_CS42L55) #include "cs42l55.h" #elif defined(HAVE_IMX233_CODEC) diff --git a/firmware/export/config.h b/firmware/export/config.h index 55a194817d..2e7b4dc4d6 100644 --- a/firmware/export/config.h +++ b/firmware/export/config.h @@ -142,6 +142,7 @@ #define RK27XX_GENERIC_PAD 49 #define HM60X_PAD 50 #define HM801_PAD 51 +#define SANSA_CONNECT_PAD 52 /* CONFIG_REMOTE_KEYPAD */ #define H100_REMOTE 1 @@ -229,6 +230,7 @@ #define LCD_SPFD5420A 42 /* rk27xx */ #define LCD_CLIPZIP 43 /* as used by the Sandisk Sansa Clip Zip */ #define LCD_HX8340B 44 /* as used by the HiFiMAN HM-601/HM-602/HM-801 */ +#define LCD_CONNECT 45 /* as used by the Sandisk Sansa Connect */ /* LCD_PIXELFORMAT */ #define HORIZONTAL_PACKING 1 @@ -302,6 +304,7 @@ Lyre prototype 1 */ #define RTC_D2 18 /* Either PCF50606 or PCF50635 */ #define RTC_S35380A 19 #define RTC_IMX233 20 +#define RTC_STM41T62 21 /* ST M41T62 */ /* USB On-the-go */ #define USBOTG_M66591 6591 /* M:Robe 500 */ @@ -314,6 +317,7 @@ Lyre prototype 1 */ #define USBOTG_AS3525v2 3535 /* AMS AS3525v2 FIXME : same as S3C6400X */ #define USBOTG_S3C6400X 6400 /* Samsung S3C6400X, also used in the S5L8701/S5L8702/S5L8720 */ #define USBOTG_RK27XX 2700 /* Rockchip rk27xx */ +#define USBOTG_TNETV105 105 /* TI TNETV105 */ /* Multiple cores */ #define CPU 0 @@ -466,6 +470,8 @@ Lyre prototype 1 */ #include "config/hifimanhm60x.h" #elif defined(HM801) #include "config/hifimanhm801.h" +#elif defined(SANSA_CONNECT) +#include "config/sansaconnect.h" #elif defined(SDLAPP) #include "config/sdlapp.h" #elif defined(ANDROID) diff --git a/firmware/export/config/sansaconnect.h b/firmware/export/config/sansaconnect.h new file mode 100644 index 0000000000..714534d6ad --- /dev/null +++ b/firmware/export/config/sansaconnect.h @@ -0,0 +1,201 @@ +/*************************************************************************** + * __________ __ ___. + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ + * \/ \/ \/ \/ \/ + * + * Copyright (C) 2011 by Tomasz Moń + * + * 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. + * + ****************************************************************************/ + +/* + * This config file is for the Sansa Connect + */ +#define TARGET_TREE /* this target is using the target tree system */ + +/* This is the absolute address on the bus set by OF bootloader */ +#define CONFIG_SDRAM_START 0x01000000 + +#define SANSA_CONNECT 1 +#define MODEL_NAME "Sandisk Sansa Connect" + +/* For Rolo and boot loader */ +#define MODEL_NUMBER 81 + +/* define this if you have a flash memory storage */ +#define HAVE_FLASH_STORAGE + +/* define this if you use an SD controller */ +#define CONFIG_STORAGE STORAGE_SD + +#define HAVE_MULTIDRIVE +#define NUM_DRIVES 2 +#define HAVE_HOTSWAP +#define HAVE_HOTSWAP_STORAGE_AS_MAIN + +/* define this if you have a bitmap LCD display */ +#define HAVE_LCD_BITMAP + +/* 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 have access to the quickscreen */ +#define HAVE_QUICKSCREEN + +/* define this if you have access to the pitchscreen */ +#define HAVE_PITCHSCREEN + +/* define this if you would like tagcache to build on this target */ +#define HAVE_TAGCACHE + +/* define this if the target has volume keys which can be used in the lists */ +#define HAVE_VOLUME_IN_LIST + +/* define this if you want viewport clipping enabled for safe LCD functions */ +#define HAVE_VIEWPORT_CLIP + +/* LCD dimensions */ +#define CONFIG_LCD LCD_CONNECT + +#define LCD_WIDTH 240 +#define LCD_HEIGHT 320 + +#define LCD_DEPTH 16 /* 65k colours */ +#define LCD_PIXELFORMAT RGB565 /* rgb565 */ + +#define HAVE_LCD_ENABLE +#ifndef BOOTLOADER +#define HAVE_LCD_SLEEP +#endif + +#define LCD_SLEEP_TIMEOUT (2*HZ) + +#define MAX_ICON_HEIGHT 35 +#define MAX_ICON_WIDTH 35 + + +#define CONFIG_KEYPAD SANSA_CONNECT_PAD + +/* Define this to have CPU bootsted while scrolling in the UI */ +#define HAVE_GUI_BOOST + +/* define this if the target has volume keys which can be used in the lists */ +#define HAVE_VOLUME_IN_LIST + +#define HAVE_MORSE_INPUT + +/* Define this if you do software codec */ +#define CONFIG_CODEC SWCODEC + +//#define HAVE_HARDWARE_BEEP + +/* There is no hardware tone control */ +#define HAVE_SW_TONE_CONTROLS + +#define HAVE_AIC3X + +//#define HW_SAMPR_CAPS SAMPR_CAP_44 | SAMPR_CAP_22 | SAMPR_CAP_11 | SAMPR_CAP_8 + +/* define this if you have a real-time clock */ +//#define CONFIG_RTC RTC_STM41T62 + +/* define this if the unit uses a scrollwheel for navigation */ +#define HAVE_SCROLLWHEEL + +/* Define this for LCD backlight available */ +#define HAVE_BACKLIGHT + +#define HAVE_BACKLIGHT_BRIGHTNESS + +#define CONFIG_BACKLIGHT_FADING BACKLIGHT_FADING_SW_SETTING + +/* Main LCD backlight brightness range and defaults */ +#define MIN_BRIGHTNESS_SETTING 1 +#define MAX_BRIGHTNESS_SETTING 20 +#define DEFAULT_BRIGHTNESS_SETTING 16 /* OF default brightness (80%) */ +#define DEFAULT_DIMNESS_SETTING 6 /* OF default inactive (30%) */ + +/* 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 0x200000 + +#define BATTERY_CAPACITY_DEFAULT 800 /* default battery capacity */ +#define BATTERY_CAPACITY_MIN 700 /* min. capacity selectable */ +#define BATTERY_CAPACITY_MAX 1000 /* max. capacity selectable */ +#define BATTERY_CAPACITY_INC 100 /* capacity increment */ +#define BATTERY_TYPES_COUNT 1 /* only one type */ + +/* define current usage levels */ +#if 0 +/* TODO */ +#define CURRENT_NORMAL 85 +#define CURRENT_BACKLIGHT 200 +#endif + +/* Hardware controlled charging with monitoring */ +//#define CONFIG_CHARGING CHARGING_MONITOR + +#define CONFIG_CPU DM320 + +#define CONFIG_I2C I2C_DM320 +#define HAVE_SOFTWARE_I2C + +/* define this if the hardware can be powered off while charging */ +#define HAVE_POWEROFF_WHILE_CHARGING + +/* The size of the flash ROM */ +#define FLASH_SIZE 0x400000 + +/* Define this to the CPU frequency */ +#define CPU_FREQ 150000000 + +/* Define this if you have ATA power-off control */ +#define HAVE_ATA_POWER_OFF + +/* 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 + +#if 0 +#define HAVE_USBSTACK +#define USB_VENDOR_ID 0x0781 +#define USB_PRODUCT_ID 0x7480 +#endif + +#define INCLUDE_TIMEOUT_API + +/* Define this if you have adjustable CPU frequency */ +#define HAVE_ADJUSTABLE_CPU_FREQ + +#define BOOTFILE_EXT "sansa" +#define BOOTFILE "rockbox." BOOTFILE_EXT +#define BOOTDIR "/.rockbox" + +/* Define this if a programmable hotkey is mapped */ +#define HAVE_HOTKEY diff --git a/firmware/export/dm320.h b/firmware/export/dm320.h index a629586be8..def8508b0b 100644 --- a/firmware/export/dm320.h +++ b/firmware/export/dm320.h @@ -870,6 +870,8 @@ extern unsigned long _ttbstart; #define CLK_MOD2_TMR0 (1 << 1) #define CLK_MOD2_WDT (1 << 0) +#define CLK_SEL0_UART0 (1 << 5) + #define CLK_SEL1_OSD (1 << 12) #define CLK_SEL1_CCD (1 << 8) #define CLK_SEL1_VENCPLL (1 << 4) @@ -884,6 +886,55 @@ extern unsigned long _ttbstart; #define CLK_BYP_DSP (1 << 4) #define CLK_BYP_ARM (1 << 0) +#define CLK_INV_MMC (1 << 0) +#define CLK_INV_VENC (1 << 4) +#define CLK_INV_CCD (1 << 8) +#define CLK_INV_SIF0 (1 << 12) +#define CLK_INV_SIF1 (1 << 13) + +#define MMC_CTRL_DATRST (1 << 0) +#define MMC_CTRL_CMDRST (1 << 1) +#define MMC_CTRL_WIDTH (1 << 2) +#define MMC_CTRL_DMASZEN (1 << 4) +#define MMC_CTRL_TEST2 (1 << 8) +#define MMC_CTRL_PERMDR (1 << 9) +#define MMC_CTRL_PERMDX (1 << 10) + +#define MMC_CMD_CMD_MASK (0x3F) +#define MMC_CMD_PPLEN (1 << 7) +#define MMC_CMD_BSYEXP (1 << 8) +#define MMC_CMD_RSPFMT_SHIFT 9 +#define MMC_CMD_RSPFMT_MASK (3 << MMC_CMD_RSPFMT_SHIFT) +#define MMC_CMD_WRITE (1 << 11) +#define MMC_CMD_STREAM (1 << 12) +#define MMC_CMD_DATA (1 << 13) +#define MMC_CMD_INITCLK (1 << 14) +#define MMC_CMD_DCLR (1 << 15) + +#define MMC_ST0_DATDNE (1 << 0) +#define MMC_ST0_BSYDNE (1 << 1) +#define MMC_ST0_RSPDNE (1 << 2) +#define MMC_ST0_DATA_TIMEOUT (1 << 3) +#define MMC_ST0_CMD_TIMEOUT (1 << 4) +#define MMC_ST0_WR_CRCERR (1 << 5) +#define MMC_ST0_RD_CRCERR (1 << 6) +#define MMC_ST0_RESP_CRCERR (1 << 7) +#define MMC_ST0_DMADNE (1 << 8) +#define MMC_ST0_DXRDY (1 << 9) +#define MMC_ST0_DRRDY (1 << 10) +#define MMC_ST0_DAT3_EDGE (1 << 11) + +#define MMC_ST1_BUSY (1 << 0) +#define MMC_ST1_CLKSTP (1 << 1) +#define MMC_ST1_DXEMPTY (1 << 2) +#define MMC_ST1_DXFULL (1 << 3) +#define MMC_ST1_DAT3ST (1 << 4) + +#define MMC_DMAMODE_RD_WORDSWAP (1 << 10) +#define MMC_DMAMODE_WR_WORDSWAP (1 << 11) +#define MMC_DMAMODE_WRITE (1 << 12) +#define MMC_DMAMODE_ENABLE (1 << 13) +#define MMC_DMAMODE_TIMEOUTIRQ_EN (1 << 14) /* * IO_EINTx bits */ -- cgit v1.2.3