1
0
mirror of git://projects.qi-hardware.com/xburst-tools.git synced 2025-04-21 12:27:27 +03:00

qi-add-sc36410-mci.patch

This heavily adapts the Samsung U-Boot hs_mmc code and combines it with the
SD / SDHC startup code written for glamo-mci stuff that is known to work OK
with common SD and SDHC.

tla01 is changed to use the implementation.

Signed-off-by: Andy Green <andy@openmoko.com>
This commit is contained in:
Andy Green
2008-11-28 10:16:40 +00:00
committed by Andy Green
parent 4e326e29fa
commit 82d2e255c3
11 changed files with 1416 additions and 79 deletions

View File

@@ -36,9 +36,71 @@
#define S3C64XX_UART_CHANNELS 3
#define S3C64XX_SPI_CHANNELS 2
#define HSMMC_CHANNEL 0
#define MOVI_INIT_REQUIRED 0
#define TCM_BASE 0x0C004000
#define BL2_BASE 0x57E00000
#define CopyMovitoMem(a,b,c,d,e) (((int(*)(int, uint, ushort, uint *, int))(*((uint *)(TCM_BASE + 0x8))))(a,b,c,d,e))
#define SS_SIZE (8 * 1024)
#define eFUSE_SIZE (1 * 1024) // 0.5k eFuse, 0.5k reserved`
#define PART_UBOOT_OFFSET 0x0
#define PART_ZIMAGE_OFFSET 0x40000
#define PART_ROOTFS_OFFSET 0x200000
#define PART_EXTRA_OFFSET 0x3200000
/* movinand definitions */
#define MOVI_BLKSIZE 512
#define MOVI_TOTAL_BLKCNT 7864320 // 7864320 // 3995648 // 1003520 /* static movinand total block count: for writing to movinand when nand boot */
#define MOVI_HIGH_CAPACITY 0
#define MOVI_LAST_BLKPOS (MOVI_TOTAL_BLKCNT - (eFUSE_SIZE / MOVI_BLKSIZE))
#define MOVI_BL1_BLKCNT (SS_SIZE / MOVI_BLKSIZE)
#define MOVI_ENV_BLKCNT (CFG_ENV_SIZE / MOVI_BLKSIZE)
#define MOVI_BL2_BLKCNT (((PART_ZIMAGE_OFFSET - PART_UBOOT_OFFSET) / MOVI_BLKSIZE) - MOVI_ENV_BLKCNT)
#define MOVI_ZIMAGE_BLKCNT ((PART_ROOTFS_OFFSET - PART_ZIMAGE_OFFSET) / MOVI_BLKSIZE)
#define MOVI_BL2_POS (MOVI_LAST_BLKPOS - MOVI_BL1_BLKCNT - MOVI_BL2_BLKCNT - MOVI_ENV_BLKCNT)
#ifndef __ASSEMBLY__
struct movi_offset_t {
uint last;
uint bl1;
uint env;
uint bl2;
uint zimage;
};
/* external functions */
extern void hsmmc_set_gpio(void);
extern void hsmmc_reset (void);
extern int hsmmc_init (void);
extern int movi_init(void);
extern void movi_set_capacity(void);
extern int movi_set_ofs(uint last);
extern void movi_write (uint addr, uint start_blk, uint blknum);
extern void movi_read (uint addr, uint start_blk, uint blknum);
extern void movi_write_env(ulong addr);
extern void movi_read_env(ulong addr);
#if defined(CONFIG_S3C2450)
extern ulong virt_to_phy_smdk2450(ulong addr);
#elif defined(CONFIG_S3C6400)
extern ulong virt_to_phy_smdk6400(ulong addr);
#elif defined(CONFIG_S3C6410)
extern ulong virt_to_phy_smdk6410(ulong addr);
#elif defined(CONFIG_S3C6430)
extern ulong virt_to_phy_smdk6430(ulong addr);
#elif defined(CONFIG_S3C2416)
extern ulong virt_to_phy_smdk2416(ulong addr);
#endif
extern void test_hsmmc (uint width, uint test, uint start_blk, uint blknum);
/* external variables */
extern struct movi_offset_t ofsinfo;
//#include <asm/hardware.h>
#ifndef __ASSEMBLY__
typedef enum {
S3C64XX_UART0,
S3C64XX_UART1,