Commit 89b765c7f6ddfde07ba673dd4adbeb5da391a81b

Authored by Sudhakar Rajashekhara
Committed by Sandeep Paulraj
1 parent 158557001a

TI: DaVinci: Add board specific code for da850 EVM

Provides initial support for TI OMAP-L138/DA850 SoC devices on
a Logic PD EVM board.

Provides:
Initial boot and configuration.
Support for i2c.
UART support (console).

Signed-off-by: Sudhakar Rajashekhara <sudhakar.raj@ti.com>
Acked-by: Ben Gardiner <bengardiner@nanometrics.ca>
Reviewed-by: Wolfgang Denk <wd@denx.de>
Signed-off-by: Sandeep Paulraj <s-paulraj@ti.com>

Showing 7 changed files with 260 additions and 1 deletions Side-by-side Diff

... ... @@ -353,6 +353,10 @@
353 353 sbc8240 MPC8240
354 354 sbc405 PPC405GP
355 355  
  356 +Sudhakar Rajashekhara <sudhakar.raj@ti.com>
  357 +
  358 + da850evm ARM926EJS (DA850/OMAP-L138)
  359 +
356 360 Ricardo Ribalda <ricardo.ribalda@uam.es>
357 361  
358 362 ml507 PPC440x5
... ... @@ -561,6 +561,7 @@
561 561 cp946es \
562 562 cp966 \
563 563 da830evm \
  564 + da850evm \
564 565 edb9301 \
565 566 edb9302 \
566 567 edb9302a \
... ... @@ -2916,7 +2916,8 @@
2916 2916 cp1026_config: unconfig
2917 2917 @board/armltd/integrator/split_by_variant.sh cp $@
2918 2918  
2919   -da830evm_config: unconfig
  2919 +da830evm_config \
  2920 +da850evm_config: unconfig
2920 2921 @$(MKCONFIG) $(@:_config=) arm arm926ejs da8xxevm davinci davinci
2921 2922  
2922 2923 davinci_dvevm_config : unconfig
arch/arm/include/asm/arch-davinci/hardware.h
... ... @@ -398,6 +398,7 @@
398 398 #define DAVINCI_SYSCFG_SUSPSRC_EMAC (1 << 5)
399 399 #define DAVINCI_SYSCFG_SUSPSRC_I2C (1 << 16)
400 400 #define DAVINCI_SYSCFG_SUSPSRC_SPI0 (1 << 21)
  401 +#define DAVINCI_SYSCFG_SUSPSRC_SPI1 (1 << 22)
401 402 #define DAVINCI_SYSCFG_SUSPSRC_UART2 (1 << 20)
402 403 #define DAVINCI_SYSCFG_SUSPSRC_TIMER0 (1 << 27)
403 404  
board/davinci/da8xxevm/Makefile
... ... @@ -29,6 +29,7 @@
29 29  
30 30 COBJS-y += common.o
31 31 COBJS-$(CONFIG_MACH_DAVINCI_DA830_EVM) += da830evm.o
  32 +COBJS-$(CONFIG_MACH_DAVINCI_DA850_EVM) += da850evm.o
