Fixed MTP to work with TWRP

This commit is contained in:
awab228 2018-06-19 23:16:04 +02:00
commit f6dfaef42e
50820 changed files with 20846062 additions and 0 deletions

View file

@ -0,0 +1,7 @@
#ifndef __ASM_MACH_CLKDEV_H
#define __ASM_MACH_CLKDEV_H
int __clk_get(struct clk *clk);
void __clk_put(struct clk *clk);
#endif /* __ASM_MACH_CLKDEV_H */

View file

@ -0,0 +1,410 @@
LIST "KZM9G low-level initialization routine."
LIST "Adapted from u-boot KZM9G support code."
LIST "Copyright (C) 2013 Ulrich Hecht"
LIST "This program is free software; you can redistribute it and/or modify"
LIST "it under the terms of the GNU General Public License version 2 as"
LIST "published by the Free Software Foundation."
LIST "This program is distributed in the hope that it will be useful,"
LIST "but WITHOUT ANY WARRANTY; without even the implied warranty of"
LIST "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the"
LIST "GNU General Public License for more details."
LIST "Register definitions:"
LIST "Secure control register"
#define LIFEC_SEC_SRC (0xE6110008)
LIST "RWDT"
#define RWDT_BASE (0xE6020000)
#define RWTCSRA0 (RWDT_BASE + 0x04)
LIST "HPB Semaphore Control Registers"
#define HPBSCR_BASE (0xE6000000)
#define HPBCTRL6 (HPBSCR_BASE + 0x1030)
#define SBSC1_BASE (0xFE400000)
#define SDCR0A (SBSC1_BASE + 0x0008)
#define SDCR1A (SBSC1_BASE + 0x000C)
#define SDPCRA (SBSC1_BASE + 0x0010)
#define SDCR0SA (SBSC1_BASE + 0x0018)
#define SDCR1SA (SBSC1_BASE + 0x001C)
#define RTCSRA (SBSC1_BASE + 0x0020)
#define RTCORA (SBSC1_BASE + 0x0028)
#define RTCORHA (SBSC1_BASE + 0x002C)
#define SDWCRC0A (SBSC1_BASE + 0x0040)
#define SDWCRC1A (SBSC1_BASE + 0x0044)
#define SDWCR00A (SBSC1_BASE + 0x0048)
#define SDWCR01A (SBSC1_BASE + 0x004C)
#define SDWCR10A (SBSC1_BASE + 0x0050)
#define SDWCR11A (SBSC1_BASE + 0x0054)
#define SDWCR2A (SBSC1_BASE + 0x0060)
#define SDWCRC2A (SBSC1_BASE + 0x0064)
#define ZQCCRA (SBSC1_BASE + 0x0068)
#define SDMRACR0A (SBSC1_BASE + 0x0084)
#define SDMRTMPCRA (SBSC1_BASE + 0x008C)
#define SDMRTMPMSKA (SBSC1_BASE + 0x0094)
#define SDGENCNTA (SBSC1_BASE + 0x009C)
#define SDDRVCR0A (SBSC1_BASE + 0x00B4)
#define DLLCNT0A (SBSC1_BASE + 0x0354)
#define SDMRA1 (0xFE500000)
#define SDMRA2 (0xFE5C0000)
#define SDMRA3 (0xFE504000)
#define SBSC2_BASE (0xFB400000)
#define SDCR0B (SBSC2_BASE + 0x0008)
#define SDCR1B (SBSC2_BASE + 0x000C)
#define SDPCRB (SBSC2_BASE + 0x0010)
#define SDCR0SB (SBSC2_BASE + 0x0018)
#define SDCR1SB (SBSC2_BASE + 0x001C)
#define RTCSRB (SBSC2_BASE + 0x0020)
#define RTCORB (SBSC2_BASE + 0x0028)
#define RTCORHB (SBSC2_BASE + 0x002C)
#define SDWCRC0B (SBSC2_BASE + 0x0040)
#define SDWCRC1B (SBSC2_BASE + 0x0044)
#define SDWCR00B (SBSC2_BASE + 0x0048)
#define SDWCR01B (SBSC2_BASE + 0x004C)
#define SDWCR10B (SBSC2_BASE + 0x0050)
#define SDWCR11B (SBSC2_BASE + 0x0054)
#define SDPDCR0B (SBSC2_BASE + 0x0058)
#define SDWCR2B (SBSC2_BASE + 0x0060)
#define SDWCRC2B (SBSC2_BASE + 0x0064)
#define ZQCCRB (SBSC2_BASE + 0x0068)
#define SDMRACR0B (SBSC2_BASE + 0x0084)
#define SDMRTMPCRB (SBSC2_BASE + 0x008C)
#define SDMRTMPMSKB (SBSC2_BASE + 0x0094)
#define SDGENCNTB (SBSC2_BASE + 0x009C)
#define DPHYCNT0B (SBSC2_BASE + 0x00A0)
#define DPHYCNT1B (SBSC2_BASE + 0x00A4)
#define DPHYCNT2B (SBSC2_BASE + 0x00A8)
#define SDDRVCR0B (SBSC2_BASE + 0x00B4)
#define DLLCNT0B (SBSC2_BASE + 0x0354)
#define SDMRB1 (0xFB500000)
#define SDMRB2 (0xFB5C0000)
#define SDMRB3 (0xFB504000)
#define CPG_BASE (0xE6150000)
#define FRQCRA (CPG_BASE + 0x0000)
#define FRQCRB (CPG_BASE + 0x0004)
#define FRQCRD (CPG_BASE + 0x00E4)
#define VCLKCR1 (CPG_BASE + 0x0008)
#define VCLKCR2 (CPG_BASE + 0x000C)
#define VCLKCR3 (CPG_BASE + 0x001C)
#define ZBCKCR (CPG_BASE + 0x0010)
#define FLCKCR (CPG_BASE + 0x0014)
#define SD0CKCR (CPG_BASE + 0x0074)
#define SD1CKCR (CPG_BASE + 0x0078)
#define SD2CKCR (CPG_BASE + 0x007C)
#define FSIACKCR (CPG_BASE + 0x0018)
#define SUBCKCR (CPG_BASE + 0x0080)
#define SPUACKCR (CPG_BASE + 0x0084)
#define SPUVCKCR (CPG_BASE + 0x0094)
#define MSUCKCR (CPG_BASE + 0x0088)
#define HSICKCR (CPG_BASE + 0x008C)
#define FSIBCKCR (CPG_BASE + 0x0090)
#define MFCK1CR (CPG_BASE + 0x0098)
#define MFCK2CR (CPG_BASE + 0x009C)
#define DSITCKCR (CPG_BASE + 0x0060)
#define DSI0PCKCR (CPG_BASE + 0x0064)
#define DSI1PCKCR (CPG_BASE + 0x0068)
#define DSI0PHYCR (CPG_BASE + 0x006C)
#define DVFSCR3 (CPG_BASE + 0x0174)
#define DVFSCR4 (CPG_BASE + 0x0178)
#define DVFSCR5 (CPG_BASE + 0x017C)
#define MPMODE (CPG_BASE + 0x00CC)
#define PLLECR (CPG_BASE + 0x00D0)
#define PLL0CR (CPG_BASE + 0x00D8)
#define PLL1CR (CPG_BASE + 0x0028)
#define PLL2CR (CPG_BASE + 0x002C)
#define PLL3CR (CPG_BASE + 0x00DC)
#define PLL0STPCR (CPG_BASE + 0x00F0)
#define PLL1STPCR (CPG_BASE + 0x00C8)
#define PLL2STPCR (CPG_BASE + 0x00F8)
#define PLL3STPCR (CPG_BASE + 0x00FC)
#define RMSTPCR0 (CPG_BASE + 0x0110)
#define RMSTPCR1 (CPG_BASE + 0x0114)
#define RMSTPCR2 (CPG_BASE + 0x0118)
#define RMSTPCR3 (CPG_BASE + 0x011C)
#define RMSTPCR4 (CPG_BASE + 0x0120)
#define RMSTPCR5 (CPG_BASE + 0x0124)
#define SMSTPCR0 (CPG_BASE + 0x0130)
#define SMSTPCR2 (CPG_BASE + 0x0138)
#define SMSTPCR3 (CPG_BASE + 0x013C)
#define CPGXXCR4 (CPG_BASE + 0x0150)
#define SRCR0 (CPG_BASE + 0x80A0)
#define SRCR2 (CPG_BASE + 0x80B0)
#define SRCR3 (CPG_BASE + 0x80A8)
#define VREFCR (CPG_BASE + 0x00EC)
#define PCLKCR (CPG_BASE + 0x1020)
#define PORT32CR (0xE6051020)
#define PORT33CR (0xE6051021)
#define PORT34CR (0xE6051022)
#define PORT35CR (0xE6051023)
LIST "DRAM initialization code:"
EW RWTCSRA0, 0xA507
ED_AND LIFEC_SEC_SRC, 0xFFFF7FFF
ED_AND SMSTPCR3,0xFFFF7FFF
ED_AND SRCR3, 0xFFFF7FFF
ED_AND SMSTPCR2,0xFFFBFFFF
ED_AND SRCR2, 0xFFFBFFFF
ED PLLECR, 0x00000000
WAIT_MASK PLLECR, 0x00000F00, 0x00000000
WAIT_MASK FRQCRB, 0x80000000, 0x00000000
ED PLL0CR, 0x2D000000
ED PLL1CR, 0x17100000
ED FRQCRB, 0x96235880
WAIT_MASK FRQCRB, 0x80000000, 0x00000000
ED FLCKCR, 0x0000000B
ED_AND SMSTPCR0, 0xFFFFFFFD
ED_AND SRCR0, 0xFFFFFFFD
ED 0xE6001628, 0x514
ED 0xE6001648, 0x514
ED 0xE6001658, 0x514
ED 0xE6001678, 0x514
ED DVFSCR4, 0x00092000
ED DVFSCR5, 0x000000DC
ED PLLECR, 0x00000000
WAIT_MASK PLLECR, 0x00000F00, 0x00000000
ED FRQCRA, 0x0012453C
ED FRQCRB, 0x80431350
WAIT_MASK FRQCRB, 0x80000000, 0x00000000
ED FRQCRD, 0x00000B0B
WAIT_MASK FRQCRD, 0x80000000, 0x00000000
ED PCLKCR, 0x00000003
ED VCLKCR1, 0x0000012F
ED VCLKCR2, 0x00000119
ED VCLKCR3, 0x00000119
ED ZBCKCR, 0x00000002
ED FLCKCR, 0x00000005
ED SD0CKCR, 0x00000080
ED SD1CKCR, 0x00000080
ED SD2CKCR, 0x00000080
ED FSIACKCR, 0x0000003F
ED FSIBCKCR, 0x0000003F
ED SUBCKCR, 0x00000080
ED SPUACKCR, 0x0000000B
ED SPUVCKCR, 0x0000000B
ED MSUCKCR, 0x0000013F
ED HSICKCR, 0x00000080
ED MFCK1CR, 0x0000003F
ED MFCK2CR, 0x0000003F
ED DSITCKCR, 0x00000107
ED DSI0PCKCR, 0x00000313
ED DSI1PCKCR, 0x0000130D
ED DSI0PHYCR, 0x2A800E0E
ED PLL0CR, 0x1E000000
ED PLL0CR, 0x2D000000
ED PLL1CR, 0x17100000
ED PLL2CR, 0x27000080
ED PLL3CR, 0x1D000000
ED PLL0STPCR, 0x00080000
ED PLL1STPCR, 0x000120C0
ED PLL2STPCR, 0x00012000
ED PLL3STPCR, 0x00000030
ED PLLECR, 0x0000000B
WAIT_MASK PLLECR, 0x00000B00, 0x00000B00
ED DVFSCR3, 0x000120F0
ED MPMODE, 0x00000020
ED VREFCR, 0x0000028A
ED RMSTPCR0, 0xE4628087
ED RMSTPCR1, 0xFFFFFFFF
ED RMSTPCR2, 0x53FFFFFF
ED RMSTPCR3, 0xFFFFFFFF
ED RMSTPCR4, 0x00800D3D
ED RMSTPCR5, 0xFFFFF3FF
ED SMSTPCR2, 0x00000000
ED SRCR2, 0x00040000
ED_AND PLLECR, 0xFFFFFFF7
WAIT_MASK PLLECR, 0x00000800, 0x00000000
LIST "set SBSC operational"
ED HPBCTRL6, 0x00000001
WAIT_MASK HPBCTRL6, 0x00000001, 0x00000001
LIST "set SBSC operating frequency"
ED FRQCRD, 0x00001414
WAIT_MASK FRQCRD, 0x80000000, 0x00000000
ED PLL3CR, 0x1D000000
ED_OR PLLECR, 0x00000008
WAIT_MASK PLLECR, 0x00000800, 0x00000800
LIST "enable DLL oscillation in DDRPHY"
ED_OR DLLCNT0A, 0x00000002
LIST "wait >= 100 ns"
ED SDGENCNTA, 0x00000005
WAIT_MASK SDGENCNTA, 0xFFFFFFFF, 0x00000000
LIST "target LPDDR2 device settings"
ED SDCR0A, 0xACC90159
ED SDCR1A, 0x00010059
ED SDWCRC0A, 0x50874114
ED SDWCRC1A, 0x33199B37
ED SDWCRC2A, 0x008F2313
ED SDWCR00A, 0x31020707
ED SDWCR01A, 0x0017040A
ED SDWCR10A, 0x31020707
ED SDWCR11A, 0x0017040A
ED SDDRVCR0A, 0x055557ff
ED SDWCR2A, 0x30000000
LIST "drive CKE high"
ED_OR SDPCRA, 0x00000080
WAIT_MASK SDPCRA, 0x00000080, 0x00000080
LIST "wait >= 200 us"
ED SDGENCNTA, 0x00002710
WAIT_MASK SDGENCNTA, 0xFFFFFFFF, 0x00000000
LIST "issue reset command to LPDDR2 device"
ED SDMRACR0A, 0x0000003F
ED SDMRA1, 0x00000000
LIST "wait >= 10 (or 1) us (docs inconsistent)"
ED SDGENCNTA, 0x000001F4
WAIT_MASK SDGENCNTA, 0xFFFFFFFF, 0x00000000
LIST "MRW ZS initialization calibration command"
ED SDMRACR0A, 0x0000FF0A
ED SDMRA3, 0x00000000
LIST "wait >= 1 us"
ED SDGENCNTA, 0x00000032
WAIT_MASK SDGENCNTA, 0xFFFFFFFF, 0x00000000
LIST "specify operating mode in LPDDR2"
ED SDMRACR0A, 0x00002201
ED SDMRA1, 0x00000000
ED SDMRACR0A, 0x00000402
ED SDMRA1, 0x00000000
ED SDMRACR0A, 0x00000203
ED SDMRA1, 0x00000000
LIST "initialize DDR interface"
ED SDMRA2, 0x00000000
LIST "temperature sensor control"
ED SDMRTMPCRA, 0x88800004
ED SDMRTMPMSKA,0x00000004
LIST "auto-refreshing control"
ED RTCORA, 0xA55A0032
ED RTCORHA, 0xA55A000C
ED RTCSRA, 0xA55A2048
ED_OR SDCR0A, 0x00000800
ED_OR SDCR1A, 0x00000400
LIST "auto ZQ calibration control"
ED ZQCCRA, 0xFFF20000
ED_OR DLLCNT0B, 0x00000002
ED SDGENCNTB, 0x00000005
WAIT_MASK SDGENCNTB, 0xFFFFFFFF, 0x00000000
ED SDCR0B, 0xACC90159
ED SDCR1B, 0x00010059
ED SDWCRC0B, 0x50874114
ED SDWCRC1B, 0x33199B37
ED SDWCRC2B, 0x008F2313
ED SDWCR00B, 0x31020707
ED SDWCR01B, 0x0017040A
ED SDWCR10B, 0x31020707
ED SDWCR11B, 0x0017040A
ED SDDRVCR0B, 0x055557ff
ED SDWCR2B, 0x30000000
ED_OR SDPCRB, 0x00000080
WAIT_MASK SDPCRB, 0x00000080, 0x00000080
ED SDGENCNTB, 0x00002710
WAIT_MASK SDGENCNTB, 0xFFFFFFFF, 0x00000000
ED SDMRACR0B, 0x0000003F
LIST "upstream u-boot writes to SDMRA1A for both SBSC 1 and 2, which does"
LIST "not seem to make a lot of sense..."
ED SDMRB1, 0x00000000
ED SDGENCNTB, 0x000001F4
WAIT_MASK SDGENCNTB, 0xFFFFFFFF, 0x00000000
ED SDMRACR0B, 0x0000FF0A
ED SDMRB3, 0x00000000
ED SDGENCNTB, 0x00000032
WAIT_MASK SDGENCNTB, 0xFFFFFFFF, 0x00000000
ED SDMRACR0B, 0x00002201
ED SDMRB1, 0x00000000
ED SDMRACR0B, 0x00000402
ED SDMRB1, 0x00000000
ED SDMRACR0B, 0x00000203
ED SDMRB1, 0x00000000
ED SDMRB2, 0x00000000
ED SDMRTMPCRB, 0x88800004
ED SDMRTMPMSKB, 0x00000004
ED RTCORB, 0xA55A0032
ED RTCORHB, 0xA55A000C
ED RTCSRB, 0xA55A2048
ED_OR SDCR0B, 0x00000800
ED_OR SDCR1B, 0x00000400
ED ZQCCRB, 0xFFF20000
ED_OR SDPDCR0B, 0x00030000
ED DPHYCNT1B, 0xA5390000
ED DPHYCNT0B, 0x00001200
ED DPHYCNT1B, 0x07CE0000
ED DPHYCNT0B, 0x00001247
WAIT_MASK DPHYCNT2B, 0xFFFFFFFF, 0x07CE0000
ED_AND SDPDCR0B, 0xFFFCFFFF
ED FRQCRD, 0x00000B0B
WAIT_MASK FRQCRD, 0x80000000, 0x00000000
ED CPGXXCR4, 0xfffffffc
LIST "Setup SCIF4 / workaround"
EB PORT32CR, 0x12
EB PORT33CR, 0x22
EB PORT34CR, 0x12
EB PORT35CR, 0x22
EW 0xE6C80000, 0
EB 0xE6C80004, 0x19
EW 0xE6C80008, 0x0030
EW 0xE6C80018, 0
EW 0xE6C80030, 0x0014
LIST "Magic to avoid hangs and corruption on DRAM writes."
LIST "It has been observed that the system would most often hang while"
LIST "decompressing the kernel, and if it didn't it would always write"
LIST "a corrupt image to DRAM."
LIST "This problem does not occur in u-boot, and the reason is that"
LIST "u-boot performs an additional cache invalidation after setting up"
LIST "the DRAM controller. Such an invalidation should not be necessary at"
LIST "this point, and attempts at removing parts of the routine to arrive"
LIST "at the minimal snippet of code necessary to avoid the DRAM stability"
LIST "problem yielded the following:"
MRC p15, 0, r0, c1, c0, 0
MCR p15, 0, r0, c1, c0, 0

