commit
e89d623f09
@ -0,0 +1,25 @@ |
||||
if ARCH_S5PC1XX |
||||
|
||||
choice |
||||
prompt "S5PC1XX board select" |
||||
|
||||
config TARGET_S5P_GONI |
||||
bool "S5P Goni board" |
||||
select OF_CONTROL if !SPL_BUILD |
||||
|
||||
config TARGET_SMDKC100 |
||||
bool "Support smdkc100 board" |
||||
select OF_CONTROL if !SPL_BUILD |
||||
|
||||
endchoice |
||||
|
||||
config SYS_CPU |
||||
default "armv7" |
||||
|
||||
config SYS_SOC |
||||
default "s5pc1xx" |
||||
|
||||
source "board/samsung/goni/Kconfig" |
||||
source "board/samsung/smdkc100/Kconfig" |
||||
|
||||
endif |
@ -1,30 +0,0 @@ |
||||
/* |
||||
* Copyright (C) 2009 Samsung Electronics |
||||
* Minkyu Kang <mk7.kang@samsung.com>
|
||||
* |
||||
* based on arch/arm/cpu/armv7/omap3/cache.S |
||||
* |
||||
* SPDX-License-Identifier: GPL-2.0+ |
||||
*/ |
||||
|
||||
.align 5
|
||||
|
||||
#include <linux/linkage.h> |
||||
|
||||
#ifndef CONFIG_SYS_L2CACHE_OFF |
||||
ENTRY(v7_outer_cache_enable) |
||||
push {r0, r1, r2, lr} |
||||
mrc 15, 0, r3, cr1, cr0, 1 |
||||
orr r3, r3, #2 |
||||
mcr 15, 0, r3, cr1, cr0, 1 |
||||
pop {r1, r2, r3, pc} |
||||
ENDPROC(v7_outer_cache_enable) |
||||
|
||||
ENTRY(v7_outer_cache_disable) |
||||
push {r0, r1, r2, lr} |
||||
mrc 15, 0, r3, cr1, cr0, 1 |
||||
bic r3, r3, #2 |
||||
mcr 15, 0, r3, cr1, cr0, 1 |
||||
pop {r1, r2, r3, pc} |
||||
ENDPROC(v7_outer_cache_disable) |
||||
#endif |
@ -0,0 +1,47 @@ |
||||
/*
|
||||
* Copyright (C) 2014 Samsung Electronics |
||||
* Minkyu Kang <mk7.kang@samsung.com> |
||||
* Robert Baldyga <r.baldyga@samsung.com> |
||||
* |
||||
* based on arch/arm/cpu/armv7/omap3/cache.S |
||||
* |
||||
* SPDX-License-Identifier: GPL-2.0+ |
||||
*/ |
||||
|
||||
#include <common.h> |
||||
|
||||
#ifndef CONFIG_SYS_DCACHE_OFF |
||||
void enable_caches(void) |
||||
{ |
||||
dcache_enable(); |
||||
} |
||||
|
||||
void disable_caches(void) |
||||
{ |
||||
dcache_disable(); |
||||
} |
||||
#endif |
||||
|
||||
#ifndef CONFIG_SYS_L2CACHE_OFF |
||||
void v7_outer_cache_enable(void) |
||||
{ |
||||
__asm( |
||||
"push {r0, r1, r2, lr}\n\t" |
||||
"mrc 15, 0, r3, cr1, cr0, 1\n\t" |
||||
"orr r3, r3, #2\n\t" |
||||
"mcr 15, 0, r3, cr1, cr0, 1\n\t" |
||||
"pop {r1, r2, r3, pc}" |
||||
); |
||||
} |
||||
|
||||
void v7_outer_cache_disable(void) |
||||
{ |
||||
__asm( |
||||
"push {r0, r1, r2, lr}\n\t" |
||||
"mrc 15, 0, r3, cr1, cr0, 1\n\t" |
||||
"bic r3, r3, #2\n\t" |
||||
"mcr 15, 0, r3, cr1, cr0, 1\n\t" |
||||
"pop {r1, r2, r3, pc}" |
||||
); |
||||
} |
||||
#endif |
@ -0,0 +1,21 @@ |
||||
/* |
||||
* Samsung's Exynos4210-based SMDKV310 board device tree source |
||||
* |
||||
* Copyright (c) 2014 Google, Inc |
||||
* |
||||
* SPDX-License-Identifier: GPL-2.0+ |
||||
*/ |
||||
|
||||
/dts-v1/; |
||||
/include/ "exynos4.dtsi" |
||||
|
||||
/ { |
||||
model = "Samsung SMDKV310 on Exynos4210"; |
||||
compatible = "samsung,smdkv310", "samsung,exynos4210"; |
||||
|
||||
aliases { |
||||
serial0 = "/serial@13800000"; |
||||
console = "/serial@13820000"; |
||||
}; |
||||
|
||||
}; |
@ -0,0 +1,28 @@ |
||||
/* |
||||
* Samsung's S5PC110-based Goni board device tree source |
||||
* |
||||
* Copyright (c) 2014 Google, Inc |
||||
* |
||||
* SPDX-License-Identifier: GPL-2.0+ |
||||
*/ |
||||
|
||||
/dts-v1/; |
||||
|
||||
#include "skeleton.dtsi" |
||||
|
||||
/ { |
||||
model = "Samsung Goni based on S5PC110"; |
||||
compatible = "samsung,goni", "samsung,s5pc110"; |
||||
|
||||
aliases { |
||||
serial2 = "/serial@e2900800"; |
||||
console = "/serial@e2900800"; |
||||
}; |
||||
|
||||
serial@e2900800 { |
||||
compatible = "samsung,exynos4210-uart"; |
||||
reg = <0xe2900800 0x400>; |
||||
id = <2>; |
||||
}; |
||||
|
||||
}; |
@ -0,0 +1,29 @@ |
||||
/* |
||||
* Samsung's Exynos4210-based SMDKV310 board device tree source |
||||
* |
||||
* Copyright (c) 2014 Google, Inc |
||||
* |
||||
* SPDX-License-Identifier: GPL-2.0+ |
||||
*/ |
||||
|
||||
/dts-v1/; |
||||
|
||||
#include "skeleton.dtsi" |
||||
|
||||
/ { |
||||
model = "Samsung SMDKC100 based on S5PC100"; |
||||
compatible = "samsung,smdkc100", "samsung,s5pc100"; |
||||
|
||||
aliases { |
||||
serial0 = "/serial@ec000000"; |
||||
console = "/serial@ec000000"; |
||||
}; |
||||
|
||||
serial@ec000000 { |
||||
compatible = "samsung,exynos4210-uart"; |
||||
reg = <0xec000000 0x100>; |
||||
interrupts = <0 51 0>; |
||||
id = <0>; |
||||
}; |
||||
|
||||
}; |
@ -0,0 +1,61 @@ |
||||
/*
|
||||
* Copyright (C) 2012 Samsung Electronics |
||||
* Rajeshwari Shinde <rajeshwari.s@samsung.com> |
||||
* |
||||
* SPDX-License-Identifier: GPL-2.0+ |
||||
*/ |
||||
|
||||
#ifndef __ASM_ARM_ARCH_PERIPH_H |
||||
#define __ASM_ARM_ARCH_PERIPH_H |
||||
|
||||
/*
|
||||
* Peripherals required for pinmux configuration. List will |
||||
* grow with support for more devices getting added. |
||||
* Numbering based on interrupt table. |
||||
* |
||||
*/ |
||||
enum periph_id { |
||||
PERIPH_ID_UART0 = 51, |
||||
PERIPH_ID_UART1, |
||||
PERIPH_ID_UART2, |
||||
PERIPH_ID_UART3, |
||||
PERIPH_ID_I2C0 = 56, |
||||
PERIPH_ID_I2C1, |
||||
PERIPH_ID_I2C2, |
||||
PERIPH_ID_I2C3, |
||||
PERIPH_ID_I2C4, |
||||
PERIPH_ID_I2C5, |
||||
PERIPH_ID_I2C6, |
||||
PERIPH_ID_I2C7, |
||||
PERIPH_ID_SPI0 = 68, |
||||
PERIPH_ID_SPI1, |
||||
PERIPH_ID_SPI2, |
||||
PERIPH_ID_SDMMC0 = 75, |
||||
PERIPH_ID_SDMMC1, |
||||
PERIPH_ID_SDMMC2, |
||||
PERIPH_ID_SDMMC3, |
||||
PERIPH_ID_I2C8 = 87, |
||||
PERIPH_ID_I2C9, |
||||
PERIPH_ID_I2S0 = 98, |
||||
PERIPH_ID_I2S1 = 99, |
||||
|
||||
/* Since following peripherals do
|
||||
* not have shared peripheral interrupts (SPIs) |
||||
* they are numbered arbitiraly after the maximum |
||||
* SPIs Exynos has (128) |
||||
*/ |
||||
PERIPH_ID_SROMC = 128, |
||||
PERIPH_ID_SPI3, |
||||
PERIPH_ID_SPI4, |
||||
PERIPH_ID_SDMMC4, |
||||
PERIPH_ID_PWM0, |
||||
PERIPH_ID_PWM1, |
||||
PERIPH_ID_PWM2, |
||||
PERIPH_ID_PWM3, |
||||
PERIPH_ID_PWM4, |
||||
PERIPH_ID_I2C10 = 203, |
||||
|
||||
PERIPH_ID_NONE = -1, |
||||
}; |
||||
|
||||
#endif /* __ASM_ARM_ARCH_PERIPH_H */ |
@ -0,0 +1,50 @@ |
||||
/*
|
||||
* Copyright (C) 2012 Samsung Electronics |
||||
* Abhilash Kesavan <a.kesavan@samsung.com> |
||||
* |
||||
* SPDX-License-Identifier: GPL-2.0+ |
||||
*/ |
||||
|
||||
#ifndef __ASM_ARM_ARCH_PINMUX_H |
||||
#define __ASM_ARM_ARCH_PINMUX_H |
||||
|
||||
#include "periph.h" |
||||
|
||||
/*
|
||||
* Flags for setting specific configarations of peripherals. |
||||
* List will grow with support for more devices getting added. |
||||
*/ |
||||
enum { |
||||
PINMUX_FLAG_NONE = 0x00000000, |
||||
|
||||
/* Flags for eMMC */ |
||||
PINMUX_FLAG_8BIT_MODE = 1 << 0, /* SDMMC 8-bit mode */ |
||||
|
||||
/* Flags for SROM controller */ |
||||
PINMUX_FLAG_BANK = 3 << 0, /* bank number (0-3) */ |
||||
PINMUX_FLAG_16BIT = 1 << 2, /* 16-bit width */ |
||||
}; |
||||
|
||||
/**
|
||||
* Configures the pinmux for a particular peripheral. |
||||
* |
||||
* Each gpio can be configured in many different ways (4 bits on exynos) |
||||
* such as "input", "output", "special function", "external interrupt" |
||||
* etc. This function will configure the peripheral pinmux along with |
||||
* pull-up/down and drive strength. |
||||
* |
||||
* @param peripheral peripheral to be configured |
||||
* @param flags configure flags |
||||
* @return 0 if ok, -1 on error (e.g. unsupported peripheral) |
||||
*/ |
||||
int exynos_pinmux_config(int peripheral, int flags); |
||||
|
||||
/**
|
||||
* Decode the peripheral id using the interrpt numbers. |
||||
* |
||||
* @param blob Device tree blob |
||||
* @param node FDT I2C node to find |
||||
* @return peripheral id if ok, PERIPH_ID_NONE on error |
||||
*/ |
||||
int pinmux_decode_periph_id(const void *blob, int node); |
||||
#endif |
@ -0,0 +1,23 @@ |
||||
if TARGET_OT1200 |
||||
|
||||
config SYS_CPU |
||||
string |
||||
default "armv7" |
||||
|
||||
config SYS_BOARD |
||||
string |
||||
default "ot1200" |
||||
|
||||
config SYS_VENDOR |
||||
string |
||||
default "bachmann" |
||||
|
||||
config SYS_SOC |
||||
string |
||||
default "mx6" |
||||
|
||||
config SYS_CONFIG_NAME |
||||
string |
||||
default "ot1200" |
||||
|
||||
endif |
@ -0,0 +1,6 @@ |
||||
BACHMANN ELECTRONIC OT1200 BOARD |
||||
M: Christian Gmeiner <christian.gmeiner@gmail.com> |
||||
S: Maintained |
||||
F: board/bachmann/ot1200 |
||||
F: include/configs/ot1200.h |
||||
F: configs/ot1200*_defconfig |
@ -0,0 +1,9 @@ |
||||
#
|
||||
# Copyright (C) 2012-2013, Guennadi Liakhovetski <lg@denx.de>
|
||||
# (C) Copyright 2012-2013 Freescale Semiconductor, Inc.
|
||||
# Copyright (C) 2013, Boundary Devices <info@boundarydevices.com>
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-2.0+
|
||||
#
|
||||
|
||||
obj-y := ot1200.o
|
@ -0,0 +1,20 @@ |
||||
U-Boot for the Bachmann electronic GmbH OT1200 devices |
||||
|
||||
There are two different versions of the base board, which differ |
||||
in the way ethernet is done. The variant detection is done during |
||||
runtime based on the address of the found phy. |
||||
|
||||
- "mr" variant |
||||
FEC is connected directly to an ethernet switch (KSZ8895). The ethernet |
||||
port is always up and auto-negotiation is not possible. |
||||
|
||||
- normal variant |
||||
FEC is connected to a normal phy and auto-negotiation is possible. |
||||
|
||||
|
||||
The variant name is part of the dtb file name loaded by u-boot. This |
||||
make is possible to boot the linux kernel and make use variant specific |
||||
devicetree (fixed-phy link). |
||||
|
||||
In order to support different display resoltuions/sizes the OT1200 devices |
||||
are making use of EDID data stored in an i2c EEPROM. |
@ -0,0 +1,251 @@ |
||||
/*
|
||||
* Copyright (C) 2010-2013 Freescale Semiconductor, Inc. |
||||
* Copyright (C) 2014, Bachmann electronic GmbH |
||||
* |
||||
* SPDX-License-Identifier: GPL-2.0+ |
||||
*/ |
||||
|
||||
#include <common.h> |
||||
#include <asm/arch/clock.h> |
||||
#include <asm/arch/imx-regs.h> |
||||
#include <asm/arch/iomux.h> |
||||
#include <malloc.h> |
||||
#include <asm/arch/mx6-pins.h> |
||||
#include <asm/imx-common/iomux-v3.h> |
||||
#include <asm/imx-common/mxc_i2c.h> |
||||
#include <asm/imx-common/boot_mode.h> |
||||
#include <asm/arch/crm_regs.h> |
||||
#include <mmc.h> |
||||
#include <fsl_esdhc.h> |
||||
#include <netdev.h> |
||||
#include <i2c.h> |
||||
#include <pca953x.h> |
||||
#include <asm/gpio.h> |
||||
#include <phy.h> |
||||
|
||||
DECLARE_GLOBAL_DATA_PTR; |
||||
|
||||
#define OUTPUT_40OHM (PAD_CTL_SPEED_MED|PAD_CTL_DSE_40ohm) |
||||
|
||||
#define UART_PAD_CTRL (PAD_CTL_PUS_100K_UP | \ |
||||
OUTPUT_40OHM | PAD_CTL_SRE_FAST | PAD_CTL_HYS) |
||||
|
||||
#define USDHC_PAD_CTRL (PAD_CTL_PUS_47K_UP | \ |
||||
PAD_CTL_SPEED_LOW | PAD_CTL_DSE_80ohm | \
|
||||
PAD_CTL_SRE_FAST | PAD_CTL_HYS) |
||||
|
||||
#define ENET_PAD_CTRL (PAD_CTL_PUS_100K_UP | OUTPUT_40OHM | \ |
||||
PAD_CTL_HYS) |
||||
|
||||
#define SPI_PAD_CTRL (PAD_CTL_HYS | OUTPUT_40OHM | \ |
||||
PAD_CTL_SRE_FAST) |
||||
|
||||
#define I2C_PAD_CTRL (PAD_CTL_PUS_100K_UP | OUTPUT_40OHM | \ |
||||
PAD_CTL_HYS | PAD_CTL_ODE | PAD_CTL_SRE_FAST) |
||||
|
||||
int dram_init(void) |
||||
{ |
||||
gd->ram_size = get_ram_size((void *)PHYS_SDRAM, PHYS_SDRAM_SIZE); |
||||
|
||||
return 0; |
||||
} |
||||
|
||||
static iomux_v3_cfg_t const uart1_pads[] = { |
||||
MX6_PAD_CSI0_DAT10__UART1_TX_DATA | MUX_PAD_CTRL(UART_PAD_CTRL), |
||||
MX6_PAD_CSI0_DAT11__UART1_RX_DATA | MUX_PAD_CTRL(UART_PAD_CTRL), |
||||
}; |
||||
|
||||
static void setup_iomux_uart(void) |
||||
{ |
||||
imx_iomux_v3_setup_multiple_pads(uart1_pads, ARRAY_SIZE(uart1_pads)); |
||||
} |
||||
|
||||
static iomux_v3_cfg_t const enet_pads[] = { |
||||
MX6_PAD_KEY_ROW1__ENET_COL | MUX_PAD_CTRL(ENET_PAD_CTRL), |
||||
MX6_PAD_KEY_COL3__ENET_CRS | MUX_PAD_CTRL(ENET_PAD_CTRL), |
||||
MX6_PAD_ENET_MDIO__ENET_MDIO | MUX_PAD_CTRL(ENET_PAD_CTRL), |
||||
MX6_PAD_ENET_MDC__ENET_MDC | MUX_PAD_CTRL(ENET_PAD_CTRL), |
||||
MX6_PAD_GPIO_16__ENET_REF_CLK | MUX_PAD_CTRL(ENET_PAD_CTRL), |
||||
MX6_PAD_GPIO_18__ENET_RX_CLK | MUX_PAD_CTRL(ENET_PAD_CTRL), |
||||
MX6_PAD_ENET_RXD0__ENET_RX_DATA0 | MUX_PAD_CTRL(ENET_PAD_CTRL), |
||||
MX6_PAD_ENET_RXD1__ENET_RX_DATA1 | MUX_PAD_CTRL(ENET_PAD_CTRL), |
||||
MX6_PAD_KEY_COL2__ENET_RX_DATA2 | MUX_PAD_CTRL(ENET_PAD_CTRL), |
||||
MX6_PAD_KEY_COL0__ENET_RX_DATA3 | MUX_PAD_CTRL(ENET_PAD_CTRL), |
||||
MX6_PAD_ENET_CRS_DV__ENET_RX_EN | MUX_PAD_CTRL(ENET_PAD_CTRL), |
||||
MX6_PAD_ENET_REF_CLK__ENET_TX_CLK | MUX_PAD_CTRL(ENET_PAD_CTRL), |
||||
MX6_PAD_ENET_TXD0__ENET_TX_DATA0 | MUX_PAD_CTRL(ENET_PAD_CTRL), |
||||
MX6_PAD_ENET_TXD1__ENET_TX_DATA1 | MUX_PAD_CTRL(ENET_PAD_CTRL), |
||||
MX6_PAD_KEY_ROW2__ENET_TX_DATA2 | MUX_PAD_CTRL(ENET_PAD_CTRL), |
||||
MX6_PAD_KEY_ROW0__ENET_TX_DATA3 | MUX_PAD_CTRL(ENET_PAD_CTRL), |
||||
MX6_PAD_ENET_TX_EN__ENET_TX_EN | MUX_PAD_CTRL(ENET_PAD_CTRL), |
||||
}; |
||||
|
||||
static void setup_iomux_enet(void) |
||||
{ |
||||
imx_iomux_v3_setup_multiple_pads(enet_pads, ARRAY_SIZE(enet_pads)); |
||||
} |
||||
|
||||
static iomux_v3_cfg_t const ecspi1_pads[] = { |
||||
MX6_PAD_DISP0_DAT3__ECSPI3_SS0 | MUX_PAD_CTRL(SPI_PAD_CTRL), |
||||
MX6_PAD_DISP0_DAT4__ECSPI3_SS1 | MUX_PAD_CTRL(SPI_PAD_CTRL), |
||||
MX6_PAD_DISP0_DAT2__ECSPI3_MISO | MUX_PAD_CTRL(SPI_PAD_CTRL), |
||||
MX6_PAD_DISP0_DAT1__ECSPI3_MOSI | MUX_PAD_CTRL(SPI_PAD_CTRL), |
||||
MX6_PAD_DISP0_DAT0__ECSPI3_SCLK | MUX_PAD_CTRL(SPI_PAD_CTRL), |
||||
}; |
||||
|
||||
static void setup_iomux_spi(void) |
||||
{ |
||||
imx_iomux_v3_setup_multiple_pads(ecspi1_pads, ARRAY_SIZE(ecspi1_pads)); |
||||
} |
||||
|
||||
int board_early_init_f(void) |
||||
{ |
||||
setup_iomux_uart(); |
||||
setup_iomux_spi(); |
||||
|
||||
return 0; |
||||
} |
||||
|
||||
static iomux_v3_cfg_t const usdhc3_pads[] = { |
||||
MX6_PAD_SD3_CLK__SD3_CLK | MUX_PAD_CTRL(USDHC_PAD_CTRL), |
||||
MX6_PAD_SD3_CMD__SD3_CMD | MUX_PAD_CTRL(USDHC_PAD_CTRL), |
||||
MX6_PAD_SD3_DAT0__SD3_DATA0 | MUX_PAD_CTRL(USDHC_PAD_CTRL), |
||||
MX6_PAD_SD3_DAT1__SD3_DATA1 | MUX_PAD_CTRL(USDHC_PAD_CTRL), |
||||
MX6_PAD_SD3_DAT2__SD3_DATA2 | MUX_PAD_CTRL(USDHC_PAD_CTRL), |
||||
MX6_PAD_SD3_DAT3__SD3_DATA3 | MUX_PAD_CTRL(USDHC_PAD_CTRL), |
||||
MX6_PAD_SD3_DAT4__SD3_DATA4 | MUX_PAD_CTRL(USDHC_PAD_CTRL), |
||||
MX6_PAD_SD3_DAT5__SD3_DATA5 | MUX_PAD_CTRL(USDHC_PAD_CTRL), |
||||
MX6_PAD_SD3_DAT6__SD3_DATA6 | MUX_PAD_CTRL(USDHC_PAD_CTRL), |
||||
MX6_PAD_SD3_DAT7__SD3_DATA7 | MUX_PAD_CTRL(USDHC_PAD_CTRL), |
||||
MX6_PAD_SD3_RST__SD3_RESET | MUX_PAD_CTRL(USDHC_PAD_CTRL), |
||||
}; |
||||
|
||||
int board_mmc_getcd(struct mmc *mmc) |
||||
{ |
||||
return 1; |
||||
} |
||||
|
||||
struct fsl_esdhc_cfg usdhc_cfg[] = { |
||||
{USDHC3_BASE_ADDR}, |
||||
}; |
||||
|
||||
int board_mmc_init(bd_t *bis) |
||||
{ |
||||
usdhc_cfg[0].sdhc_clk = mxc_get_clock(MXC_ESDHC3_CLK); |
||||
usdhc_cfg[0].max_bus_width = 8; |
||||
|
||||
imx_iomux_v3_setup_multiple_pads(usdhc3_pads, ARRAY_SIZE(usdhc3_pads)); |
||||
|
||||
return fsl_esdhc_initialize(bis, &usdhc_cfg[0]); |
||||
} |
||||
|
||||
#define PC MUX_PAD_CTRL(I2C_PAD_CTRL) |
||||
|
||||
/* I2C3 - IO expander */ |
||||
static struct i2c_pads_info i2c_pad_info2 = { |
||||
.scl = { |
||||
.i2c_mode = MX6_PAD_EIM_D17__I2C3_SCL | PC, |
||||
.gpio_mode = MX6_PAD_EIM_D17__GPIO3_IO17 | PC, |
||||
.gp = IMX_GPIO_NR(3, 17) |
||||
}, |
||||
.sda = { |
||||
.i2c_mode = MX6_PAD_EIM_D18__I2C3_SDA | PC, |
||||
.gpio_mode = MX6_PAD_EIM_D18__GPIO3_IO18 | PC, |
||||
.gp = IMX_GPIO_NR(3, 18) |
||||
} |
||||
}; |
||||
|
||||
static iomux_v3_cfg_t const pwm_pad[] = { |
||||
MX6_PAD_SD1_CMD__PWM4_OUT | MUX_PAD_CTRL(OUTPUT_40OHM), |
||||
}; |
||||
|
||||
static void leds_on(void) |
||||
{ |
||||
/* turn on all possible leds connected via GPIO expander */ |
||||
i2c_set_bus_num(2); |
||||
pca953x_set_dir(CONFIG_SYS_I2C_PCA953X_ADDR, 0xffff, PCA953X_DIR_OUT); |
||||
pca953x_set_val(CONFIG_SYS_I2C_PCA953X_ADDR, 0xffff, 0x0); |
||||
} |
||||
|
||||
static void backlight_lcd_off(void) |
||||
{ |
||||
unsigned gpio = IMX_GPIO_NR(2, 0); |
||||
gpio_direction_output(gpio, 0); |
||||
|
||||
gpio = IMX_GPIO_NR(2, 3); |
||||
gpio_direction_output(gpio, 0); |
||||
} |
||||
|
||||
int board_eth_init(bd_t *bis) |
||||
{ |
||||
uint32_t base = IMX_FEC_BASE; |
||||
struct mii_dev *bus = NULL; |
||||
struct phy_device *phydev = NULL; |
||||
int ret; |
||||
|
||||
setup_iomux_enet(); |
||||
|
||||
bus = fec_get_miibus(base, -1); |
||||
if (!bus) |
||||
return 0; |
||||
|
||||
/* scan phy 0 and 5 */ |
||||
phydev = phy_find_by_mask(bus, 0x21, PHY_INTERFACE_MODE_RGMII); |
||||
if (!phydev) { |
||||
free(bus); |
||||
return 0; |
||||
} |
||||
|
||||
/* depending on the phy address we can detect our board version */ |
||||
if (phydev->addr == 0) |
||||
setenv("boardver", ""); |
||||
else |
||||
setenv("boardver", "mr"); |
||||
|
||||
printf("using phy at %d\n", phydev->addr); |
||||
ret = fec_probe(bis, -1, base, bus, phydev); |
||||
if (ret) { |
||||
printf("FEC MXC: %s:failed\n", __func__); |
||||
free(phydev); |
||||
free(bus); |
||||
} |
||||
return 0; |
||||
} |
||||
|
||||
int board_init(void) |
||||
{ |
||||
gd->bd->bi_boot_params = PHYS_SDRAM + 0x100; |
||||
|
||||
backlight_lcd_off(); |
||||
|
||||
setup_i2c(2, CONFIG_SYS_I2C_SPEED, 0x7f, &i2c_pad_info2); |
||||
|
||||
leds_on(); |
||||
|
||||
/* enable ecspi3 clocks */ |
||||
enable_cspi_clock(1, 2); |
||||
|
||||
return 0; |
||||
} |
||||
|
||||
int checkboard(void) |
||||
{ |
||||
puts("Board: "CONFIG_SYS_BOARD"\n"); |
||||
return 0; |
||||
} |
||||
|
||||
#ifdef CONFIG_CMD_BMODE |
||||
static const struct boot_mode board_boot_modes[] = { |
||||
/* 4 bit bus width */ |
||||
{"mmc0", MAKE_CFGVAL(0x40, 0x30, 0x00, 0x00)}, |
||||
{NULL, 0}, |
||||
}; |
||||
#endif |
||||
|
||||
int misc_init_r(void) |
||||
{ |
||||
#ifdef CONFIG_CMD_BMODE |
||||
add_board_boot_modes(board_boot_modes); |
||||
#endif |
||||
return 0; |
||||
} |
@ -0,0 +1,169 @@ |
||||
/* |
||||
* Copyright (C) 2011 Freescale Semiconductor, Inc. |
||||
* Jason Liu <r64343@freescale.com> |
||||
* |
||||
* SPDX-License-Identifier: GPL-2.0+ |
||||
* |
||||
* Refer doc/README.imximage for more details about how-to configure |
||||
* and create imximage boot image |
||||
* |
||||
* The syntax is taken as close as possible with the kwbimage |
||||
*/ |
||||
|
||||
/* image version */ |
||||
IMAGE_VERSION 2 |
||||
|
||||
/* |
||||
* Boot Device : one of |
||||
* spi, sd (the board has no nand neither onenand) |
||||
*/ |
||||
BOOT_FROM sd |
||||
|
||||
/* |
||||
* Device Configuration Data (DCD) |
||||
* |
||||
* Each entry must have the format: |
||||
* Addr-type Address Value |
||||
* |
||||
* where: |
||||
* Addr-type register length (1,2 or 4 bytes) |
||||
* Address absolute address of the register |
||||
* value value to be stored in the register |
||||
*/ |
||||
DATA 4 0x020e05a8 0x00000030 |
||||
DATA 4 0x020e05b0 0x00000030 |
||||
DATA 4 0x020e0524 0x00000030 |
||||
DATA 4 0x020e051c 0x00000030 |
||||
|
||||
DATA 4 0x020e0518 0x00000030 |
||||
DATA 4 0x020e050c 0x00000030 |
||||
DATA 4 0x020e05b8 0x00000030 |
||||
DATA 4 0x020e05c0 0x00000030 |
||||
|
||||
DATA 4 0x020e05ac 0x00020030 |
||||
DATA 4 0x020e05b4 0x00020030 |
||||
DATA 4 0x020e0528 0x00020030 |
||||
DATA 4 0x020e0520 0x00020030 |
||||
|
||||
DATA 4 0x020e0514 0x00020030 |
||||
DATA 4 0x020e0510 0x00020030 |
||||
DATA 4 0x020e05bc 0x00020030 |
||||
DATA 4 0x020e05c4 0x00020030 |
||||
|
||||
DATA 4 0x020e056c 0x00020030 |
||||
DATA 4 0x020e0578 0x00020030 |
||||
DATA 4 0x020e0588 0x00020030 |
||||
DATA 4 0x020e0594 0x00020030 |
||||
|
||||
DATA 4 0x020e057c 0x00020030 |
||||
DATA 4 0x020e0590 0x00003000 |
||||
DATA 4 0x020e0598 0x00003000 |
||||
DATA 4 0x020e058c 0x00000000 |
||||
|
||||
DATA 4 0x020e059c 0x00003030 |
||||
DATA 4 0x020e05a0 0x00003030 |
||||
DATA 4 0x020e0784 0x00000030 |
||||
DATA 4 0x020e0788 0x00000030 |
||||
|
||||
DATA 4 0x020e0794 0x00000030 |
||||
DATA 4 0x020e079c 0x00000030 |
||||
DATA 4 0x020e07a0 0x00000030 |
||||
DATA 4 0x020e07a4 0x00000030 |
||||
|
||||
DATA 4 0x020e07a8 0x00000030 |
||||
DATA 4 0x020e0748 0x00000030 |
||||
DATA 4 0x020e074c 0x00000030 |
||||
DATA 4 0x020e0750 0x00020000 |
||||
|
||||
DATA 4 0x020e0758 0x00000000 |
||||
DATA 4 0x020e0774 0x00020000 |
||||
DATA 4 0x020e078c 0x00000030 |
||||
DATA 4 0x020e0798 0x000C0000 |
||||
|
||||
DATA 4 0x021b081c 0x33333333 |
||||
DATA 4 0x021b0820 0x33333333 |
||||
DATA 4 0x021b0824 0x33333333 |
||||
DATA 4 0x021b0828 0x33333333 |
||||
|
||||
DATA 4 0x021b481c 0x33333333 |
||||
DATA 4 0x021b4820 0x33333333 |
||||
DATA 4 0x021b4824 0x33333333 |
||||
DATA 4 0x021b4828 0x33333333 |
||||
|
||||
DATA 4 0x021b0018 0x00081740 |
||||
|
||||
DATA 4 0x021b001c 0x00008000 |
||||
DATA 4 0x021b000c 0x555A7974 |
||||
DATA 4 0x021b0010 0xDB538F64 |
||||
DATA 4 0x021b0014 0x01FF00DB |
||||
DATA 4 0x021b002c 0x000026D2 |
||||
|
||||
DATA 4 0x021b0030 0x005A1023 |
||||
DATA 4 0x021b0008 0x09444040 |
||||
DATA 4 0x021b0004 0x00025576 |
||||
DATA 4 0x021b0040 0x00000027 |
||||
DATA 4 0x021b0000 0x831A0000 |
||||
|
||||
DATA 4 0x021b001c 0x04088032 |
||||
DATA 4 0x021b001c 0x0408803A |
||||
DATA 4 0x021b001c 0x00008033 |
||||
DATA 4 0x021b001c 0x0000803B |
||||
DATA 4 0x021b001c 0x00428031 |
||||
DATA 4 0x021b001c 0x00428039 |
||||
DATA 4 0x021b001c 0x19308030 |
||||
DATA 4 0x021b001c 0x19308038 |
||||
|
||||
DATA 4 0x021b001c 0x04008040 |
||||
DATA 4 0x021b001c 0x04008048 |
||||
DATA 4 0x021b0800 0xA1380003 |
||||
DATA 4 0x021b4800 0xA1380003 |
||||
DATA 4 0x021b0020 0x00005800 |
||||
DATA 4 0x021b0818 0x00022227 |
||||
DATA 4 0x021b4818 0x00022227 |
||||
|
||||
DATA 4 0x021b083c 0x434B0350 |
||||
DATA 4 0x021b0840 0x034C0359 |
||||
DATA 4 0x021b483c 0x434B0350 |
||||
DATA 4 0x021b4840 0x03650348 |
||||
DATA 4 0x021b0848 0x4436383B |
||||
DATA 4 0x021b4848 0x39393341 |
||||
DATA 4 0x021b0850 0x35373933 |
||||
DATA 4 0x021b4850 0x48254A36 |
||||
|
||||
DATA 4 0x021b080c 0x001F001F |
||||
DATA 4 0x021b0810 0x001F001F |
||||
|
||||
DATA 4 0x021b480c 0x00440044 |
||||
DATA 4 0x021b4810 0x00440044 |
||||
|
||||
DATA 4 0x021b08b8 0x00000800 |
||||
DATA 4 0x021b48b8 0x00000800 |
||||
|
||||
DATA 4 0x021b001c 0x00000000 |
||||
DATA 4 0x021b0404 0x00011006 |
||||
|
||||
/* set the default clock gate to save power */ |
||||
DATA 4 0x020c4068 0x00C03F3F |
||||
DATA 4 0x020c406c 0x0030FC03 |
||||
DATA 4 0x020c4070 0x0FFFC000 |
||||
DATA 4 0x020c4074 0x3FF00000 |
||||
DATA 4 0x020c4078 0x00FFF300 |
||||
DATA 4 0x020c407c 0x0F0000C3 |
||||
DATA 4 0x020c4080 0x000003FF |
||||
|
||||
/* enable AXI cache for VDOA/VPU/IPU */ |
||||
DATA 4 0x020e0010 0xF00000CF |
||||
/* set IPU AXI-id0 Qos=0xf(bypass) AXI-id1 Qos=0x7 */ |
||||
DATA 4 0x020e0018 0x007F007F |
||||
DATA 4 0x020e001c 0x007F007F |
||||
|
||||
/* |
||||
* Setup CCM_CCOSR register as follows: |
||||
* |
||||
* cko1_en = 1 --> CKO1 enabled |
||||
* cko1_div = 111 --> divide by 8 |
||||
* cko1_sel = 1011 --> ahb_clk_root |
||||
* |
||||
* This sets CKO1 at ahb_clk_root/8 = 132/8 = 16.5 MHz |
||||
*/ |
||||
DATA 4 0x020c4060 0x000000fb |
@ -1,6 +1,10 @@ |
||||
MX6QARM2 BOARD |
||||
M: Jason Liu <r64343@freescale.com> |
||||
M: Ye Li <b37916@freescale.com> |
||||
S: Maintained |
||||
F: board/freescale/mx6qarm2/ |
||||
F: include/configs/mx6qarm2.h |
||||
F: configs/mx6qarm2_defconfig |
||||
F: configs/mx6dlarm2_defconfig |
||||
F: configs/mx6qarm2_lpddr2_defconfig |
||||
F: configs/mx6dlarm2_lpddr2_defconfig |
||||
|
@ -0,0 +1,462 @@ |
||||
/* |
||||
* Copyright (C) 2014 Freescale Semiconductor, Inc. |
||||
* Jason Liu <r64343@freescale.com> |
||||
* |
||||
* SPDX-License-Identifier: GPL-2.0+ |
||||
* |
||||
* Refer doc/README.imximage for more details about how-to configure |
||||
* and create imximage boot image |
||||
* |
||||
* The syntax is taken as close as possible with the kwbimage |
||||
*/ |
||||
|
||||
/* image version */ |
||||
IMAGE_VERSION 2 |
||||
|
||||
/* |
||||
* Boot Device : one of |
||||
* spi, sd (the board has no nand neither onenand) |
||||
*/ |
||||
BOOT_FROM sd |
||||
|
||||
/* |
||||
* Device Configuration Data (DCD) |
||||
* |
||||
* Each entry must have the format: |
||||
* Addr-type Address Value |
||||
* |
||||
* where: |
||||
* Addr-type register length (1,2 or 4 bytes) |
||||
* Address absolute address of the register |
||||
* value value to be stored in the register |
||||
*/ |
||||
|
||||
|
||||
|
||||
#ifdef CONFIG_MX6DL_LPDDR2 |
||||
|
||||
/* IOMUX SETTINGS */ |
||||
/* IOMUXC_SW_PAD_CTL_PAD_DRAM_SDQS0 */ |
||||
DATA 4 0x020E04bc 0x00003028 |
||||
/* IOMUXC_SW_PAD_CTL_PAD_DRAM_SDQS1 */ |
||||
DATA 4 0x020E04c0 0x00003028 |
||||
/* IOMUXC_SW_PAD_CTL_PAD_DRAM_SDQS2 */ |
||||
DATA 4 0x020E04c4 0x00003028 |
||||
/* IOMUXC_SW_PAD_CTL_PAD_DRAM_SDQS3 */ |
||||
DATA 4 0x020E04c8 0x00003028 |
||||
/* IOMUXC_SW_PAD_CTL_PAD_DRAM_SDQS4 */ |
||||
DATA 4 0x020E04cc 0x00003028 |
||||
/* IOMUXC_SW_PAD_CTL_PAD_DRAM_SDQS5 */ |
||||
DATA 4 0x020E04d0 0x00003028 |
||||
/* IOMUXC_SW_PAD_CTL_PAD_DRAM_SDQS6 */ |
||||
DATA 4 0x020E04d4 0x00003028 |
||||
/* IOMUXC_SW_PAD_CTL_PAD_DRAM_SDQS7 */ |
||||
DATA 4 0x020E04d8 0x00003028 |
||||
|
||||
/* IOMUXC_SW_PAD_CTL_PAD_DRAM_DQM0 */ |
||||
DATA 4 0x020E0470 0x00000038 |
||||
/* IOMUXC_SW_PAD_CTL_PAD_DRAM_DQM1 */ |
||||
DATA 4 0x020E0474 0x00000038 |
||||
/* IOMUXC_SW_PAD_CTL_PAD_DRAM_DQM2 */ |
||||
DATA 4 0x020E0478 0x00000038 |
||||
/* IOMUXC_SW_PAD_CTL_PAD_DRAM_DQM3 */ |
||||
DATA 4 0x020E047c 0x00000038 |
||||
/* IOMUXC_SW_PAD_CTL_PAD_DRAM_DQM4 */ |
||||
DATA 4 0x020E0480 0x00000038 |
||||
/* IOMUXC_SW_PAD_CTL_PAD_DRAM_DQM5 */ |
||||
DATA 4 0x020E0484 0x00000038 |
||||
/* IOMUXC_SW_PAD_CTL_PAD_DRAM_DQM6 */ |
||||
DATA 4 0x020E0488 0x00000038 |
||||
/* IOMUXC_SW_PAD_CTL_PAD_DRAM_DQM7 */ |
||||
DATA 4 0x020E048c 0x00000038 |
||||
/* IOMUXC_SW_PAD_CTL_PAD_DRAM_CAS */ |
||||
DATA 4 0x020E0464 0x00000038 |
||||
/* IOMUXC_SW_PAD_CTL_PAD_DRAM_RAS */ |
||||
DATA 4 0x020E0490 0x00000038 |
||||
/* IOMUXC_SW_PAD_CTL_PAD_DRAM_SDCLK_0 */ |
||||
DATA 4 0x020E04ac 0x00000038 |
||||
/* IOMUXC_SW_PAD_CTL_PAD_DRAM_SDCLK_1 */ |
||||
DATA 4 0x020E04b0 0x00000038 |
||||
/* IOMUXC_SW_PAD_CTL_PAD_DRAM_RESET */ |
||||
DATA 4 0x020E0494 0x00000038 |
||||
/* IOMUXC_SW_PAD_CTL_PAD_DRAM_SDCKE0 */ |
||||
DATA 4 0x020E04a4 0x00000038 |
||||
/* IOMUXC_SW_PAD_CTL_PAD_DRAM_SDCKE1 */ |
||||
DATA 4 0x020E04a8 0x00000038 |
||||
/* |
||||
* IOMUXC_SW_PAD_CTL_PAD_DRAM_SDBA2 |
||||
* DSE can be configured using Group Control Register: |
||||
* IOMUXC_SW_PAD_CTL_GRP_CTLDS |
||||
*/ |
||||
DATA 4 0x020E04a0 0x00000000 |
||||
/* IOMUXC_SW_PAD_CTL_PAD_DRAM_SDODT0 */ |
||||
DATA 4 0x020E04b4 0x00000038 |
||||
/* IOMUXC_SW_PAD_CTL_PAD_DRAM_SDODT1 */ |
||||
DATA 4 0x020E04b8 0x00000038 |
||||
/* IOMUXC_SW_PAD_CTL_GRP_B0DS */ |
||||
DATA 4 0x020E0764 0x00000038 |
||||
/* IOMUXC_SW_PAD_CTL_GRP_B1DS */ |
||||
DATA 4 0x020E0770 0x00000038 |
||||
/* IOMUXC_SW_PAD_CTL_GRP_B2DS */ |
||||
DATA 4 0x020E0778 0x00000038 |
||||
/* IOMUXC_SW_PAD_CTL_GRP_B3DS */ |
||||
DATA 4 0x020E077c 0x00000038 |
||||
/* IOMUXC_SW_PAD_CTL_GRP_B4DS */ |
||||
DATA 4 0x020E0780 0x00000038 |
||||
/* IOMUXC_SW_PAD_CTL_GRP_B5DS */ |
||||
DATA 4 0x020E0784 0x00000038 |
||||
/* IOMUXC_SW_PAD_CTL_GRP_B6DS */ |
||||
DATA 4 0x020E078c 0x00000038 |
||||
/* IOMUXC_SW_PAD_CTL_GRP_B7DS */ |
||||
DATA 4 0x020E0748 0x00000038 |
||||
/* IOMUXC_SW_PAD_CTL_GRP_ADDDS */ |
||||
DATA 4 0x020E074c 0x00000038 |
||||
/* IOMUXC_SW_PAD_CTL_GRP_CTLDS */ |
||||
DATA 4 0x020E076c 0x00000038 |
||||
/* IOMUXC_SW_PAD_CTL_GRP_DDRMODE_CTL */ |
||||
DATA 4 0x020E0750 0x00020000 |
||||
/* IOMUXC_SW_PAD_CTL_GRP_DDRPKE */ |
||||
DATA 4 0x020E0754 0x00000000 |
||||
/* IOMUXC_SW_PAD_CTL_GRP_DDRMODE */ |
||||
DATA 4 0x020E0760 0x00020000 |
||||
/* IOMUXC_SW_PAD_CTL_GRP_DDR_TYPE */ |
||||
DATA 4 0x020E0774 0x00080000 |
||||
|
||||
/* |
||||
* DDR Controller Registers |
||||
* |
||||
* Manufacturer: Mocron |
||||
* Device Part Number: MT42L64M64D2KH-18 |
||||
* Clock Freq.: 528MHz |
||||
* MMDC channels: Both MMDC0, MMDC1 |
||||
*Density per CS in Gb: 256M |
||||
* Chip Selects used: 2 |
||||
* Number of Banks: 8 |
||||
* Row address: 14 |
||||
* Column address: 9 |
||||
* Data bus width 32 |
||||
*/ |
||||
|
||||
/* MMDC_P0_BASE_ADDR = 0x021b0000 */ |
||||
/* MMDC_P1_BASE_ADDR = 0x021b4000 */ |
||||
|
||||
/* MMDC0_MDSCR, set the Configuration request bit during MMDC set up */ |
||||
DATA 4 0x021b001c 0x00008000 |
||||
|
||||
/* MMDC0_MDSCR, set the Configuration request bit during MMDC set up */ |
||||
DATA 4 0x021b401c 0x00008000 |
||||
|
||||
/*LPDDR2 ZQ params */ |
||||
DATA 4 0x021b085c 0x1b5f01ff |
||||
DATA 4 0x021b485c 0x1b5f01ff |
||||
|
||||
/* Calibration setup. */ |
||||
/* DDR_PHY_P0_MPZQHWCTRL, enable on time ZQ calibration */ |
||||
DATA 4 0x021b0800 0xa1390003 |
||||
|
||||
/*ca bus abs delay */ |
||||
DATA 4 0x021b0890 0x00400000 |
||||
/*ca bus abs delay */ |
||||
DATA 4 0x021b4890 0x00400000 |
||||
/* values of 20,40,50,60,7f tried. no difference seen */ |
||||
|
||||
/* DDR_PHY_P1_MPWRCADL */ |
||||
DATA 4 0x021b48bc 0x00055555 |
||||
|
||||
/*frc_msr.*/ |
||||
DATA 4 0x021b08b8 0x00000800 |
||||
/*frc_msr.*/ |
||||
DATA 4 0x021b48b8 0x00000800 |
||||
|
||||
/* DDR_PHY_P0_MPREDQBY0DL3 */ |
||||
DATA 4 0x021b081c 0x33333333 |
||||
/* DDR_PHY_P0_MPREDQBY1DL3 */ |
||||
DATA 4 0x021b0820 0x33333333 |
||||
/* DDR_PHY_P0_MPREDQBY2DL3 */ |
||||
DATA 4 0x021b0824 0x33333333 |
||||
/* DDR_PHY_P0_MPREDQBY3DL3 */ |
||||
DATA 4 0x021b0828 0x33333333 |
||||
/* DDR_PHY_P1_MPREDQBY0DL3 */ |
||||
DATA 4 0x021b481c 0x33333333 |
||||
/* DDR_PHY_P1_MPREDQBY1DL3 */ |
||||
DATA 4 0x021b4820 0x33333333 |
||||
/* DDR_PHY_P1_MPREDQBY2DL3 */ |
||||
DATA 4 0x021b4824 0x33333333 |
||||
/* DDR_PHY_P1_MPREDQBY3DL3 */ |
||||
DATA 4 0x021b4828 0x33333333 |
||||
|
||||
/* |
||||
* Read and write data delay, per byte. |
||||
* For optimized DDR operation it is recommended to run mmdc_calibration |
||||
* on your board, and replace 4 delay register assigns with resulted values |
||||
* Note: |
||||
* a. DQS gating is not relevant for LPDDR2. DSQ gating calibration section |
||||
* should be skipped, or the write/read calibration comming after that |
||||
* will stall |
||||
* b. The calibration code that runs for both MMDC0 & MMDC1 should be used. |
||||
*/ |
||||
|
||||
DATA 4 0x021b0848 0x4b4b524f |
||||
DATA 4 0x021b4848 0x494f4c44 |
||||
|
||||
DATA 4 0x021b0850 0x3c3d303c |
||||
DATA 4 0x021b4850 0x3c343d38 |
||||
|
||||
/*dqs gating dis */ |
||||
DATA 4 0x021b083c 0x20000000 |
||||
DATA 4 0x021b0840 0x0 |
||||
DATA 4 0x021b483c 0x20000000 |
||||
DATA 4 0x021b4840 0x0 |
||||
|
||||
/*clk delay */ |
||||
DATA 4 0x021b0858 0xa00 |
||||
/*clk delay */ |
||||
DATA 4 0x021b4858 0xa00 |
||||
|
||||
/*frc_msr */ |
||||
DATA 4 0x021b08b8 0x00000800 |
||||
/*frc_msr */ |
||||
DATA 4 0x021b48b8 0x00000800 |
||||
/* Calibration setup end */ |
||||
|
||||
/* Channel0 - startng address 0x80000000 */ |
||||
/* MMDC0_MDCFG0 */ |
||||
DATA 4 0x021b000c 0x34386145 |
||||
|
||||
/* MMDC0_MDPDC */ |
||||
DATA 4 0x021b0004 0x00020036 |
||||
/* MMDC0_MDCFG1 */ |
||||
DATA 4 0x021b0010 0x00100c83 |
||||
/* MMDC0_MDCFG2 */ |
||||
DATA 4 0x021b0014 0x000000Dc |
||||
/* MMDC0_MDMISC */ |
||||
DATA 4 0x021b0018 0x0000174C |
||||
/* MMDC0_MDRWD;*/ |
||||
DATA 4 0x021b002c 0x0f9f26d2 |
||||
/* MMDC0_MDOR */ |
||||
DATA 4 0x021b0030 0x0000020e |
||||
/* MMDC0_MDCFG3LP */ |
||||
DATA 4 0x021b0038 0x00190778 |
||||
/* MMDC0_MDOTC */ |
||||
DATA 4 0x021b0008 0x00000000 |
||||
|
||||
/* CS0_END */ |
||||
DATA 4 0x021b0040 0x0000005f |
||||
/* ROC */ |
||||
DATA 4 0x021b0404 0x0000000f |
||||
|
||||
/* MMDC0_MDCTL */ |
||||
DATA 4 0x021b0000 0xc3010000 |
||||
|
||||
/* Channel1 - starting address 0x10000000 */ |
||||
/* MMDC1_MDCFG0 */ |
||||
DATA 4 0x021b400c 0x34386145 |
||||
|
||||
/* MMDC1_MDPDC */ |
||||
DATA 4 0x021b4004 0x00020036 |
||||
/* MMDC1_MDCFG1 */ |
||||
DATA 4 0x021b4010 0x00100c83 |
||||
/* MMDC1_MDCFG2 */ |
||||
DATA 4 0x021b4014 0x000000Dc |
||||
/* MMDC1_MDMISC */ |
||||
DATA 4 0x021b4018 0x0000174C |
||||
/* MMDC1_MDRWD;*/ |
||||
DATA 4 0x021b402c 0x0f9f26d2 |
||||
/* MMDC1_MDOR */ |
||||
DATA 4 0x021b4030 0x0000020e |
||||
/* MMDC1_MDCFG3LP */ |
||||
DATA 4 0x021b4038 0x00190778 |
||||
/* MMDC1_MDOTC */ |
||||
DATA 4 0x021b4008 0x00000000 |
||||
|
||||
/* CS0_END */ |
||||
DATA 4 0x021b4040 0x0000003f |
||||
|
||||
/* MMDC1_MDCTL */ |
||||
DATA 4 0x021b4000 0xc3010000 |
||||
|
||||
/* Channel0 : Configure DDR device:*/ |
||||
/* MRW: BA=0 CS=0 MR_ADDR=63 MR_OP=0 */ |
||||
DATA 4 0x021b001c 0x003f8030 |
||||
/* MRW: BA=0 CS=0 MR_ADDR=10 MR_OP=ff */ |
||||
DATA 4 0x021b001c 0xff0a8030 |
||||
/* MRW: BA=0 CS=0 MR_ADDR=1 MR_OP=a2 */ |
||||
DATA 4 0x021b001c 0xa2018030 |
||||
/* MRW: BA=0 CS=0 MR_ADDR=2 MR_OP=6. tcl=8, tcwl=4 */ |
||||
DATA 4 0x021b001c 0x06028030 |
||||
/* MRW: BA=0 CS=0 MR_ADDR=3 MR_OP=2.drive=240/6 */ |
||||
DATA 4 0x021b001c 0x01038030 |
||||
|
||||
/* Channel1 : Configure DDR device:*/ |
||||
/* MRW: BA=0 CS=0 MR_ADDR=63 MR_OP=0 */ |
||||
DATA 4 0x021b401c 0x003f8030 |
||||
/* MRW: BA=0 CS=0 MR_ADDR=10 MR_OP=ff */ |
||||
DATA 4 0x021b401c 0xff0a8030 |
||||
/* MRW: BA=0 CS=0 MR_ADDR=1 MR_OP=a2 */ |
||||
DATA 4 0x021b401c 0xa2018030 |
||||
/* MRW: BA=0 CS=0 MR_ADDR=2 MR_OP=6. tcl=8, tcwl=4 */ |
||||
DATA 4 0x021b401c 0x06028030 |
||||
/* MRW: BA=0 CS=0 MR_ADDR=3 MR_OP=2.drive=240/6 */ |
||||
DATA 4 0x021b401c 0x01038030 |
||||
|
||||
/* MMDC0_MDREF */ |
||||
DATA 4 0x021b0020 0x00005800 |
||||
/* MMDC1_MDREF */ |
||||
DATA 4 0x021b4020 0x00005800 |
||||
|
||||
/* DDR_PHY_P0_MPODTCTRL */ |
||||
DATA 4 0x021b0818 0x0 |
||||
/* DDR_PHY_P1_MPODTCTRL */ |
||||
DATA 4 0x021b4818 0x0 |
||||
|
||||
/* |
||||
* calibration values based on calibration compare of 0x00ffff00: |
||||
* Note, these calibration values are based on Freescale's board |
||||
* May need to run calibration on target board to fine tune these |
||||
*/ |
||||
|
||||
/* DDR_PHY_P0_MPZQHWCTRL, enable automatic ZQ calibration */ |
||||
DATA 4 0x021b0800 0xa1310003 |
||||
|
||||
/* DDR_PHY_P0_MPMUR0, frc_msr */ |
||||
DATA 4 0x021b08b8 0x00000800 |
||||
/* DDR_PHY_P1_MPMUR0, frc_msr */ |
||||
DATA 4 0x021b48b8 0x00000800 |
||||
|
||||
/* |
||||
* MMDC0_MDSCR, clear this register |
||||
* (especially the configuration bit as initialization is complete) |
||||
*/ |
||||
DATA 4 0x021b001c 0x00000000 |
||||
/* |
||||
* MMDC0_MDSCR, clear this register |
||||
* (especially the configuration bit as initialization is complete) |
||||
*/ |
||||
DATA 4 0x021b401c 0x00000000 |
||||
|
||||
DATA 4 0x020c4068 0x00C03F3F |
||||
DATA 4 0x020c406c 0x0030FC03 |
||||
DATA 4 0x020c4070 0x0FFFC000 |
||||
DATA 4 0x020c4074 0x3FF00000 |
||||
DATA 4 0x020c4078 0x00FFF300 |
||||
DATA 4 0x020c407c 0x0F0000C3 |
||||
DATA 4 0x020c4080 0x000003FF |
||||
|
||||
DATA 4 0x020e0010 0xF00000CF |
||||
DATA 4 0x020e0018 0x007F007F |
||||
DATA 4 0x020e001c 0x007F007F |
||||
|
||||
#else /* CONFIG_MX6DL_LPDDR2 */ |
||||
|
||||
DATA 4 0x020e0798 0x000c0000 |
||||
DATA 4 0x020e0758 0x00000000 |
||||
DATA 4 0x020e0588 0x00000030 |
||||
DATA 4 0x020e0594 0x00000030 |
||||
DATA 4 0x020e056c 0x00000030 |
||||
DATA 4 0x020e0578 0x00000030 |
||||
DATA 4 0x020e074c 0x00000030 |
||||
DATA 4 0x020e057c 0x00000030 |
||||
DATA 4 0x020e0590 0x00003000 |
||||
DATA 4 0x020e0598 0x00003000 |
||||
DATA 4 0x020e058c 0x00000000 |
||||
DATA 4 0x020e059c 0x00003030 |
||||
DATA 4 0x020e05a0 0x00003030 |
||||
DATA 4 0x020e078c 0x00000030 |
||||
DATA 4 0x020e0750 0x00020000 |
||||
DATA 4 0x020e05a8 0x00000030 |
||||
DATA 4 0x020e05b0 0x00000030 |
||||
DATA 4 0x020e0524 0x00000030 |
||||
DATA 4 0x020e051c 0x00000030 |
||||
DATA 4 0x020e0518 0x00000030 |
||||
DATA 4 0x020e050c 0x00000030 |
||||
DATA 4 0x020e05b8 0x00000030 |
||||
DATA 4 0x020e05c0 0x00000030 |
||||
DATA 4 0x020e0774 0x00020000 |
||||
DATA 4 0x020e0784 0x00000030 |
||||
DATA 4 0x020e0788 0x00000030 |
||||
DATA 4 0x020e0794 0x00000030 |
||||
DATA 4 0x020e079c 0x00000030 |
||||
DATA 4 0x020e07a0 0x00000030 |
||||
DATA 4 0x020e07a4 0x00000030 |
||||
DATA 4 0x020e07a8 0x00000030 |
||||
DATA 4 0x020e0748 0x00000030 |
||||
DATA 4 0x020e05ac 0x00000030 |
||||
DATA 4 0x020e05b4 0x00000030 |
||||
DATA 4 0x020e0528 0x00000030 |
||||
DATA 4 0x020e0520 0x00000030 |
||||
DATA 4 0x020e0514 0x00000030 |
||||
DATA 4 0x020e0510 0x00000030 |
||||
DATA 4 0x020e05bc 0x00000030 |
||||
DATA 4 0x020e05c4 0x00000030 |
||||
|
||||
DATA 4 0x021b0800 0xa1390003 |
||||
DATA 4 0x021b4800 0xa1390003 |
||||
DATA 4 0x021b080c 0x001F001F |
||||
DATA 4 0x021b0810 0x001F001F |
||||
DATA 4 0x021b480c 0x00370037 |
||||
DATA 4 0x021b4810 0x00370037 |
||||
DATA 4 0x021b083c 0x422f0220 |
||||
DATA 4 0x021b0840 0x021f0219 |
||||
DATA 4 0x021b483C 0x422f0220 |
||||
DATA 4 0x021b4840 0x022d022f |
||||
DATA 4 0x021b0848 0x47494b49 |
||||
DATA 4 0x021b4848 0x48484c47 |
||||
DATA 4 0x021b0850 0x39382b2f |
||||
DATA 4 0x021b4850 0x2f35312c |
||||
DATA 4 0x021b081c 0x33333333 |
||||
DATA 4 0x021b0820 0x33333333 |
||||
DATA 4 0x021b0824 0x33333333 |
||||
DATA 4 0x021b0828 0x33333333 |
||||
DATA 4 0x021b481c 0x33333333 |
||||
DATA 4 0x021b4820 0x33333333 |
||||
DATA 4 0x021b4824 0x33333333 |
||||
DATA 4 0x021b4828 0x33333333 |
||||
DATA 4 0x021b08b8 0x00000800 |
||||
DATA 4 0x021b48b8 0x00000800 |
||||
DATA 4 0x021b0004 0x0002002d |
||||
DATA 4 0x021b0008 0x00333030 |
||||
|
||||
DATA 4 0x021b000c 0x40445323 |
||||
DATA 4 0x021b0010 0xb66e8c63 |
||||
|
||||
DATA 4 0x021b0014 0x01ff00db |
||||
DATA 4 0x021b0018 0x00081740 |
||||
DATA 4 0x021b001c 0x00008000 |
||||
DATA 4 0x021b002c 0x000026d2 |
||||
DATA 4 0x021b0030 0x00440e21 |
||||
#ifdef CONFIG_DDR_32BIT |
||||
DATA 4 0x021b0040 0x00000017 |
||||
DATA 4 0x021b0000 0xc3190000 |
||||
#else |
||||
DATA 4 0x021b0040 0x00000027 |
||||
DATA 4 0x021b0000 0xc31a0000 |
||||
#endif |
||||
DATA 4 0x021b001c 0x04008032 |
||||
DATA 4 0x021b001c 0x0400803a |
||||
DATA 4 0x021b001c 0x00008033 |
||||
DATA 4 0x021b001c 0x0000803b |
||||
DATA 4 0x021b001c 0x00428031 |
||||
DATA 4 0x021b001c 0x00428039 |
||||
DATA 4 0x021b001c 0x07208030 |
||||
DATA 4 0x021b001c 0x07208038 |
||||
DATA 4 0x021b001c 0x04008040 |
||||
DATA 4 0x021b001c 0x04008048 |
||||
DATA 4 0x021b0020 0x00005800 |
||||
DATA 4 0x021b0818 0x00000007 |
||||
DATA 4 0x021b4818 0x00000007 |
||||
DATA 4 0x021b0004 0x0002556d |
||||
DATA 4 0x021b4004 0x00011006 |
||||
DATA 4 0x021b001c 0x00000000 |
||||
|
||||
DATA 4 0x020c4068 0x00C03F3F |
||||
DATA 4 0x020c406c 0x0030FC03 |
||||
DATA 4 0x020c4070 0x0FFFC000 |
||||
DATA 4 0x020c4074 0x3FF00000 |
||||
DATA 4 0x020c4078 0x00FFF300 |
||||
DATA 4 0x020c407c 0x0F0000C3 |
||||
DATA 4 0x020c4080 0x000003FF |
||||
|
||||
DATA 4 0x020e0010 0xF00000CF |
||||
DATA 4 0x020e0018 0x007F007F |
||||
DATA 4 0x020e001c 0x007F007F |
||||
#endif /* CONFIG_MX6DL_LPDDR2 */ |
@ -0,0 +1,169 @@ |
||||
/* |
||||
* Copyright (C) 2011 Freescale Semiconductor, Inc. |
||||
* Jason Liu <r64343@freescale.com> |
||||
* |
||||
* SPDX-License-Identifier: GPL-2.0+ |
||||
* |
||||
* Refer doc/README.imximage for more details about how-to configure |
||||
* and create imximage boot image |
||||
* |
||||
* The syntax is taken as close as possible with the kwbimage |
||||
*/ |
||||
|
||||
/* image version */ |
||||
IMAGE_VERSION 2 |
||||
|
||||
/* |
||||
* Boot Device : one of |
||||
* spi, sd (the board has no nand neither onenand) |
||||
*/ |
||||
BOOT_FROM sd |
||||
|
||||
/* |
||||
* Device Configuration Data (DCD) |
||||
* |
||||
* Each entry must have the format: |
||||
* Addr-type Address Value |
||||
* |
||||
* where: |
||||
* Addr-type register length (1,2 or 4 bytes) |
||||
* Address absolute address of the register |
||||
* value value to be stored in the register |
||||
*/ |
||||
DATA 4 0x020e05a8 0x00000030 |
||||
DATA 4 0x020e05b0 0x00000030 |
||||
DATA 4 0x020e0524 0x00000030 |
||||
DATA 4 0x020e051c 0x00000030 |
||||
|
||||
DATA 4 0x020e0518 0x00000030 |
||||
DATA 4 0x020e050c 0x00000030 |
||||
DATA 4 0x020e05b8 0x00000030 |
||||
DATA 4 0x020e05c0 0x00000030 |
||||
|
||||
DATA 4 0x020e05ac 0x00020030 |
||||
DATA 4 0x020e05b4 0x00020030 |
||||
DATA 4 0x020e0528 0x00020030 |
||||
DATA 4 0x020e0520 0x00020030 |
||||
|
||||
DATA 4 0x020e0514 0x00020030 |
||||
DATA 4 0x020e0510 0x00020030 |
||||
DATA 4 0x020e05bc 0x00020030 |
||||
DATA 4 0x020e05c4 0x00020030 |
||||
|
||||
DATA 4 0x020e056c 0x00020030 |
||||
DATA 4 0x020e0578 0x00020030 |
||||
DATA 4 0x020e0588 0x00020030 |
||||
DATA 4 0x020e0594 0x00020030 |
||||
|
||||
DATA 4 0x020e057c 0x00020030 |
||||
DATA 4 0x020e0590 0x00003000 |
||||
DATA 4 0x020e0598 0x00003000 |
||||
DATA 4 0x020e058c 0x00000000 |
||||
|
||||
DATA 4 0x020e059c 0x00003030 |
||||
DATA 4 0x020e05a0 0x00003030 |
||||
DATA 4 0x020e0784 0x00000030 |
||||
DATA 4 0x020e0788 0x00000030 |
||||
|
||||
DATA 4 0x020e0794 0x00000030 |
||||
DATA 4 0x020e079c 0x00000030 |
||||
DATA 4 0x020e07a0 0x00000030 |
||||
DATA 4 0x020e07a4 0x00000030 |
||||
|
||||
DATA 4 0x020e07a8 0x00000030 |
||||
DATA 4 0x020e0748 0x00000030 |
||||
DATA 4 0x020e074c 0x00000030 |
||||
DATA 4 0x020e0750 0x00020000 |
||||
|
||||
DATA 4 0x020e0758 0x00000000 |
||||
DATA 4 0x020e0774 0x00020000 |
||||
DATA 4 0x020e078c 0x00000030 |
||||
DATA 4 0x020e0798 0x000C0000 |
||||
|
||||
DATA 4 0x021b081c 0x33333333 |
||||
DATA 4 0x021b0820 0x33333333 |
||||
DATA 4 0x021b0824 0x33333333 |
||||
DATA 4 0x021b0828 0x33333333 |
||||
|
||||
DATA 4 0x021b481c 0x33333333 |
||||
DATA 4 0x021b4820 0x33333333 |
||||
DATA 4 0x021b4824 0x33333333 |
||||
DATA 4 0x021b4828 0x33333333 |
||||
|
||||
DATA 4 0x021b0018 0x00081740 |
||||
|
||||
DATA 4 0x021b001c 0x00008000 |
||||
DATA 4 0x021b000c 0x555A7974 |
||||
DATA 4 0x021b0010 0xDB538F64 |
||||
DATA 4 0x021b0014 0x01FF00DB |
||||
DATA 4 0x021b002c 0x000026D2 |
||||
|
||||
DATA 4 0x021b0030 0x005A1023 |
||||
DATA 4 0x021b0008 0x09444040 |
||||
DATA 4 0x021b0004 0x00025576 |
||||
DATA 4 0x021b0040 0x00000027 |
||||
DATA 4 0x021b0000 0x831A0000 |
||||
|
||||
DATA 4 0x021b001c 0x04088032 |
||||
DATA 4 0x021b001c 0x0408803A |
||||
DATA 4 0x021b001c 0x00008033 |
||||
DATA 4 0x021b001c 0x0000803B |
||||
DATA 4 0x021b001c 0x00428031 |
||||
DATA 4 0x021b001c 0x00428039 |
||||
DATA 4 0x021b001c 0x19308030 |
||||
DATA 4 0x021b001c 0x19308038 |
||||
|
||||
DATA 4 0x021b001c 0x04008040 |
||||
DATA 4 0x021b001c 0x04008048 |
||||
DATA 4 0x021b0800 0xA1380003 |
||||
DATA 4 0x021b4800 0xA1380003 |
||||
DATA 4 0x021b0020 0x00005800 |
||||
DATA 4 0x021b0818 0x00022227 |
||||
DATA 4 0x021b4818 0x00022227 |
||||
|
||||
DATA 4 0x021b083c 0x434B0350 |
||||
DATA 4 0x021b0840 0x034C0359 |
||||
DATA 4 0x021b483c 0x434B0350 |
||||
DATA 4 0x021b4840 0x03650348 |
||||
DATA 4 0x021b0848 0x4436383B |
||||
DATA 4 0x021b4848 0x39393341 |
||||
DATA 4 0x021b0850 0x35373933 |
||||
DATA 4 0x021b4850 0x48254A36 |
||||
|
||||
DATA 4 0x021b080c 0x001F001F |
||||
DATA 4 0x021b0810 0x001F001F |
||||
|
||||
DATA 4 0x021b480c 0x00440044 |
||||
DATA 4 0x021b4810 0x00440044 |
||||
|
||||
DATA 4 0x021b08b8 0x00000800 |
||||
DATA 4 0x021b48b8 0x00000800 |
||||
|
||||
DATA 4 0x021b001c 0x00000000 |
||||
DATA 4 0x021b0404 0x00011006 |
||||
|
||||
/* set the default clock gate to save power */ |
||||
DATA 4 0x020c4068 0x00C03F3F |
||||
DATA 4 0x020c406c 0x0030FC03 |
||||
DATA 4 0x020c4070 0x0FFFC000 |
||||
DATA 4 0x020c4074 0x3FF00000 |
||||
DATA 4 0x020c4078 0x00FFF300 |
||||
DATA 4 0x020c407c 0x0F0000C3 |
||||
DATA 4 0x020c4080 0x000003FF |
||||
|
||||
/* enable AXI cache for VDOA/VPU/IPU */ |
||||
DATA 4 0x020e0010 0xF00000CF |
||||
/* set IPU AXI-id0 Qos=0xf(bypass) AXI-id1 Qos=0x7 */ |
||||
DATA 4 0x020e0018 0x007F007F |
||||
DATA 4 0x020e001c 0x007F007F |
||||
|
||||
/* |
||||
* Setup CCM_CCOSR register as follows: |
||||
* |
||||
* cko1_en = 1 --> CKO1 enabled |
||||
* cko1_div = 111 --> divide by 8 |
||||
* cko1_sel = 1011 --> ahb_clk_root |
||||
* |
||||
* This sets CKO1 at ahb_clk_root/8 = 132/8 = 16.5 MHz |
||||
*/ |
||||
DATA 4 0x020c4060 0x000000fb |
File diff suppressed because it is too large
Load Diff
@ -1,3 +1,3 @@ |
||||
CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=board/freescale/imx/ddr/mx6q_4x_mt41j128.cfg,MX6Q" |
||||
CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=board/congatec/cgtqmx6eval/imximage.cfg,MX6Q" |
||||
CONFIG_ARM=y |
||||
CONFIG_TARGET_CGTQMX6EVAL=y |
||||
|
@ -0,0 +1,3 @@ |
||||
CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=board/freescale/mx6qarm2/imximage_mx6dl.cfg,MX6DL,DDR_MB=2048" |
||||
CONFIG_ARM=y |
||||
CONFIG_TARGET_MX6QARM2=y |
@ -0,0 +1,3 @@ |
||||
CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=board/freescale/mx6qarm2/imximage_mx6dl.cfg,MX6DL,MX6DL_LPDDR2,DDR_MB=512" |
||||
CONFIG_ARM=y |
||||
CONFIG_TARGET_MX6QARM2=y |
@ -1,3 +1,3 @@ |
||||
CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=board/freescale/mx6qarm2/imximage.cfg" |
||||
CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=board/freescale/mx6qarm2/imximage.cfg,MX6Q,DDR_MB=2048" |
||||
CONFIG_ARM=y |
||||
CONFIG_TARGET_MX6QARM2=y |
||||
|
@ -0,0 +1,3 @@ |
||||
CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=board/freescale/mx6qarm2/imximage.cfg,MX6Q,MX6DQ_LPDDR2,DDR_MB=512" |
||||
CONFIG_ARM=y |
||||
CONFIG_TARGET_MX6QARM2=y |
@ -1,3 +1,3 @@ |
||||
CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=board/freescale/imx/ddr/mx6q_4x_mt41j128.cfg,MX6Q" |
||||
CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=board/freescale/mx6sabresd/mx6q_4x_mt41j128.cfg,MX6Q" |
||||
CONFIG_ARM=y |
||||
CONFIG_TARGET_MX6SABRESD=y |
||||
|
@ -0,0 +1,3 @@ |
||||
CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=board/bachmann/ot1200/mx6q_4x_mt41j128.cfg,MX6Q" |
||||
CONFIG_ARM=y |
||||
CONFIG_TARGET_OT1200=y |
@ -1,2 +1,4 @@ |
||||
CONFIG_ARM=y |
||||
CONFIG_ARCH_S5PC1XX=y |
||||
CONFIG_TARGET_S5P_GONI=y |
||||
CONFIG_DEFAULT_DEVICE_TREE="s5pc1xx-goni" |
||||
|
@ -1,2 +1,4 @@ |
||||
CONFIG_ARM=y |
||||
CONFIG_TARGET_SMDKC100=y |
||||
CONFIG_ARCH_S5PC1XX=y |
||||
CONFIG_DEFAULT_DEVICE_TREE="s5pc1xx-smdkc100" |
||||
|
@ -1,3 +1,3 @@ |
||||
CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=board/freescale/vf610twr/imximage.cfg" |
||||
CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=board/freescale/vf610twr/imximage.cfg,ENV_IS_IN_MMC" |
||||
CONFIG_ARM=y |
||||
CONFIG_TARGET_VF610TWR=y |
||||
|
@ -0,0 +1,3 @@ |
||||
CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=board/freescale/vf610twr/imximage.cfg,ENV_IS_IN_NAND" |
||||
CONFIG_ARM=y |
||||
CONFIG_TARGET_VF610TWR=y |
@ -0,0 +1,724 @@ |
||||
/*
|
||||
* Copyright 2009-2014 Freescale Semiconductor, Inc. and others |
||||
* |
||||
* Description: MPC5125, VF610, MCF54418 and Kinetis K70 Nand driver. |
||||
* Ported to U-Boot by Stefan Agner |
||||
* Based on RFC driver posted on Kernel Mailing list by Bill Pringlemeir |
||||
* Jason ported to M54418TWR and MVFA5. |
||||
* Authors: Stefan Agner <stefan.agner@toradex.com> |
||||
* Bill Pringlemeir <bpringlemeir@nbsps.com> |
||||
* Shaohui Xie <b21989@freescale.com> |
||||
* Jason Jin <Jason.jin@freescale.com> |
||||
* |
||||
* Based on original driver mpc5121_nfc.c. |
||||
* |
||||
* This 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. |
||||
* |
||||
* Limitations: |
||||
* - Untested on MPC5125 and M54418. |
||||
* - DMA not used. |
||||
* - 2K pages or less. |
||||
* - Only 2K page w. 64+OOB and hardware ECC. |
||||
*/ |
||||
|
||||
#include <common.h> |
||||
#include <malloc.h> |
||||
|
||||
#include <linux/mtd/mtd.h> |
||||
#include <linux/mtd/nand.h> |
||||
#include <linux/mtd/partitions.h> |
||||
|
||||
#include <nand.h> |
||||
#include <errno.h> |
||||
#include <asm/io.h> |
||||
|
||||
/* Register Offsets */ |
||||
#define NFC_FLASH_CMD1 0x3F00 |
||||
#define NFC_FLASH_CMD2 0x3F04 |
||||
#define NFC_COL_ADDR 0x3F08 |
||||
#define NFC_ROW_ADDR 0x3F0c |
||||
#define NFC_ROW_ADDR_INC 0x3F14 |
||||
#define NFC_FLASH_STATUS1 0x3F18 |
||||
#define NFC_FLASH_STATUS2 0x3F1c |
||||
#define NFC_CACHE_SWAP 0x3F28 |
||||
#define NFC_SECTOR_SIZE 0x3F2c |
||||
#define NFC_FLASH_CONFIG 0x3F30 |
||||
#define NFC_IRQ_STATUS 0x3F38 |
||||
|
||||
/* Addresses for NFC MAIN RAM BUFFER areas */ |
||||
#define NFC_MAIN_AREA(n) ((n) * 0x1000) |
||||
|
||||
#define PAGE_2K 0x0800 |
||||
#define OOB_64 0x0040 |
||||
|
||||
/*
|
||||
* NFC_CMD2[CODE] values. See section: |
||||
* - 31.4.7 Flash Command Code Description, Vybrid manual |
||||
* - 23.8.6 Flash Command Sequencer, MPC5125 manual |
||||
* |
||||
* Briefly these are bitmasks of controller cycles. |
||||
*/ |
||||
#define READ_PAGE_CMD_CODE 0x7EE0 |
||||
#define PROGRAM_PAGE_CMD_CODE 0x7FC0 |
||||
#define ERASE_CMD_CODE 0x4EC0 |
||||
#define READ_ID_CMD_CODE 0x4804 |
||||
#define RESET_CMD_CODE 0x4040 |
||||
#define STATUS_READ_CMD_CODE 0x4068 |
||||
|
||||
/* NFC ECC mode define */ |
||||
#define ECC_BYPASS 0 |
||||
#define ECC_45_BYTE 6 |
||||
|
||||
/*** Register Mask and bit definitions */ |
||||
|
||||
/* NFC_FLASH_CMD1 Field */ |
||||
#define CMD_BYTE2_MASK 0xFF000000 |
||||
#define CMD_BYTE2_SHIFT 24 |
||||
|
||||
/* NFC_FLASH_CM2 Field */ |
||||
#define CMD_BYTE1_MASK 0xFF000000 |
||||
#define CMD_BYTE1_SHIFT 24 |
||||
#define CMD_CODE_MASK 0x00FFFF00 |
||||
#define CMD_CODE_SHIFT 8 |
||||
#define BUFNO_MASK 0x00000006 |
||||
#define BUFNO_SHIFT 1 |
||||
#define START_BIT (1<<0) |
||||
|
||||
/* NFC_COL_ADDR Field */ |
||||
#define COL_ADDR_MASK 0x0000FFFF |
||||
#define COL_ADDR_SHIFT 0 |
||||
|
||||
/* NFC_ROW_ADDR Field */ |
||||
#define ROW_ADDR_MASK 0x00FFFFFF |
||||
#define ROW_ADDR_SHIFT 0 |
||||
#define ROW_ADDR_CHIP_SEL_RB_MASK 0xF0000000 |
||||
#define ROW_ADDR_CHIP_SEL_RB_SHIFT 28 |
||||
#define ROW_ADDR_CHIP_SEL_MASK 0x0F000000 |
||||
#define ROW_ADDR_CHIP_SEL_SHIFT 24 |
||||
|
||||
/* NFC_FLASH_STATUS2 Field */ |
||||
#define STATUS_BYTE1_MASK 0x000000FF |
||||
|
||||
/* NFC_FLASH_CONFIG Field */ |
||||
#define CONFIG_ECC_SRAM_ADDR_MASK 0x7FC00000 |
||||
#define CONFIG_ECC_SRAM_ADDR_SHIFT 22 |
||||
#define CONFIG_ECC_SRAM_REQ_BIT (1<<21) |
||||
#define CONFIG_DMA_REQ_BIT (1<<20) |
||||
#define CONFIG_ECC_MODE_MASK 0x000E0000 |
||||
#define CONFIG_ECC_MODE_SHIFT 17 |
||||
#define CONFIG_FAST_FLASH_BIT (1<<16) |
||||
#define CONFIG_16BIT (1<<7) |
||||
#define CONFIG_BOOT_MODE_BIT (1<<6) |
||||
#define CONFIG_ADDR_AUTO_INCR_BIT (1<<5) |
||||
#define CONFIG_BUFNO_AUTO_INCR_BIT (1<<4) |
||||
#define CONFIG_PAGE_CNT_MASK 0xF |
||||
#define CONFIG_PAGE_CNT_SHIFT 0 |
||||
|
||||
/* NFC_IRQ_STATUS Field */ |
||||
#define IDLE_IRQ_BIT (1<<29) |
||||
#define IDLE_EN_BIT (1<<20) |
||||
#define CMD_DONE_CLEAR_BIT (1<<18) |
||||
#define IDLE_CLEAR_BIT (1<<17) |
||||
|
||||
#define NFC_TIMEOUT (1000) |
||||
|
||||
/* ECC status placed at end of buffers. */ |
||||
#define ECC_SRAM_ADDR ((PAGE_2K+256-8) >> 3) |
||||
#define ECC_STATUS_MASK 0x80 |
||||
#define ECC_ERR_COUNT 0x3F |
||||
|
||||
/*
|
||||
* ECC status is stored at NFC_CFG[ECCADD] +4 for little-endian |
||||
* and +7 for big-endian SOC. |
||||
*/ |
||||
#ifdef CONFIG_VF610 |
||||
#define ECC_OFFSET 4 |
||||
#else |
||||
#define ECC_OFFSET 7 |
||||
#endif |
||||
|
||||
struct vf610_nfc { |
||||
struct mtd_info *mtd; |
||||
struct nand_chip chip; |
||||
void __iomem *regs; |
||||
uint column; |
||||
int spareonly; |
||||
int page; |
||||
/* Status and ID are in alternate locations. */ |
||||
int alt_buf; |
||||
#define ALT_BUF_ID 1 |
||||
#define ALT_BUF_STAT 2 |
||||
struct clk *clk; |
||||
}; |
||||
|
||||
#define mtd_to_nfc(_mtd) \ |
||||
(struct vf610_nfc *)((struct nand_chip *)_mtd->priv)->priv |
||||
|
||||
static u8 bbt_pattern[] = {'B', 'b', 't', '0' }; |
||||
static u8 mirror_pattern[] = {'1', 't', 'b', 'B' }; |
||||
|
||||
static struct nand_bbt_descr bbt_main_descr = { |
||||
.options = NAND_BBT_LASTBLOCK | NAND_BBT_CREATE | NAND_BBT_WRITE | |
||||
NAND_BBT_2BIT | NAND_BBT_VERSION, |
||||
.offs = 11, |
||||
.len = 4, |
||||
.veroffs = 15, |
||||
.maxblocks = 4, |
||||
.pattern = bbt_pattern, |
||||
}; |
||||
|
||||
static struct nand_bbt_descr bbt_mirror_descr = { |
||||
.options = NAND_BBT_LASTBLOCK | NAND_BBT_CREATE | NAND_BBT_WRITE | |
||||
NAND_BBT_2BIT | NAND_BBT_VERSION, |
||||
.offs = 11, |
||||
.len = 4, |
||||
.veroffs = 15, |
||||
.maxblocks = 4, |
||||
.pattern = mirror_pattern, |
||||
}; |
||||
|
||||
static struct nand_ecclayout vf610_nfc_ecc45 = { |
||||
.eccbytes = 45, |
||||
.eccpos = {19, 20, 21, 22, 23, |
||||
24, 25, 26, 27, 28, 29, 30, 31, |
||||
32, 33, 34, 35, 36, 37, 38, 39, |
||||
40, 41, 42, 43, 44, 45, 46, 47, |
||||
48, 49, 50, 51, 52, 53, 54, 55, |
||||
56, 57, 58, 59, 60, 61, 62, 63}, |
||||
.oobfree = { |
||||
{.offset = 8, |
||||
.length = 11} } |
||||
}; |
||||
|
||||
static inline u32 vf610_nfc_read(struct mtd_info *mtd, uint reg) |
||||
{ |
||||
struct vf610_nfc *nfc = mtd_to_nfc(mtd); |
||||
|
||||
return readl(nfc->regs + reg); |
||||
} |
||||
|
||||
static inline void vf610_nfc_write(struct mtd_info *mtd, uint reg, u32 val) |
||||
{ |
||||
struct vf610_nfc *nfc = mtd_to_nfc(mtd); |
||||
|
||||
writel(val, nfc->regs + reg); |
||||
} |
||||
|
||||
static inline void vf610_nfc_set(struct mtd_info *mtd, uint reg, u32 bits) |
||||
{ |
||||
vf610_nfc_write(mtd, reg, vf610_nfc_read(mtd, reg) | bits); |
||||
} |
||||
|
||||
static inline void vf610_nfc_clear(struct mtd_info *mtd, uint reg, u32 bits) |
||||
{ |
||||
vf610_nfc_write(mtd, reg, vf610_nfc_read(mtd, reg) & ~bits); |
||||
} |
||||
|
||||
static inline void vf610_nfc_set_field(struct mtd_info *mtd, u32 reg, |
||||
u32 mask, u32 shift, u32 val) |
||||
{ |
||||
vf610_nfc_write(mtd, reg, |
||||
(vf610_nfc_read(mtd, reg) & (~mask)) | val << shift); |
||||
} |
||||
|
||||
static inline void vf610_nfc_memcpy(void *dst, const void *src, size_t n) |
||||
{ |
||||
/*
|
||||
* Use this accessor for the interal SRAM buffers. On ARM we can |
||||
* treat the SRAM buffer as if its memory, hence use memcpy |
||||
*/ |
||||
memcpy(dst, src, n); |
||||
} |
||||
|
||||
/* Clear flags for upcoming command */ |
||||
static inline void vf610_nfc_clear_status(void __iomem *regbase) |
||||
{ |
||||
void __iomem *reg = regbase + NFC_IRQ_STATUS; |
||||
u32 tmp = __raw_readl(reg); |
||||
tmp |= CMD_DONE_CLEAR_BIT | IDLE_CLEAR_BIT; |
||||
__raw_writel(tmp, reg); |
||||
} |
||||
|
||||
/* Wait for complete operation */ |
||||
static inline void vf610_nfc_done(struct mtd_info *mtd) |
||||
{ |
||||
struct vf610_nfc *nfc = mtd_to_nfc(mtd); |
||||
uint start; |
||||
|
||||
/*
|
||||
* Barrier is needed after this write. This write need |
||||
* to be done before reading the next register the first |
||||
* time. |
||||
* vf610_nfc_set implicates such a barrier by using writel |
||||
* to write to the register. |
||||
*/ |
||||
vf610_nfc_set(mtd, NFC_FLASH_CMD2, START_BIT); |
||||
|
||||
start = get_timer(0); |
||||
|
||||
while (!(vf610_nfc_read(mtd, NFC_IRQ_STATUS) & IDLE_IRQ_BIT)) { |
||||
if (get_timer(start) > NFC_TIMEOUT) { |
||||
printf("Timeout while waiting for !BUSY.\n"); |
||||
return; |
||||
} |
||||
} |
||||
vf610_nfc_clear_status(nfc->regs); |
||||
} |
||||
|
||||
static u8 vf610_nfc_get_id(struct mtd_info *mtd, int col) |
||||
{ |
||||
u32 flash_id; |
||||
|
||||
if (col < 4) { |
||||
flash_id = vf610_nfc_read(mtd, NFC_FLASH_STATUS1); |
||||
return (flash_id >> (3-col)*8) & 0xff; |
||||
} else { |
||||
flash_id = vf610_nfc_read(mtd, NFC_FLASH_STATUS2); |
||||
return flash_id >> 24; |
||||
} |
||||
} |
||||
|
||||
static u8 vf610_nfc_get_status(struct mtd_info *mtd) |
||||
{ |
||||
return vf610_nfc_read(mtd, NFC_FLASH_STATUS2) & STATUS_BYTE1_MASK; |
||||
} |
||||
|
||||
/* Single command */ |
||||
static void vf610_nfc_send_command(void __iomem *regbase, u32 cmd_byte1, |
||||
u32 cmd_code) |
||||
{ |
||||
void __iomem *reg = regbase + NFC_FLASH_CMD2; |
||||
u32 tmp; |
||||
vf610_nfc_clear_status(regbase); |
||||
|
||||
tmp = __raw_readl(reg); |
||||
tmp &= ~(CMD_BYTE1_MASK | CMD_CODE_MASK | BUFNO_MASK); |
||||
tmp |= cmd_byte1 << CMD_BYTE1_SHIFT; |
||||
tmp |= cmd_code << CMD_CODE_SHIFT; |
||||
__raw_writel(tmp, reg); |
||||
} |
||||
|
||||
/* Two commands */ |
||||
static void vf610_nfc_send_commands(void __iomem *regbase, u32 cmd_byte1, |
||||
u32 cmd_byte2, u32 cmd_code) |
||||
{ |
||||
void __iomem *reg = regbase + NFC_FLASH_CMD1; |
||||
u32 tmp; |
||||
vf610_nfc_send_command(regbase, cmd_byte1, cmd_code); |
||||
|
||||
tmp = __raw_readl(reg); |
||||
tmp &= ~CMD_BYTE2_MASK; |
||||
tmp |= cmd_byte2 << CMD_BYTE2_SHIFT; |
||||
__raw_writel(tmp, reg); |
||||
} |
||||
|
||||
static void vf610_nfc_addr_cycle(struct mtd_info *mtd, int column, int page) |
||||
{ |
||||
if (column != -1) { |
||||
struct vf610_nfc *nfc = mtd_to_nfc(mtd); |
||||
if (nfc->chip.options | NAND_BUSWIDTH_16) |
||||
column = column/2; |
||||
vf610_nfc_set_field(mtd, NFC_COL_ADDR, COL_ADDR_MASK, |
||||
COL_ADDR_SHIFT, column); |
||||
} |
||||
if (page != -1) |
||||
vf610_nfc_set_field(mtd, NFC_ROW_ADDR, ROW_ADDR_MASK, |
||||
ROW_ADDR_SHIFT, page); |
||||
} |
||||
|
||||
/* Send command to NAND chip */ |
||||
static void vf610_nfc_command(struct mtd_info *mtd, unsigned command, |
||||
int column, int page) |
||||
{ |
||||
struct vf610_nfc *nfc = mtd_to_nfc(mtd); |
||||
|
||||
nfc->column = max(column, 0); |
||||
nfc->spareonly = 0; |
||||
nfc->alt_buf = 0; |
||||
|
||||
switch (command) { |
||||
case NAND_CMD_PAGEPROG: |
||||
nfc->page = -1; |
||||
vf610_nfc_send_commands(nfc->regs, NAND_CMD_SEQIN, |
||||
command, PROGRAM_PAGE_CMD_CODE); |
||||
vf610_nfc_addr_cycle(mtd, column, page); |
||||
break; |
||||
|
||||
case NAND_CMD_RESET: |
||||
vf610_nfc_send_command(nfc->regs, command, RESET_CMD_CODE); |
||||
break; |
||||
/*
|
||||
* NFC does not support sub-page reads and writes, |
||||
* so emulate them using full page transfers. |
||||
*/ |
||||
case NAND_CMD_READOOB: |
||||
nfc->spareonly = 1; |
||||
case NAND_CMD_SEQIN: /* Pre-read for partial writes. */ |
||||
case NAND_CMD_READ0: |
||||
column = 0; |
||||
/* Already read? */ |
||||
if (nfc->page == page) |
||||
return; |
||||
nfc->page = page; |
||||
vf610_nfc_send_commands(nfc->regs, NAND_CMD_READ0, |
||||
NAND_CMD_READSTART, READ_PAGE_CMD_CODE); |
||||
vf610_nfc_addr_cycle(mtd, column, page); |
||||
break; |
||||
|
||||
case NAND_CMD_ERASE1: |
||||
if (nfc->page == page) |
||||
nfc->page = -1; |
||||
vf610_nfc_send_commands(nfc->regs, command, |
||||
NAND_CMD_ERASE2, ERASE_CMD_CODE); |
||||
vf610_nfc_addr_cycle(mtd, column, page); |
||||
break; |
||||
|
||||
case NAND_CMD_READID: |
||||
nfc->alt_buf = ALT_BUF_ID; |
||||
vf610_nfc_send_command(nfc->regs, command, READ_ID_CMD_CODE); |
||||
break; |
||||
|
||||
case NAND_CMD_STATUS: |
||||
nfc->alt_buf = ALT_BUF_STAT; |
||||
vf610_nfc_send_command(nfc->regs, command, |
||||
STATUS_READ_CMD_CODE); |
||||
break; |
||||
default: |
||||
return; |
||||
} |
||||
|
||||
vf610_nfc_done(mtd); |
||||
} |
||||
|
||||
static inline void vf610_nfc_read_spare(struct mtd_info *mtd, void *buf, |
||||
int len) |
||||
{ |
||||
struct vf610_nfc *nfc = mtd_to_nfc(mtd); |
||||
|
||||
len = min(mtd->oobsize, (uint)len); |
||||
if (len > 0) |
||||
vf610_nfc_memcpy(buf, nfc->regs + mtd->writesize, len); |
||||
} |
||||
|
||||
/* Read data from NFC buffers */ |
||||
static void vf610_nfc_read_buf(struct mtd_info *mtd, u_char *buf, int len) |
||||
{ |
||||
struct vf610_nfc *nfc = mtd_to_nfc(mtd); |
||||
uint c = nfc->column; |
||||
uint l; |
||||
|
||||
/* Handle main area */ |
||||
if (!nfc->spareonly) { |
||||
l = min((uint)len, mtd->writesize - c); |
||||
nfc->column += l; |
||||
|
||||
if (!nfc->alt_buf) |
||||
vf610_nfc_memcpy(buf, nfc->regs + NFC_MAIN_AREA(0) + c, |
||||
l); |
||||
else |
||||
if (nfc->alt_buf & ALT_BUF_ID) |
||||
*buf = vf610_nfc_get_id(mtd, c); |
||||
else |
||||
*buf = vf610_nfc_get_status(mtd); |
||||
|
||||
buf += l; |
||||
len -= l; |
||||
} |
||||
|
||||
/* Handle spare area access */ |
||||
if (len) { |
||||
nfc->column += len; |
||||
vf610_nfc_read_spare(mtd, buf, len); |
||||
} |
||||
} |
||||
|
||||
/* Write data to NFC buffers */ |
||||
static void vf610_nfc_write_buf(struct mtd_info *mtd, const u_char *buf, |
||||
int len) |
||||
{ |
||||
struct vf610_nfc *nfc = mtd_to_nfc(mtd); |
||||
uint c = nfc->column; |
||||
uint l; |
||||
|
||||
l = min((uint)len, mtd->writesize + mtd->oobsize - c); |
||||
nfc->column += l; |
||||
vf610_nfc_memcpy(nfc->regs + NFC_MAIN_AREA(0) + c, buf, l); |
||||
} |
||||
|
||||
/* Read byte from NFC buffers */ |
||||
static u8 vf610_nfc_read_byte(struct mtd_info *mtd) |
||||
{ |
||||
u8 tmp; |
||||
vf610_nfc_read_buf(mtd, &tmp, sizeof(tmp)); |
||||
return tmp; |
||||
} |
||||
|
||||
/* Read word from NFC buffers */ |
||||
static u16 vf610_nfc_read_word(struct mtd_info *mtd) |
||||
{ |
||||
u16 tmp; |
||||
vf610_nfc_read_buf(mtd, (u_char *)&tmp, sizeof(tmp)); |
||||
return tmp; |
||||
} |
||||
|
||||
/* If not provided, upper layers apply a fixed delay. */ |
||||
static int vf610_nfc_dev_ready(struct mtd_info *mtd) |
||||
{ |
||||
/* NFC handles R/B internally; always ready. */ |
||||
return 1; |
||||
} |
||||
|
||||
/*
|
||||
* This function supports Vybrid only (MPC5125 would have full RB and four CS) |
||||
*/ |
||||
static void vf610_nfc_select_chip(struct mtd_info *mtd, int chip) |
||||
{ |
||||
#ifdef CONFIG_VF610 |
||||
u32 tmp = vf610_nfc_read(mtd, NFC_ROW_ADDR); |
||||
tmp &= ~(ROW_ADDR_CHIP_SEL_RB_MASK | ROW_ADDR_CHIP_SEL_MASK); |
||||
tmp |= 1 << ROW_ADDR_CHIP_SEL_RB_SHIFT; |
||||
|
||||
if (chip == 0) |
||||
tmp |= 1 << ROW_ADDR_CHIP_SEL_SHIFT; |
||||
else if (chip == 1) |
||||
tmp |= 2 << ROW_ADDR_CHIP_SEL_SHIFT; |
||||
|
||||
vf610_nfc_write(mtd, NFC_ROW_ADDR, tmp); |
||||
#endif |
||||
} |
||||
|
||||
/* Count the number of 0's in buff upto max_bits */ |
||||
static inline int count_written_bits(uint8_t *buff, int size, int max_bits) |
||||
{ |
||||
uint32_t *buff32 = (uint32_t *)buff; |
||||
int k, written_bits = 0; |
||||
|
||||
for (k = 0; k < (size / 4); k++) { |
||||
written_bits += hweight32(~buff32[k]); |
||||
if (written_bits > max_bits) |
||||
break; |
||||
} |
||||
|
||||
return written_bits; |
||||
} |
||||
|
||||
static inline int vf610_nfc_correct_data(struct mtd_info *mtd, u_char *dat) |
||||
{ |
||||
struct vf610_nfc *nfc = mtd_to_nfc(mtd); |
||||
u8 ecc_status; |
||||
u8 ecc_count; |
||||
int flip; |
||||
|
||||
ecc_status = __raw_readb(nfc->regs + ECC_SRAM_ADDR * 8 + ECC_OFFSET); |
||||
ecc_count = ecc_status & ECC_ERR_COUNT; |
||||
if (!(ecc_status & ECC_STATUS_MASK)) |
||||
return ecc_count; |
||||
|
||||
/* If 'ecc_count' zero or less then buffer is all 0xff or erased. */ |
||||
flip = count_written_bits(dat, nfc->chip.ecc.size, ecc_count); |
||||
|
||||
/* ECC failed. */ |
||||
if (flip > ecc_count) { |
||||
nfc->page = -1; |
||||
return -1; |
||||
} |
||||
|
||||
/* Erased page. */ |
||||
memset(dat, 0xff, nfc->chip.ecc.size); |
||||
return 0; |
||||
} |
||||
|
||||
|
||||
static int vf610_nfc_read_page(struct mtd_info *mtd, struct nand_chip *chip, |
||||
uint8_t *buf, int oob_required, int page) |
||||
{ |
||||
int eccsize = chip->ecc.size; |
||||
int stat; |
||||
uint8_t *p = buf; |
||||
|
||||
|
||||
vf610_nfc_read_buf(mtd, p, eccsize); |
||||
|
||||
if (oob_required) |
||||
vf610_nfc_read_buf(mtd, chip->oob_poi, mtd->oobsize); |
||||
|
||||
stat = vf610_nfc_correct_data(mtd, p); |
||||
|
||||
if (stat < 0) |
||||
mtd->ecc_stats.failed++; |
||||
else |
||||
mtd->ecc_stats.corrected += stat; |
||||
|
||||
return 0; |
||||
} |
||||
|
||||
/*
|
||||
* ECC will be calculated automatically |
||||
*/ |
||||
static int vf610_nfc_write_page(struct mtd_info *mtd, struct nand_chip *chip, |
||||
const uint8_t *buf, int oob_required) |
||||
{ |
||||
vf610_nfc_write_buf(mtd, buf, mtd->writesize); |
||||
if (oob_required) |
||||
vf610_nfc_write_buf(mtd, chip->oob_poi, mtd->oobsize); |
||||
|
||||
return 0; |
||||
} |
||||
|
||||
struct vf610_nfc_config { |
||||
int hardware_ecc; |
||||
int width; |
||||
int flash_bbt; |
||||
}; |
||||
|
||||
static int vf610_nfc_nand_init(int devnum, void __iomem *addr) |
||||
{ |
||||
struct mtd_info *mtd = &nand_info[devnum]; |
||||
struct nand_chip *chip; |
||||
struct vf610_nfc *nfc; |
||||
int err = 0; |
||||
int page_sz; |
||||
struct vf610_nfc_config cfg = { |
||||
.hardware_ecc = 1, |
||||
#ifdef CONFIG_SYS_NAND_BUSWIDTH_16BIT |
||||
.width = 16, |
||||
#else |
||||
.width = 8, |
||||
#endif |
||||
.flash_bbt = 1, |
||||
}; |
||||
|
||||
nfc = malloc(sizeof(*nfc)); |
||||
if (!nfc) { |
||||
printf(KERN_ERR "%s: Memory exhausted!\n", __func__); |
||||
return -ENOMEM; |
||||
} |
||||
|
||||
chip = &nfc->chip; |
||||
nfc->regs = addr; |
||||
|
||||
mtd->priv = chip; |
||||
chip->priv = nfc; |
||||
|
||||
if (cfg.width == 16) { |
||||
chip->options |= NAND_BUSWIDTH_16; |
||||
vf610_nfc_set(mtd, NFC_FLASH_CONFIG, CONFIG_16BIT); |
||||
} else { |
||||
chip->options &= ~NAND_BUSWIDTH_16; |
||||
vf610_nfc_clear(mtd, NFC_FLASH_CONFIG, CONFIG_16BIT); |
||||
} |
||||
|
||||
chip->dev_ready = vf610_nfc_dev_ready; |
||||
chip->cmdfunc = vf610_nfc_command; |
||||
chip->read_byte = vf610_nfc_read_byte; |
||||
chip->read_word = vf610_nfc_read_word; |
||||
chip->read_buf = vf610_nfc_read_buf; |
||||
chip->write_buf = vf610_nfc_write_buf; |
||||
chip->select_chip = vf610_nfc_select_chip; |
||||
|
||||
/* Bad block options. */ |
||||
if (cfg.flash_bbt) |
||||
chip->bbt_options = NAND_BBT_USE_FLASH | NAND_BBT_CREATE; |
||||
|
||||
/* Default to software ECC until flash ID. */ |
||||
vf610_nfc_set_field(mtd, NFC_FLASH_CONFIG, |
||||
CONFIG_ECC_MODE_MASK, |
||||
CONFIG_ECC_MODE_SHIFT, ECC_BYPASS); |
||||
|
||||
chip->bbt_td = &bbt_main_descr; |
||||
chip->bbt_md = &bbt_mirror_descr; |
||||
|
||||
page_sz = PAGE_2K + OOB_64; |
||||
page_sz += cfg.width == 16 ? 1 : 0; |
||||
vf610_nfc_write(mtd, NFC_SECTOR_SIZE, page_sz); |
||||
|
||||
/* Set configuration register. */ |
||||
vf610_nfc_clear(mtd, NFC_FLASH_CONFIG, CONFIG_ADDR_AUTO_INCR_BIT); |
||||
vf610_nfc_clear(mtd, NFC_FLASH_CONFIG, CONFIG_BUFNO_AUTO_INCR_BIT); |
||||
vf610_nfc_clear(mtd, NFC_FLASH_CONFIG, CONFIG_BOOT_MODE_BIT); |
||||
vf610_nfc_clear(mtd, NFC_FLASH_CONFIG, CONFIG_DMA_REQ_BIT); |
||||
vf610_nfc_set(mtd, NFC_FLASH_CONFIG, CONFIG_FAST_FLASH_BIT); |
||||
|
||||
/* Enable Idle IRQ */ |
||||
vf610_nfc_set(mtd, NFC_IRQ_STATUS, IDLE_EN_BIT); |
||||
|
||||
/* PAGE_CNT = 1 */ |
||||
vf610_nfc_set_field(mtd, NFC_FLASH_CONFIG, CONFIG_PAGE_CNT_MASK, |
||||
CONFIG_PAGE_CNT_SHIFT, 1); |
||||
|
||||
/* Set ECC_STATUS offset */ |
||||
vf610_nfc_set_field(mtd, NFC_FLASH_CONFIG, |
||||
CONFIG_ECC_SRAM_ADDR_MASK, |
||||
CONFIG_ECC_SRAM_ADDR_SHIFT, ECC_SRAM_ADDR); |
||||
|
||||
/* first scan to find the device and get the page size */ |
||||
if (nand_scan_ident(mtd, CONFIG_SYS_MAX_NAND_DEVICE, NULL)) { |
||||
err = -ENXIO; |
||||
goto error; |
||||
} |
||||
|
||||
chip->ecc.mode = NAND_ECC_SOFT; /* default */ |
||||
|
||||
page_sz = mtd->writesize + mtd->oobsize; |
||||
|
||||
/* Single buffer only, max 256 OOB minus ECC status */ |
||||
if (page_sz > PAGE_2K + 256 - 8) { |
||||
dev_err(nfc->dev, "Unsupported flash size\n"); |
||||
err = -ENXIO; |
||||
goto error; |
||||
} |
||||
page_sz += cfg.width == 16 ? 1 : 0; |
||||
vf610_nfc_write(mtd, NFC_SECTOR_SIZE, page_sz); |
||||
|
||||
if (cfg.hardware_ecc) { |
||||
if (mtd->writesize != PAGE_2K && mtd->oobsize < 64) { |
||||
dev_err(nfc->dev, "Unsupported flash with hwecc\n"); |
||||
err = -ENXIO; |
||||
goto error; |
||||
} |
||||
|
||||
chip->ecc.layout = &vf610_nfc_ecc45; |
||||
|
||||
/* propagate ecc.layout to mtd_info */ |
||||
mtd->ecclayout = chip->ecc.layout; |
||||
chip->ecc.read_page = vf610_nfc_read_page; |
||||
chip->ecc.write_page = vf610_nfc_write_page; |
||||
chip->ecc.mode = NAND_ECC_HW; |
||||
|
||||
chip->ecc.bytes = 45; |
||||
chip->ecc.size = PAGE_2K; |
||||
chip->ecc.strength = 24; |
||||
|
||||
/* set ECC mode to 45 bytes OOB with 24 bits correction */ |
||||
vf610_nfc_set_field(mtd, NFC_FLASH_CONFIG, |
||||
CONFIG_ECC_MODE_MASK, |
||||
CONFIG_ECC_MODE_SHIFT, ECC_45_BYTE); |
||||
|
||||
/* Enable ECC_STATUS */ |
||||
vf610_nfc_set(mtd, NFC_FLASH_CONFIG, CONFIG_ECC_SRAM_REQ_BIT); |
||||
} |
||||
|
||||
/* second phase scan */ |
||||
err = nand_scan_tail(mtd); |
||||
if (err) |
||||
return err; |
||||
|
||||
err = nand_register(devnum); |
||||
if (err) |
||||
return err; |
||||
|
||||
return 0; |
||||
|
||||
error: |
||||
return err; |
||||
} |
||||
|
||||
void board_nand_init(void) |
||||
{ |
||||
int err = vf610_nfc_nand_init(0, (void __iomem *)CONFIG_SYS_NAND_BASE); |
||||
if (err) |
||||
printf("VF610 NAND init failed (err %d)\n", err); |
||||
} |
@ -0,0 +1,218 @@ |
||||
/*
|
||||
* Copyright (c) 2013 The Chromium OS Authors. |
||||
* |
||||
* SPDX-License-Identifier: GPL-2.0+ |
||||
*/ |
||||
|
||||
#include <common.h> |
||||
#include <cros_ec.h> |
||||
#include <errno.h> |
||||
#include <power/tps65090_pmic.h> |
||||
|
||||
DECLARE_GLOBAL_DATA_PTR; |
||||
|
||||
#define TPS65090_ADDR 0x48 |
||||
|
||||
static struct tps65090 { |
||||
struct cros_ec_dev *dev; /* The CROS_EC device */ |
||||
} config; |
||||
|
||||
/* TPS65090 register addresses */ |
||||
enum { |
||||
REG_IRQ1 = 0, |
||||
REG_CG_CTRL0 = 4, |
||||
REG_CG_STATUS1 = 0xa, |
||||
REG_FET1_CTRL = 0x0f, |
||||
REG_FET2_CTRL, |
||||
REG_FET3_CTRL, |
||||
REG_FET4_CTRL, |
||||
REG_FET5_CTRL, |
||||
REG_FET6_CTRL, |
||||
REG_FET7_CTRL, |
||||
TPS65090_NUM_REGS, |
||||
}; |
||||
|
||||
enum { |
||||
IRQ1_VBATG = 1 << 3, |
||||
CG_CTRL0_ENC_MASK = 0x01, |
||||
|
||||
MAX_FET_NUM = 7, |
||||
MAX_CTRL_READ_TRIES = 5, |
||||
|
||||
/* TPS65090 FET_CTRL register values */ |
||||
FET_CTRL_TOFET = 1 << 7, /* Timeout, startup, overload */ |
||||
FET_CTRL_PGFET = 1 << 4, /* Power good for FET status */ |
||||
FET_CTRL_WAIT = 3 << 2, /* Overcurrent timeout max */ |
||||
FET_CTRL_ADENFET = 1 << 1, /* Enable output auto discharge */ |
||||
FET_CTRL_ENFET = 1 << 0, /* Enable FET */ |
||||
}; |
||||
|
||||
/**
|
||||
* tps65090_read - read a byte from tps6090 |
||||
* |
||||
* @param reg The register address to read from. |
||||
* @param val We'll return value value read here. |
||||
* @return 0 if ok; error if EC returns failure. |
||||
*/ |
||||
static int tps65090_read(u32 reg, u8 *val) |
||||
{ |
||||
return cros_ec_i2c_xfer(config.dev, TPS65090_ADDR, reg, 1, |
||||
val, 1, true); |
||||
} |
||||
|
||||
/**
|
||||
* tps65090_write - write a byte to tps6090 |
||||
* |
||||
* @param reg The register address to write to. |
||||
* @param val The value to write. |
||||
* @return 0 if ok; error if EC returns failure. |
||||
*/ |
||||
static int tps65090_write(u32 reg, u8 val) |
||||
{ |
||||
return cros_ec_i2c_xfer(config.dev, TPS65090_ADDR, reg, 1, |
||||
&val, 1, false); |
||||
} |
||||
|
||||
/**
|
||||
* Checks for a valid FET number |
||||
* |
||||
* @param fet_id FET number to check |
||||
* @return 0 if ok, -EINVAL if FET value is out of range |
||||
*/ |
||||
static int tps65090_check_fet(unsigned int fet_id) |
||||
{ |
||||
if (fet_id == 0 || fet_id > MAX_FET_NUM) { |
||||
debug("parameter fet_id is out of range, %u not in 1 ~ %u\n", |
||||
fet_id, MAX_FET_NUM); |
||||
return -EINVAL; |
||||
} |
||||
|
||||
return 0; |
||||
} |
||||
|
||||
/**
|
||||
* Set the power state for a FET |
||||
* |
||||
* @param fet_id Fet number to set (1..MAX_FET_NUM) |
||||
* @param set 1 to power on FET, 0 to power off |
||||
* @return -EIO if we got a comms error, -EAGAIN if the FET failed to |
||||
* change state. If all is ok, returns 0. |
||||
*/ |
||||
static int tps65090_fet_set(int fet_id, bool set) |
||||
{ |
||||
int retry; |
||||
u8 reg, value; |
||||
|
||||
value = FET_CTRL_ADENFET | FET_CTRL_WAIT; |
||||
if (set) |
||||
value |= FET_CTRL_ENFET; |
||||
|
||||
if (tps65090_write(REG_FET1_CTRL + fet_id - 1, value)) |
||||
return -EIO; |
||||
|
||||
/* Try reading until we get a result */ |
||||
for (retry = 0; retry < MAX_CTRL_READ_TRIES; retry++) { |
||||
if (tps65090_read(REG_FET1_CTRL + fet_id - 1, ®)) |
||||
return -EIO; |
||||
|
||||
/* Check that the fet went into the expected state */ |
||||
if (!!(reg & FET_CTRL_PGFET) == set) |
||||
return 0; |
||||
|
||||
/* If we got a timeout, there is no point in waiting longer */ |
||||
if (reg & FET_CTRL_TOFET) |
||||
break; |
||||
|
||||
mdelay(1); |
||||
} |
||||
|
||||
debug("FET %d: Power good should have set to %d but reg=%#02x\n", |
||||
fet_id, set, reg); |
||||
return -EAGAIN; |
||||
} |
||||
|
||||
int tps65090_fet_enable(unsigned int fet_id) |
||||
{ |
||||
ulong start; |
||||
int loops; |
||||
int ret; |
||||
|
||||
ret = tps65090_check_fet(fet_id); |
||||
if (ret) |
||||
return ret; |
||||
|
||||
start = get_timer(0); |
||||
for (loops = 0;; loops++) { |
||||
ret = tps65090_fet_set(fet_id, true); |
||||
if (!ret) |
||||
break; |
||||
|
||||
if (get_timer(start) > 100) |
||||
break; |
||||
|
||||
/* Turn it off and try again until we time out */ |
||||
tps65090_fet_set(fet_id, false); |
||||
} |
||||
|
||||
if (ret) { |
||||
debug("%s: FET%d failed to power on: time=%lums, loops=%d\n", |
||||
__func__, fet_id, get_timer(start), loops); |
||||
} else if (loops) { |
||||
debug("%s: FET%d powered on after %lums, loops=%d\n", |
||||
__func__, fet_id, get_timer(start), loops); |
||||
} |
||||
/*
|
||||
* Unfortunately, there are some conditions where the power |
||||
* good bit will be 0, but the fet still comes up. One such |
||||
* case occurs with the lcd backlight. We'll just return 0 here |
||||
* and assume that the fet will eventually come up. |
||||
*/ |
||||
if (ret == -EAGAIN) |
||||
ret = 0; |
||||
|
||||
return ret; |
||||
} |
||||
|
||||
int tps65090_fet_disable(unsigned int fet_id) |
||||
{ |
||||
int ret; |
||||
|
||||
ret = tps65090_check_fet(fet_id); |
||||
if (ret) |
||||
return ret; |
||||
|
||||
ret = tps65090_fet_set(fet_id, false); |
||||
|
||||
return ret; |
||||
} |
||||
|
||||
int tps65090_fet_is_enabled(unsigned int fet_id) |
||||
{ |
||||
u8 reg = 0; |
||||
int ret; |
||||
|
||||
ret = tps65090_check_fet(fet_id); |
||||
if (ret) |
||||
return ret; |
||||
ret = tps65090_read(REG_FET1_CTRL + fet_id - 1, ®); |
||||
if (ret) { |
||||
debug("fail to read FET%u_CTRL register over I2C", fet_id); |
||||
return -EIO; |
||||
} |
||||
|
||||
return reg & FET_CTRL_ENFET; |
||||
} |
||||
|
||||
int tps65090_init(void) |
||||
{ |
||||
puts("TPS65090 PMIC EC init\n"); |
||||
|
||||
config.dev = board_get_cros_ec_dev(); |
||||
if (!config.dev) { |
||||
debug("%s: no cros_ec device: cannot init tps65090\n", |
||||
__func__); |
||||
return -ENODEV; |
||||
} |
||||
|
||||
return 0; |
||||
} |
@ -0,0 +1,68 @@ |
||||
/*
|
||||
* Copyright (C) 2014 Samsung Electronics |
||||
* |
||||
* Configuration settings for the SAMSUNG EXYNOS5 board. |
||||
* |
||||
* SPDX-License-Identifier: GPL-2.0+ |
||||
*/ |
||||
|
||||
#ifndef __CONFIG_EXYNOS4_COMMON_H |
||||
#define __CONFIG_EXYNOS4_COMMON_H |
||||
|
||||
#define CONFIG_EXYNOS4 /* Exynos4 Family */ |
||||
|
||||
#include "exynos-common.h" |
||||
|
||||
#define CONFIG_BOARD_COMMON |
||||
|
||||
#define CONFIG_SYS_CACHELINE_SIZE 32 |
||||
#define CONFIG_REVISION_TAG |
||||
|
||||
/* SD/MMC configuration */ |
||||
#define CONFIG_MMC_SDMA |
||||
#define CONFIG_MMC_DEFAULT_DEV 0 |
||||
|
||||
#undef CONFIG_CMD_FPGA |
||||
#undef CONFIG_CMD_MISC |
||||
#undef CONFIG_CMD_NET |
||||
#undef CONFIG_CMD_NFS |
||||
#undef CONFIG_CMD_XIMG |
||||
#undef CONFIG_CMD_ONENAND |
||||
#undef CONFIG_CMD_MTDPARTS |
||||
#define CONFIG_CMD_DFU |
||||
#define CONFIG_CMD_GPT |
||||
#define CONFIG_CMD_PMIC |
||||
#define CONFIG_CMD_SETEXPR |
||||
|
||||
/* USB Composite download gadget - g_dnl */ |
||||
#define CONFIG_USBDOWNLOAD_GADGET |
||||
|
||||
/* TIZEN THOR downloader support */ |
||||
#define CONFIG_CMD_THOR_DOWNLOAD |
||||
#define CONFIG_THOR_FUNCTION |
||||
|
||||
#define CONFIG_DFU_FUNCTION |
||||
#define CONFIG_DFU_MMC |
||||
#define CONFIG_SYS_DFU_DATA_BUF_SIZE SZ_32M |
||||
#define DFU_DEFAULT_POLL_TIMEOUT 300 |
||||
|
||||
/* USB Samsung's IDs */ |
||||
#define CONFIG_G_DNL_VENDOR_NUM 0x04E8 |
||||
#define CONFIG_G_DNL_PRODUCT_NUM 0x6601 |
||||
#define CONFIG_G_DNL_THOR_VENDOR_NUM CONFIG_G_DNL_VENDOR_NUM |
||||
#define CONFIG_G_DNL_THOR_PRODUCT_NUM 0x685D |
||||
#define CONFIG_G_DNL_UMS_VENDOR_NUM 0x0525 |
||||
#define CONFIG_G_DNL_UMS_PRODUCT_NUM 0xA4A5 |
||||
#define CONFIG_G_DNL_MANUFACTURER "Samsung" |
||||
|
||||
#define CONFIG_SYS_MONITOR_LEN (256 << 10) /* Reserve 2 sectors */ |
||||
|
||||
#define CONFIG_USB_GADGET |
||||
#define CONFIG_USB_GADGET_S3C_UDC_OTG |
||||
#define CONFIG_USB_GADGET_DUALSPEED |
||||
#define CONFIG_USB_GADGET_VBUS_DRAW 2 |
||||
|
||||
#define CONFIG_CMD_USB_MASS_STORAGE |
||||
#define CONFIG_USB_GADGET_MASS_STORAGE |
||||
|
||||
#endif /* __CONFIG_EXYNOS4_COMMON_H */ |
@ -0,0 +1,35 @@ |
||||
/*
|
||||
* Copyright (C) 2014 Google, Inc |
||||
* |
||||
* Configuration settings for generic Exynos 5 board |
||||
* |
||||
* SPDX-License-Identifier: GPL-2.0+ |
||||
*/ |
||||
|
||||
#ifndef __CONFIG_EXYNOS5_DT_COMMON_H |
||||
#define __CONFIG_EXYNOS5_DT_COMMON_H |
||||
|
||||
#include "exynos5-common.h" |
||||
|
||||
/* PMIC */ |
||||
#define CONFIG_POWER |
||||
#define CONFIG_POWER_I2C |
||||
#define CONFIG_POWER_TPS65090 |
||||
|
||||
/* Enable keyboard */ |
||||
#define CONFIG_CROS_EC /* CROS_EC protocol */ |
||||
#define CONFIG_CROS_EC_KEYB /* CROS_EC keyboard input */ |
||||
#define CONFIG_CMD_CROS_EC |
||||
#define CONFIG_KEYBOARD |
||||
|
||||
/* Console configuration */ |
||||
#undef EXYNOS_DEVICE_SETTINGS |
||||
#define EXYNOS_DEVICE_SETTINGS \ |
||||
"stdin=serial,cros-ec-keyb\0" \
|
||||
"stdout=serial,lcd\0" \
|
||||
"stderr=serial,lcd\0" |
||||
|
||||
#define CONFIG_EXTRA_ENV_SETTINGS \ |
||||
EXYNOS_DEVICE_SETTINGS |
||||
|
||||
#endif |
@ -0,0 +1,197 @@ |
||||
/*
|
||||
* Copyright (C) 2010-2013 Freescale Semiconductor, Inc. |
||||
* Copyright (C) 2014 Bachmann electronic GmbH |
||||
* |
||||
* SPDX-License-Identifier: GPL-2.0+ |
||||
*/ |
||||
|
||||
#ifndef __CONFIG_H |
||||
#define __CONFIG_H |
||||
|
||||
#include "mx6_common.h" |
||||
#define CONFIG_MX6 |
||||
#define CONFIG_DISPLAY_CPUINFO |
||||
#define CONFIG_DISPLAY_BOARDINFO |
||||
|
||||
#include <asm/arch/imx-regs.h> |
||||
#include <asm/imx-common/gpio.h> |
||||
|
||||
#define CONFIG_CMDLINE_TAG |
||||
#define CONFIG_SETUP_MEMORY_TAGS |
||||
#define CONFIG_INITRD_TAG |
||||
#define CONFIG_REVISION_TAG |
||||
#define CONFIG_SYS_GENERIC_BOARD |
||||
|
||||
/* Size of malloc() pool */ |
||||
#define CONFIG_SYS_MALLOC_LEN (10 * 1024 * 1024) |
||||
|
||||
#define CONFIG_BOARD_EARLY_INIT_F |
||||
#define CONFIG_MISC_INIT_R |
||||
#define CONFIG_MXC_GPIO |
||||
|
||||
/* FUSE Configs */ |
||||
#define CONFIG_CMD_FUSE |
||||
#define CONFIG_MXC_OCOTP |
||||
|
||||
/* UART Configs */ |
||||
#define CONFIG_MXC_UART |
||||
#define CONFIG_MXC_UART_BASE UART1_BASE |
||||
|
||||
/* SF Configs */ |
||||
#define CONFIG_CMD_SF |
||||
#define CONFIG_SPI |
||||
#define CONFIG_SPI_FLASH |
||||
#define CONFIG_SPI_FLASH_STMICRO |
||||
#define CONFIG_SPI_FLASH_WINBOND |
||||
#define CONFIG_SPI_FLASH_MACRONIX |
||||
#define CONFIG_SPI_FLASH_SST |
||||
#define CONFIG_MXC_SPI |
||||
#define CONFIG_SF_DEFAULT_BUS 2 |
||||
#define CONFIG_SF_DEFAULT_CS (0|(IMX_GPIO_NR(1, 3)<<8)) |
||||
#define CONFIG_SF_DEFAULT_SPEED 25000000 |
||||
#define CONFIG_SF_DEFAULT_MODE (SPI_MODE_0) |
||||
|
||||
/* IO expander */ |
||||
#define CONFIG_PCA953X |
||||
#define CONFIG_SYS_I2C_PCA953X_ADDR 0x20 |
||||
#define CONFIG_SYS_I2C_PCA953X_WIDTH { {0x20, 16} } |
||||
#define CONFIG_CMD_PCA953X |
||||
#define CONFIG_CMD_PCA953X_INFO |
||||
|
||||
/* I2C Configs */ |
||||
#define CONFIG_CMD_I2C |
||||
#define CONFIG_SYS_I2C |
||||
#define CONFIG_SYS_I2C_MXC |
||||
#define CONFIG_SYS_I2C_SPEED 100000 |
||||
|
||||
/* OCOTP Configs */ |
||||
#define CONFIG_CMD_IMXOTP |
||||
#define CONFIG_IMX_OTP |
||||
#define IMX_OTP_BASE OCOTP_BASE_ADDR |
||||
#define IMX_OTP_ADDR_MAX 0x7F |
||||
#define IMX_OTP_DATA_ERROR_VAL 0xBADABADA |
||||
#define IMX_OTPWRITE_ENABLED |
||||
|
||||
/* MMC Configs */ |
||||
#define CONFIG_FSL_ESDHC |
||||
#define CONFIG_FSL_USDHC |
||||
#define CONFIG_SYS_FSL_ESDHC_ADDR 0 |
||||
#define CONFIG_SYS_FSL_USDHC_NUM 2 |
||||
|
||||
#define CONFIG_MMC |
||||
#define CONFIG_CMD_MMC |
||||
#define CONFIG_GENERIC_MMC |
||||
#define CONFIG_BOUNCE_BUFFER |
||||
|
||||
#ifdef CONFIG_MX6Q |
||||
#define CONFIG_CMD_SATA |
||||
#endif |
||||
|
||||
/*
|
||||
* SATA Configs |
||||
*/ |
||||
#ifdef CONFIG_CMD_SATA |
||||
#define CONFIG_DWC_AHSATA |
||||
#define CONFIG_SYS_SATA_MAX_DEVICE 1 |
||||
#define CONFIG_DWC_AHSATA_PORT_ID 0 |
||||
#define CONFIG_DWC_AHSATA_BASE_ADDR SATA_ARB_BASE_ADDR |
||||
#define CONFIG_LBA48 |
||||
#define CONFIG_LIBATA |
||||
#endif |
||||
|
||||
|
||||
#define CONFIG_CMD_PING |
||||
#define CONFIG_CMD_DHCP |
||||
#define CONFIG_CMD_MII |
||||
#define CONFIG_CMD_NET |
||||
#define CONFIG_FEC_MXC |
||||
#define CONFIG_MII |
||||
#define IMX_FEC_BASE ENET_BASE_ADDR |
||||
#define CONFIG_FEC_XCV_TYPE MII100 |
||||
#define CONFIG_ETHPRIME "FEC" |
||||
#define CONFIG_FEC_MXC_PHYADDR 0x5 |
||||
#define CONFIG_PHYLIB |
||||
#define CONFIG_PHY_SMSC |
||||
|
||||
/* Miscellaneous commands */ |
||||
#define CONFIG_CMD_BMODE |
||||
#define CONFIG_CMD_SETEXPR |
||||
|
||||
/* allow to overwrite serial and ethaddr */ |
||||
#define CONFIG_ENV_OVERWRITE |
||||
#define CONFIG_CONS_INDEX 1 |
||||
#define CONFIG_BAUDRATE 115200 |
||||
|
||||
/* Command definition */ |
||||
#include <config_cmd_default.h> |
||||
|
||||
#undef CONFIG_CMD_IMLS |
||||
|
||||
#define CONFIG_BOOTDELAY 2 |
||||
|
||||
#define CONFIG_PREBOOT "" |
||||
|
||||
#define CONFIG_LOADADDR 0x12000000 |
||||
#define CONFIG_SYS_TEXT_BASE 0x17800000 |
||||
|
||||
/* Miscellaneous configurable options */ |
||||
#define CONFIG_SYS_LONGHELP |
||||
#define CONFIG_SYS_HUSH_PARSER |
||||
#define CONFIG_SYS_CBSIZE 1024 |
||||
|
||||
/* Print Buffer Size */ |
||||
#define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16) |
||||
#define CONFIG_SYS_MAXARGS 16 |
||||
#define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE |
||||
|
||||
#define CONFIG_SYS_LOAD_ADDR CONFIG_LOADADDR |
||||
|
||||
#define CONFIG_CMDLINE_EDITING |
||||
|
||||
/* Physical Memory Map */ |
||||
#define CONFIG_NR_DRAM_BANKS 1 |
||||
#define PHYS_SDRAM MMDC0_ARB_BASE_ADDR |
||||
#define PHYS_SDRAM_SIZE (1u * 1024 * 1024 * 1024) |
||||
|
||||
#define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM |
||||
#define CONFIG_SYS_INIT_RAM_ADDR IRAM_BASE_ADDR |
||||
#define CONFIG_SYS_INIT_RAM_SIZE IRAM_SIZE |
||||
|
||||
#define CONFIG_SYS_INIT_SP_OFFSET \ |
||||
(CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE) |
||||
#define CONFIG_SYS_INIT_SP_ADDR \ |
||||
(CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET) |
||||
|
||||
/* FLASH and environment organization */ |
||||
#define CONFIG_SYS_NO_FLASH |
||||
|
||||
#define CONFIG_ENV_IS_IN_SPI_FLASH |
||||
#define CONFIG_ENV_SIZE (64 * 1024) /* 64 kb */ |
||||
#define CONFIG_ENV_OFFSET (1024 * 1024) |
||||
/* M25P16 has an erase size of 64 KiB */ |
||||
#define CONFIG_ENV_SECT_SIZE (64 * 1024) |
||||
#define CONFIG_ENV_SPI_BUS CONFIG_SF_DEFAULT_BUS |
||||
#define CONFIG_ENV_SPI_CS CONFIG_SF_DEFAULT_CS |
||||
#define CONFIG_ENV_SPI_MODE CONFIG_SF_DEFAULT_MODE |
||||
#define CONFIG_ENV_SPI_MAX_HZ CONFIG_SF_DEFAULT_SPEED |
||||
|
||||
#define CONFIG_OF_LIBFDT |
||||
#define CONFIG_CMD_BOOTZ |
||||
|
||||
#ifndef CONFIG_SYS_DCACHE_OFF |
||||
#define CONFIG_CMD_CACHE |
||||
#endif |
||||
|
||||
#define CONFIG_CMD_BOOTZ |
||||
#define CONFIG_SUPPORT_RAW_INITRD |
||||
|
||||
/* FS Configs */ |
||||
#define CONFIG_CMD_EXT3 |
||||
#define CONFIG_CMD_EXT4 |
||||
#define CONFIG_DOS_PARTITION |
||||
#define CONFIG_CMD_FS_GENERIC |
||||
|
||||
#define CONFIG_BOOTP_SERVERIP |
||||
#define CONFIG_BOOTP_BOOTFILE |
||||
|
||||
#endif /* __CONFIG_H */ |
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue