From 41c497025f40615373817498606fabd0fcd41dd6 Mon Sep 17 00:00:00 2001 From: Dominik Wenger Date: Mon, 19 Oct 2009 18:14:27 +0000 Subject: Initial mini2440 port. Flyspray: FS#10627 Author: Bob Cousins git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23265 a1c6a512-1295-4272-9138-f99709370657 --- firmware/export/config-mini2440.h | 150 ++++++++++++++++++++++++++++++++++++++ firmware/export/config.h | 10 ++- firmware/export/s3c2440.h | 57 ++++++++++++++- 3 files changed, 213 insertions(+), 4 deletions(-) create mode 100644 firmware/export/config-mini2440.h (limited to 'firmware/export') diff --git a/firmware/export/config-mini2440.h b/firmware/export/config-mini2440.h new file mode 100644 index 0000000000..0db027c7a0 --- /dev/null +++ b/firmware/export/config-mini2440.h @@ -0,0 +1,150 @@ +/*************************************************************************** + * __________ __ ___. + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ + * \/ \/ \/ \/ \/ + * + * Copyright (C) 2009 by Bob Cousins, Lyre Project + * Copyright (C) 2009 by Jorge Pinto, Lyre Project + * + * 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 Mini2440 + */ +#define TARGET_TREE /* this target is using the target tree system */ + +/* For Rolo and boot loader */ +#define MODEL_NUMBER 131 +#define MODEL_NAME "Mini2440" + +/***************************************************************************/ +/* Hardware Config */ + +/* TODO: ??? */ +#define CONFIG_SDRAM_START 0x30000000 + +/* Flash storage */ +#define HAVE_FLASH_STORAGE +/* define the storage type */ +#define CONFIG_STORAGE STORAGE_SD + +#define HAVE_MULTIDRIVE +#define NUM_DRIVES 2 +#define HAVE_HOTSWAP + +/* Disk storage */ +/* define this if you have a disk storage, i.e. something + that needs spinups and can cause skips when shaked */ +/* #define HAVE_DISK_STORAGE */ + +/* Display */ +/* 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 +/* The LCD is assumed to be 3.5" TFT touch screen, others are possible */ +#define CONFIG_LCD LCD_MINI2440 +/* LCD dimensions */ +#define LCD_WIDTH 240 +#define LCD_HEIGHT 320 +/* The LCD is configured for RGB565 */ +#define LCD_DEPTH 16 /* 65536 colours */ +#define LCD_PIXELFORMAT RGB565 /* rgb565 */ +/* Define this for LCD backlight available */ +/* The Mini2440 supports backight brightness depending on LCD type */ +/* But the 3.5" LCD touch screen does not support brightness*/ +#define HAVE_BACKLIGHT +#define HAVE_BACKLIGHT_BRIGHTNESS + +/* Keypad */ +#define CONFIG_KEYPAD MINI2440_PAD + +/* I2C */ +/* Do not use I2C */ +#define CONFIG_I2C I2C_NONE + +/* Define DAC/Codec */ +/*#define HAVE_UDA1341*/ +#define HAVE_TLV320 +/* ... tone controls, use the software ones */ +#define HAVE_SW_TONE_CONTROLS + +/* Battery */ +#define BATTERY_CAPACITY_DEFAULT 1100 /* default battery capacity */ +#define BATTERY_CAPACITY_MIN 500 /* min. capacity selectable */ +#define BATTERY_CAPACITY_MAX 2500 /* max. capacity selectable */ +#define BATTERY_CAPACITY_INC 100 /* capacity increment */ +#define BATTERY_TYPES_COUNT 1 /* only one type */ + +/* USB */ +/* TODO:#define HAVE_USBSTACK */ + +/***************************************************************************/ +/* Application Config */ + +#define HAVE_ALBUMART +/* define this to enable bitmap scaling */ +#define HAVE_BMP_SCALING +/* define this to enable JPEG decoding */ +#define HAVE_JPEG +/* RMC TODO: what is this for?? */ +/* define this if you have access to the pitchscreen */ +#define HAVE_PITCHSCREEN + +/* Define this if you do software codec */ +#define CONFIG_CODEC SWCODEC + +/* The number of bytes reserved for loadable codecs */ +#define CODEC_SIZE 0x100000 + +/* The number of bytes reserved for loadable plugins */ +#define PLUGIN_BUFFER_SIZE 0x100000 + + +/***************************************************************************/ +#ifndef SIMULATOR + +#define CONFIG_CPU S3C2440 + +/* Define this to the CPU frequency */ +#define CPU_FREQ 405000000 +#define MCK_FREQ (CPU_FREQ/4) +#define SLOW_CLOCK 32768 + +/* Main LCD backlight brightness range and defaults */ +#define MIN_BRIGHTNESS_SETTING 1 /* 0.5 mA */ +#define MAX_BRIGHTNESS_SETTING 12 /* 32 mA */ +#define DEFAULT_BRIGHTNESS_SETTING 10 /* 16 mA */ +/* Define this if your LCD can set contrast */ +#define HAVE_LCD_CONTRAST +#define MIN_CONTRAST_SETTING 0 +#define MAX_CONTRAST_SETTING 63 +#define DEFAULT_CONTRAST_SETTING 47 /* Match boot contrast */ + +/* Hardware controlled charging with monitoring */ +#define CONFIG_CHARGING CHARGING_MONITOR +/*#define POWER_INPUT_BATTERY 0*/ + +/* 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 BOOTFILE_EXT "mini2440" +#define BOOTFILE "rockbox." BOOTFILE_EXT +#define BOOTDIR "/.rockbox" + +#endif +/***************************************************************************/ diff --git a/firmware/export/config.h b/firmware/export/config.h index 70e2c792d0..8a1adeaac8 100644 --- a/firmware/export/config.h +++ b/firmware/export/config.h @@ -112,6 +112,7 @@ #define SAMSUNG_YH_PAD 38 #define ONDAVX777_PAD 39 #define SAMSUNG_YPS3_PAD 40 +#define MINI2440_PAD 41 /* CONFIG_REMOTE_KEYPAD */ #define H100_REMOTE 1 @@ -192,10 +193,11 @@ #define LCD_ONDAVX767 30 /* as used by the Onda VX767 */ #define LCD_SSD1303 31 /* as used by the Sansa Clip */ #define LCD_FUZE 32 /* as used by the Sansa Fuze */ -#define LCD_LYRE_PROTO1 33 /* as used by the Lyre */ +#define LCD_LYRE_PROTO1 33 /* as used by the Lyre prototype 1 */ #define LCD_YH925 34 /* as used by Samsung YH-925 (similar to the H10 20GB) */ -#define LCD_VIEW 35 /* as used by the Sansa View */ +#define LCD_VIEW 35 /* as used by the Sansa View */ #define LCD_NANO2G 36 /* as used by the iPod Nano 2nd Generation */ +#define LCD_MINI2440 37 /* as used by the Mini2440 */ /* LCD_PIXELFORMAT */ #define HORIZONTAL_PACKING 1 @@ -216,7 +218,7 @@ /* CONFIG_I2C */ #define I2C_NONE 0 /* For targets that do not use I2C - as the -Lyre prototype 1*/ +Lyre prototype 1 */ #define I2C_PLAYREC 1 /* Archos Player/Recorder style */ #define I2C_ONDIO 2 /* Ondio style */ #define I2C_COLDFIRE 3 /* Coldfire style */ @@ -386,6 +388,8 @@ Lyre prototype 1*/ #include "config-view.h" #elif defined(LYRE_PROTO1) #include "config-lyre_proto1.h" +#elif defined(MINI2440) +#include "config-mini2440.h" #elif defined(SAMSUNG_YH820) #include "config-yh820.h" #elif defined(SAMSUNG_YH920) diff --git a/firmware/export/s3c2440.h b/firmware/export/s3c2440.h index 0589f3b6b0..5f595214a1 100644 --- a/firmware/export/s3c2440.h +++ b/firmware/export/s3c2440.h @@ -178,6 +178,41 @@ #define DCDST3 (*(volatile unsigned long *)0x4B0000DC) /* DMA 3 current destination */ #define DMASKTRIG3 (*(volatile unsigned long *)0x4B0000E0) /* DMA 3 mask trigger */ +#define DISRCC_LOC_AHB (0 << 1) +#define DISRCC_LOC_APB (1 << 1) +#define DISRCC_INC_AUTO (0 << 0) +#define DISRCC_INC_FIXED (1 << 0) + +#define DIDSTC_CHK_INT_TC_ZERO (0 << 2) +#define DIDSTC_CHK_INT_AFTER_RELOAD (1 << 2) +#define DIDSTC_LOC_AHB (0 << 1) +#define DIDSTC_LOC_APB (1 << 1) +#define DIDSTC_INC_AUTO (0 << 0) +#define DIDSTC_INC_FIXED (1 << 0) + +#define DCON_DMD_HS (1 << 31) +#define DCON_SYNC_APB (0 << 30) +#define DCON_SYNC_AHB (1 << 30) +#define DCON_INT (1 << 29) +#define DCON_TSZ (1 << 28) +#define DCON_SERVMODE_WHOLE (1 << 27) +#define DCON_HWSRCSEL (1 << 24) +#define DCON_HW_SEL (1 << 23) +#define DCON_NO_RELOAD (1 << 22) +#define DCON_DSZ_MASK (3 << 20) +#define DCON_DSZ_BYTE (0 << 20) +#define DCON_DSZ_HALF_WORD (1 << 20) +#define DCON_DSZ_WORD (2 << 20) +#define DCON_TC (1 << 0) + +#define DSTAT_STAT_BUSY (1 << 20) +#define DSTAT_CURR_TC (1 << 0) + +#define DMASKTRIG_STOP (1 << 2) +#define DMASKTRIG_ON (1 << 1) +#define DMASKTRIG_SW_TRIG (1 << 0) + + /* Clock & Power Management */ #define LOCKTIME (*(volatile unsigned long *)0x4C000000) /* PLL lock time counter */ @@ -499,7 +534,14 @@ #define SDIDSTA (*(volatile unsigned long *)0x5A000034) /* SDI data status */ #define SDIFSTA (*(volatile unsigned long *)0x5A000038) /* SDI FIFO status */ #define SDIIMSK (*(volatile unsigned long *)0x5A00003C) /* SDI interrupt mask */ -#define SDIDAT (*(volatile unsigned char *)0x5A000040) /* SDI data */ + +/* SDI data - LE = Little Endian, BE = Big Endian */ +#define SDIDAT_LLE (*(volatile unsigned long *)0x5A000040) /* 32 bit */ +#define SDIDAT_HLE (*(volatile unsigned short *)0x5A000044) /* 16 */ +#define SDIDAT_BLE (*(volatile unsigned char *)0x5A000048) /* 8 */ +#define SDIDAT_LBE (*(volatile unsigned long *)0x5A00004C) /* 32 */ +#define SDIDAT_HBE (*(volatile unsigned short *)0x5A000041) /* 16 */ +#define SDIDAT_BBE (*(volatile unsigned char *)0x5A000043) /* 8 */ /* AC97 Audio-CODEC Interface */ @@ -530,5 +572,18 @@ #define TIMER_FREQ (49156800/2) #define TIMER234_PRESCALE 21 +/* I/O Port macros */ + +#define GPIO_INPUT 0 +#define GPIO_OUTPUT 1 +#define GPIO_FUNCTION 2 +#define GPIO_ALT_FUNCTION 3 + +#define GPIO_PULLUP_DISABLE 1 +#define GPIO_PULLUP_ENABLE 0 + +#define S3C2440_GPIO_CONFIG(port,pin,function) port = ( (port & ~(3<<(pin*2)) ) | (function<<(pin*2)) ) +#define S3C2440_GPIO_PULLUP(port,pin,state) port = ( (port & ~(1<