View file

@ -0,0 +1,93 @@
LIST "partner-jet-setup.txt"
LIST "(C) Copyright 2010 Renesas Solutions Corp"
LIST "Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>"
LIST "RWT Setting"
EW 0xE6020004, 0xA500
EW 0xE6030004, 0xA500
LIST "GPIO Setting"
EB 0xE6051013, 0xA2
LIST "CPG"
ED 0xE61500C0, 0x00000002
WAIT 1, 0xFE40009C
LIST "FRQCR"
ED 0xE6150000, 0x2D1305C3
ED 0xE61500E0, 0x9E40358E
ED 0xE6150004, 0x80331050
WAIT 1, 0xFE40009C
ED 0xE61500E4, 0x00002000
WAIT 1, 0xFE40009C
LIST "PLL"
ED 0xE6150028, 0x00004000
WAIT 1, 0xFE40009C
ED 0xE615002C, 0x93000040
WAIT 1, 0xFE40009C
LIST "SUB/USBClk"
ED 0xE6150080, 0x00000180
LIST "BSC"
ED 0xFEC10000, 0x00E0001B
LIST "SBSC1"
ED 0xFE400354, 0x01AD8000
ED 0xFE400354, 0x01AD8001
WAIT 5, 0xFE40009C
ED 0xFE400008, 0xBCC90151
ED 0xFE400040, 0x41774113
ED 0xFE400044, 0x2712E229
ED 0xFE400048, 0x20C18505
ED 0xFE40004C, 0x00110209
ED 0xFE400010, 0x00000087
WAIT 30, 0xFE40009C
ED 0xFE400084, 0x0000003F
EB 0xFE500000, 0x00
WAIT 5, 0xFE40009C
ED 0xFE400084, 0x0000FF0A
EB 0xFE500000, 0x00
WAIT 1, 0xFE40009C
ED 0xFE400084, 0x00002201
EB 0xFE500000, 0x00
ED 0xFE400084, 0x00000302
EB 0xFE500000, 0x00
EB 0xFE5C0000, 0x00
ED 0xFE400008, 0xBCC90159
ED 0xFE40008C, 0x88800004
ED 0xFE400094, 0x00000004
ED 0xFE400028, 0xA55A0032
ED 0xFE40002C, 0xA55A000C
ED 0xFE400020, 0xA55A2048
ED 0xFE400008, 0xBCC90959
LIST "Change CPGA setting"
ED 0xE61500E0, 0x9E40352E
ED 0xE6150004, 0x80331050
WAIT 1, 0xFE40009C
ED 0xFE400354, 0x01AD8002
LIST "SCIF0 - Serial port for earlyprintk"
EB 0xE6053098, 0xe1
EW 0xE6C40000, 0x0000
EB 0xE6C40004, 0x19
EW 0xE6C40008, 0x0030