32 33  
33 34 COBJS := $(COBJS-y)
34 35  
board/davinci/da8xxevm/da850evm.c
  1 +/*
  2 + * Copyright (C) 2010 Texas Instruments Incorporated - http://www.ti.com/
  3 + *
  4 + * Based on da830evm.c. Original Copyrights follow:
  5 + *
  6 + * Copyright (C) 2009 Nick Thompson, GE Fanuc, Ltd. <nick.thompson@gefanuc.com>
  7 + * Copyright (C) 2007 Sergey Kubushyn <ksi@koi8.net>
  8 + *
  9 + * This program is free software; you can redistribute it and/or modify
  10 + * it under the terms of the GNU General Public License as published by
  11 + * the Free Software Foundation; either version 2 of the License, or
  12 + * (at your option) any later version.
  13 + *
  14 + * This program is distributed in the hope that it will be useful,
  15 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17 + * GNU General Public License for more details.
  18 + *
  19 + * You should have received a copy of the GNU General Public License
  20 + * along with this program; if not, write to the Free Software
  21 + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  22 + */
  23 +
  24 +#include <common.h>
  25 +#include <i2c.h>
  26 +#include <asm/arch/hardware.h>
  27 +#include <asm/io.h>
  28 +#include "../common/misc.h"
  29 +#include "common.h"
  30 +
  31 +DECLARE_GLOBAL_DATA_PTR;
  32 +
  33 +#define pinmux (&davinci_syscfg_regs->pinmux)
  34 +
  35 +/* SPI0 pin muxer settings */
  36 +static const struct pinmux_config spi1_pins[] = {
  37 + { pinmux[5], 1, 1 },
  38 + { pinmux[5], 1, 2 },
  39 + { pinmux[5], 1, 4 },
  40 + { pinmux[5], 1, 5 }
  41 +};
  42 +
  43 +/* UART pin muxer settings */
  44 +static const struct pinmux_config uart_pins[] = {
  45 + { pinmux[0], 4, 6 },
  46 + { pinmux[0], 4, 7 },
  47 + { pinmux[4], 2, 4 },
  48 + { pinmux[4], 2, 5 }
  49 +};
  50 +
  51 +/* I2C pin muxer settings */
  52 +static const struct pinmux_config i2c_pins[] = {
  53 + { pinmux[4], 2, 2 },
  54 + { pinmux[4], 2, 3 }
  55 +};
  56 +
  57 +static const struct pinmux_resource pinmuxes[] = {
  58 +#ifdef CONFIG_SPI_FLASH
  59 + PINMUX_ITEM(spi1_pins),
  60 +#endif
  61 + PINMUX_ITEM(uart_pins),
  62 + PINMUX_ITEM(i2c_pins),
  63 +};
  64 +
  65 +static const struct lpsc_resource lpsc[] = {
  66 + { DAVINCI_LPSC_AEMIF }, /* NAND, NOR */
  67 + { DAVINCI_LPSC_SPI1 }, /* Serial Flash */
  68 + { DAVINCI_LPSC_EMAC }, /* image download */
  69 + { DAVINCI_LPSC_UART2 }, /* console */
  70 + { DAVINCI_LPSC_GPIO },
  71 +};
  72 +
  73 +int board_init(void)
  74 +{
  75 +#ifndef CONFIG_USE_IRQ
  76 + irq_init();
  77 +#endif
  78 +
  79 + /* arch number of the board */
  80 + gd->bd->bi_arch_number = MACH_TYPE_DAVINCI_DA850_EVM;
  81 +
  82 + /* address of boot parameters */
  83 + gd->bd->bi_boot_params = LINUX_BOOT_PARAM_ADDR;
  84 +
  85 + /*
  86 + * Power on required peripherals
  87 + * ARM does not have access by default to PSC0 and PSC1
  88 + * assuming here that the DSP bootloader has set the IOPU
  89 + * such that PSC access is available to ARM
  90 + */
  91 + if (da8xx_configure_lpsc_items(lpsc, ARRAY_SIZE(lpsc)))
  92 + return 1;
  93 +
  94 + /* setup the SUSPSRC for ARM to control emulation suspend */
  95 + writel(readl(&davinci_syscfg_regs->suspsrc) &
  96 + ~(DAVINCI_SYSCFG_SUSPSRC_EMAC | DAVINCI_SYSCFG_SUSPSRC_I2C |
  97 + DAVINCI_SYSCFG_SUSPSRC_SPI1 | DAVINCI_SYSCFG_SUSPSRC_TIMER0 |
  98 + DAVINCI_SYSCFG_SUSPSRC_UART2),
  99 + &davinci_syscfg_regs->suspsrc);
  100 +
  101 + /* configure pinmux settings */
  102 + if (davinci_configure_pin_mux_items(pinmuxes, ARRAY_SIZE(pinmuxes)))
  103 + return 1;
  104 +
  105 + /* enable the console UART */
  106 + writel((DAVINCI_UART_PWREMU_MGMT_FREE | DAVINCI_UART_PWREMU_MGMT_URRST |
  107 + DAVINCI_UART_PWREMU_MGMT_UTRST),
  108 + &davinci_uart2_ctrl_regs->pwremu_mgmt);
  109 +
  110 + return 0;
  111 +}
include/configs/da850evm.h
  1 +/*
  2 + * Copyright (C) 2010 Texas Instruments Incorporated - http://www.ti.com/
  3 + *
  4 + * Based on davinci_dvevm.h. Original Copyrights follow:
  5 + *
  6 + * Copyright (C) 2007 Sergey Kubushyn <ksi@koi8.net>
  7 + *
  8 + * This program is free software; you can redistribute it and/or modify
  9 + * it under the terms of the GNU General Public License as published by
  10 + * the Free Software Foundation; either version 2 of the License, or
  11 + * (at your option) any later version.
  12 + *
  13 + * This program is distributed in the hope that it will be useful,
  14 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16 + * GNU General Public License for more details.
  17 + *
  18 + * You should have received a copy of the GNU General Public License
  19 + * along with this program; if not, write to the Free Software
  20 + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  21 + */
  22 +
  23 +#ifndef __CONFIG_H
  24 +#define __CONFIG_H
  25 +
  26 +/*
  27 + * Board
  28 + */
  29 +
  30 +/*
  31 + * SoC Configuration
  32 + */
  33 +#define CONFIG_MACH_DAVINCI_DA850_EVM
  34 +#define CONFIG_ARM926EJS /* arm926ejs CPU core */
  35 +#define CONFIG_SOC_DA8XX /* TI DA8xx SoC */
  36 +#define CONFIG_SYS_CLK_FREQ clk_get(DAVINCI_ARM_CLKID)
  37 +#define CONFIG_SYS_OSCIN_FREQ 24000000
  38 +#define CONFIG_SYS_TIMERBASE DAVINCI_TIMER0_BASE
  39 +#define CONFIG_SYS_HZ_CLOCK clk_get(DAVINCI_AUXCLK_CLKID)
  40 +#define CONFIG_SYS_HZ 1000
  41 +#define CONFIG_SKIP_LOWLEVEL_INIT
  42 +#define CONFIG_SKIP_RELOCATE_UBOOT /* to a proper address, init done */
  43 +
  44 +/*
  45 + * Memory Info
  46 + */
  47 +#define CONFIG_SYS_MALLOC_LEN (0x10000 + 1*1024*1024) /* malloc() len */
  48 +#define CONFIG_SYS_GBL_DATA_SIZE 128 /* reserved for initial data */
  49 +#define PHYS_SDRAM_1 DAVINCI_DDR_EMIF_DATA_BASE /* DDR Start */
  50 +#define PHYS_SDRAM_1_SIZE (64 << 20) /* SDRAM size 64MB */
  51 +
  52 +/* memtest start addr */
  53 +#define CONFIG_SYS_MEMTEST_START (PHYS_SDRAM_1 + 0x2000000)
  54 +
  55 +/* memtest will be run on 16MB */
  56 +#define CONFIG_SYS_MEMTEST_END (PHYS_SDRAM_1 + 0x2000000 + 16*1024*1024)
  57 +
  58 +#define CONFIG_NR_DRAM_BANKS 1 /* we have 1 bank of DRAM */
  59 +#define CONFIG_STACKSIZE (256*1024) /* regular stack */
  60 +
  61 +/*
  62 + * Serial Driver info
  63 + */
  64 +#define CONFIG_SYS_NS16550
  65 +#define CONFIG_SYS_NS16550_SERIAL
  66 +#define CONFIG_SYS_NS16550_REG_SIZE -4 /* NS16550 register size */
  67 +#define CONFIG_SYS_NS16550_COM1 DAVINCI_UART2_BASE /* Base address of UART2 */
  68 +#define CONFIG_SYS_NS16550_CLK clk_get(DAVINCI_UART2_CLKID)
  69 +#define CONFIG_CONS_INDEX 1 /* use UART0 for console */
  70 +#define CONFIG_BAUDRATE 115200 /* Default baud rate */
  71 +#define CONFIG_SYS_BAUDRATE_TABLE { 9600, 19200, 38400, 57600, 115200 }
  72 +
  73 +/*
  74 + * I2C Configuration
  75 + */
  76 +#define CONFIG_HARD_I2C
  77 +#define CONFIG_DRIVER_DAVINCI_I2C
  78 +#define CONFIG_SYS_I2C_SPEED 25000
  79 +#define CONFIG_SYS_I2C_SLAVE 10 /* Bogus, master-only in U-Boot */
  80 +
  81 +/*
  82 + * U-Boot general configuration
  83 + */
  84 +#define CONFIG_BOOTFILE "uImage" /* Boot file name */
  85 +#define CONFIG_SYS_PROMPT "DA850-evm > " /* Command Prompt */
  86 +#define CONFIG_SYS_CBSIZE 1024 /* Console I/O Buffer Size */
  87 +#define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE+sizeof(CONFIG_SYS_PROMPT)+16)
  88 +#define CONFIG_SYS_MAXARGS 16 /* max number of command args */
  89 +#define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE /* Boot Args Buffer Size */
  90 +#define CONFIG_SYS_LOAD_ADDR (PHYS_SDRAM_1 + 0x700000)
  91 +#define CONFIG_VERSION_VARIABLE
  92 +#define CONFIG_AUTO_COMPLETE
  93 +#define CONFIG_SYS_HUSH_PARSER
  94 +#define CONFIG_SYS_PROMPT_HUSH_PS2 "> "
  95 +#define CONFIG_CMDLINE_EDITING
  96 +#define CONFIG_SYS_LONGHELP
  97 +#define CONFIG_CRC32_VERIFY
  98 +#define CONFIG_MX_CYCLIC
  99 +
  100 +/*
  101 + * Linux Information
  102 + */
  103 +#define LINUX_BOOT_PARAM_ADDR (CONFIG_SYS_MEMTEST_START + 0x100)
  104 +#define CONFIG_CMDLINE_TAG
  105 +#define CONFIG_SETUP_MEMORY_TAGS
  106 +#define CONFIG_BOOTARGS \
  107 + "mem=32M console=ttyS2,115200n8 root=/dev/mtdblock2 rw noinitrd ip=dhcp"
  108 +#define CONFIG_BOOTDELAY 3
  109 +
  110 +/*
  111 + * U-Boot commands
  112 + */
  113 +#include <config_cmd_default.h>
  114 +#define CONFIG_CMD_ENV
  115 +#define CONFIG_CMD_ASKENV
  116 +#define CONFIG_CMD_DHCP
  117 +#define CONFIG_CMD_DIAG
  118 +#define CONFIG_CMD_MII
  119 +#define CONFIG_CMD_PING
  120 +#define CONFIG_CMD_SAVES
  121 +#define CONFIG_CMD_MEMORY
  122 +
  123 +#ifndef CONFIG_DRIVER_TI_EMAC
  124 +#undef CONFIG_CMD_NET
  125 +#undef CONFIG_CMD_DHCP
  126 +#undef CONFIG_CMD_MII
  127 +#undef CONFIG_CMD_PING
  128 +#endif
  129 +
  130 +#if !defined(CONFIG_USE_NAND) && \
  131 + !defined(CONFIG_USE_NOR) && \
  132 + !defined(CONFIG_USE_SPIFLASH)
  133 +#define CONFIG_ENV_IS_NOWHERE
  134 +#define CONFIG_SYS_NO_FLASH
  135 +#define CONFIG_ENV_SIZE (16 << 10)
  136 +#undef CONFIG_CMD_IMLS
  137 +#undef CONFIG_CMD_ENV
  138 +#endif
  139 +
  140 +#endif /* __CONFIG_H */