View file

@ -0,0 +1,10 @@
#ifndef __ASM_MACH_IRQS_H
#define __ASM_MACH_IRQS_H
/* Stuck here until drivers/pinctl/sh-pfc gets rid of legacy code */
/* External IRQ pins */
#define IRQPIN_BASE 2000
#define irq_pin(nr) ((nr) + IRQPIN_BASE)
#endif /* __ASM_MACH_IRQS_H */

View file

@ -0,0 +1,38 @@
#ifndef MMC_MACKEREL_H
#define MMC_MACKEREL_H
#define PORT0CR (void __iomem *)0xe6051000
#define PORT1CR (void __iomem *)0xe6051001
#define PORT2CR (void __iomem *)0xe6051002
#define PORT159CR (void __iomem *)0xe605009f
#define PORTR031_000DR (void __iomem *)0xe6055000
#define PORTL159_128DR (void __iomem *)0xe6054010
static inline void mmc_init_progress(void)
{
/* Initialise LEDS0-3
* registers: PORT0CR-PORT2CR,PORT159CR (LED0-LED3 Control)
* value: 0x10 - enable output
*/
__raw_writeb(0x10, PORT0CR);
__raw_writeb(0x10, PORT1CR);
__raw_writeb(0x10, PORT2CR);
__raw_writeb(0x10, PORT159CR);
}
static inline void mmc_update_progress(int n)
{
unsigned a = 0, b = 0;
if (n < 3)
a = 1 << n;
else
b = 1 << 31;
__raw_writel((__raw_readl(PORTR031_000DR) & ~0x7) | a,
PORTR031_000DR);
__raw_writel((__raw_readl(PORTL159_128DR) & ~(1 << 31)) | b,
PORTL159_128DR);
}
#endif /* MMC_MACKEREL_H */

View file

@ -0,0 +1,16 @@
#ifndef MMC_H
#define MMC_H
/**************************************************
*
* board specific settings
*
**************************************************/
#ifdef CONFIG_MACH_MACKEREL
#include "mach/mmc-mackerel.h"
#else
#error "unsupported board."
#endif
#endif /* MMC_H */

View file

@ -0,0 +1,21 @@
#ifndef SDHI_SH7372_H
#define SDHI_SH7372_H
#define SDGENCNTA 0xfe40009c
/* The countdown of SDGENCNTA is controlled by
* ZB3D2CLK which runs at 149.5MHz.
* That is 149.5ticks/us. Approximate this as 150ticks/us.
*/
static void udelay(int us)
{
__raw_writel(us * 150, SDGENCNTA);
while(__raw_readl(SDGENCNTA)) ;
}
static void msleep(int ms)
{
udelay(ms * 1000);
}
#endif

View file

@ -0,0 +1,16 @@
#ifndef SDHI_H
#define SDHI_H
/**************************************************
*
* CPU specific settings
*
**************************************************/
#ifdef CONFIG_ARCH_SH7372
#include "mach/sdhi-sh7372.h"
#else
#error "unsupported CPU."
#endif
#endif /* SDHI_H */

View file

@ -0,0 +1,11 @@
#ifndef __ASM_ARCH_SYSTEM_H
#define __ASM_ARCH_SYSTEM_H
#include <asm/system_misc.h>
static inline void arch_reset(char mode, const char *cmd)
{
soft_restart(0);
}
#endif

View file

@ -0,0 +1,19 @@
#ifndef __ASM_MACH_UNCOMPRESS_H
#define __ASM_MACH_UNCOMPRESS_H
/*
* This does not append a newline
*/
static void putc(int c)
{
}
static inline void flush(void)
{
}
static void arch_decomp_setup(void)
{
}
#endif /* __ASM_MACH_UNCOMPRESS_H */

View file

@ -0,0 +1,22 @@
#ifndef ZBOOT_H
#define ZBOOT_H
#include <mach/zboot_macros.h>
/**************************************************
*
* board specific settings
*
**************************************************/
#ifdef CONFIG_MACH_MACKEREL
#define MEMORY_START 0x40000000
#include "mach/head-mackerel.txt"
#elif defined(CONFIG_MACH_KZM9G) || defined(CONFIG_MACH_KZM9G_REFERENCE)
#define MEMORY_START 0x43000000
#include "mach/head-kzm9g.txt"
#else
#error "unsupported board."
#endif
#endif /* ZBOOT_H */

View file

@ -0,0 +1,108 @@
#ifndef __ZBOOT_MACRO_H
#define __ZBOOT_MACRO_H
/* The LIST command is used to include comments in the script */
.macro LIST comment
.endm
/* The ED command is used to write a 32-bit word */
.macro ED, addr, data
LDR r0, 1f
LDR r1, 2f
STR r1, [r0]
B 3f
1 : .long \addr
2 : .long \data
3 :
.endm
/* The EW command is used to write a 16-bit word */
.macro EW, addr, data
LDR r0, 1f
LDR r1, 2f
STRH r1, [r0]
B 3f
1 : .long \addr
2 : .long \data
3 :
.endm
/* The EB command is used to write an 8-bit word */
.macro EB, addr, data
LDR r0, 1f
LDR r1, 2f
STRB r1, [r0]
B 3f
1 : .long \addr
2 : .long \data
3 :
.endm
/* The WAIT command is used to delay the execution */
.macro WAIT, time, reg
LDR r1, 1f
LDR r0, 2f
STR r0, [r1]
10 :
LDR r0, [r1]
CMP r0, #0x00000000
BNE 10b
NOP
B 3f
1 : .long \reg
2 : .long \time * 100
3 :
.endm
/* The DD command is used to read a 32-bit word */
.macro DD, start, end
LDR r1, 1f
B 2f
1 : .long \start
2 :
.endm
/* loop until a given value has been read (with mask) */
.macro WAIT_MASK, addr, data, cmp
LDR r0, 2f
LDR r1, 3f
LDR r2, 4f
1:
LDR r3, [r0, #0]
AND r3, r1, r3
CMP r2, r3
BNE 1b
B 5f
2: .long \addr
3: .long \data
4: .long \cmp
5:
.endm
/* read 32-bit value from addr, "or" an immediate and write back */
.macro ED_OR, addr, data
LDR r4, 1f
LDR r5, 2f
LDR r6, [r4]
ORR r5, r6, r5
STR r5, [r4]
B 3f
1: .long \addr
2: .long \data
3:
.endm
/* read 32-bit value from addr, "and" an immediate and write back */
.macro ED_AND, addr, data
LDR r4, 1f
LDR r5, 2f
LDR r6, [r4]
AND r5, r6, r5
STR r5, [r4]
B 3f
1: .long \addr
2: .long \data
3:
.endm
#endif /* __ZBOOT_MACRO_H */