diff options
author | Gerrit <chrome-bot@google.com> | 2012-02-14 18:25:42 -0800 |
---|---|---|
committer | Gerrit Code Review <gerrit@gerrit.golo.chromium.org> | 2012-02-14 18:25:42 -0800 |
commit | c160dae1d45ea1a02e17b5de75e75a396b160627 (patch) | |
tree | 8068b410586e378f19bfde9f12db3fe923aacc8d /board | |
parent | 3d9bccaa58a8f51f0894c56d5ea5e5b7e8d576d9 (diff) | |
parent | b34c1ce954bd2c11279e20d5252d62cecff6468e (diff) | |
download | chrome-ec-c160dae1d45ea1a02e17b5de75e75a396b160627.tar.gz |
Merge "stm32l: Add skeleton for Daisy board"
Diffstat (limited to 'board')
-rw-r--r-- | board/daisy/board.c | 70 | ||||
-rw-r--r-- | board/daisy/board.h | 43 | ||||
-rw-r--r-- | board/daisy/build.mk | 10 | ||||
-rw-r--r-- | board/daisy/ec.tasklist | 18 |
4 files changed, 141 insertions, 0 deletions
diff --git a/board/daisy/board.c b/board/daisy/board.c new file mode 100644 index 0000000000..40b4d6da86 --- /dev/null +++ b/board/daisy/board.c @@ -0,0 +1,70 @@ +/* Copyright (c) 2012 The Chromium OS Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ +/* Daisy board-specific configuration */ + +#include "board.h" +#include "common.h" +#include "gpio.h" +#include "registers.h" +#include "util.h" + +/* GPIO signal list. Must match order from enum gpio_signal. */ +const struct gpio_info gpio_list[GPIO_COUNT] = { + /* Inputs with interrupt handlers are first for efficiency */ + {"EC_PWRON", GPIO_A, (1<<0), GPIO_INT_BOTH, NULL}, + {"PP1800_LDO2", GPIO_A, (1<<1), GPIO_INT_BOTH, NULL}, + {"XPSHOLD", GPIO_A, (1<<11), GPIO_INT_RISING, NULL}, + {"CHARGER_INT", GPIO_B, (1<<0), GPIO_INT_RISING, NULL}, + {"EC_INT", GPIO_B, (1<<9), GPIO_INT_RISING, NULL}, + {"LID_OPEN", GPIO_C, (1<<13), GPIO_INT_BOTH, NULL}, + /* Other inputs */ + /* Outputs */ + {"EN_PP1350", GPIO_A, (1<<2), GPIO_OUT_LOW, NULL}, + {"EN_PP5000", GPIO_A, (1<<3), GPIO_OUT_LOW, NULL}, + {"EN_PP3300", GPIO_A, (1<<8), GPIO_OUT_LOW, NULL}, + {"PMIC_ACOK", GPIO_A, (1<<12), GPIO_OUT_LOW, NULL}, + {"ENTERING_RW", GPIO_B, (1<<1), GPIO_OUT_LOW, NULL}, + {"CHARGER_EN", GPIO_B, (1<<2), GPIO_OUT_LOW, NULL}, +}; + +void configure_board(void) +{ + /* Enable all GPIOs clocks + * TODO: more fine-grained enabling for power saving + */ + STM32L_RCC_AHBENR |= 0x3f; +} + +/** + * Stubs for non implemented drivers + * TODO: implement + */ +int jtag_pre_init(void) +{ + /* stop TIM2, TIM3 and watchdogs when the JTAG stops the CPU */ + STM32L_DBGMCU_APB1FZ |= 0x00001803; + + return EC_SUCCESS; +} + +int eeprom_init(void) +{ + return EC_SUCCESS; +} + +int i2c_init(void) +{ + return EC_SUCCESS; +} + +int power_button_init(void) +{ + return EC_SUCCESS; +} + +int adc_init(void) +{ + return EC_SUCCESS; +} diff --git a/board/daisy/board.h b/board/daisy/board.h new file mode 100644 index 0000000000..a176714d78 --- /dev/null +++ b/board/daisy/board.h @@ -0,0 +1,43 @@ +/* Copyright (c) 2012 The Chromium OS Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/* Daisy board configuration */ + +#ifndef __BOARD_H +#define __BOARD_H + +/* 16 MHz SYSCLK clock frequency */ +#define CPU_CLOCK 16000000 + +/* Use USART1 as console serial port */ +#define CONFIG_CONSOLE_UART 1 + +#define USB_CHARGE_PORT_COUNT 0 + +/* GPIO signal list */ +enum gpio_signal { + /* Inputs with interrupt handlers are first for efficiency */ + GPIO_EC_PWRON = 0, /* Power button */ + GPIO_LID_OPEN, /* LID switch detection */ + GPIO_PP1800_LDO2, /* LDO2 is ON (end of PMIC sequence) */ + GPIO_SOC1V8_XPSHOLD, /* App Processor ON */ + GPIO_CHARGER_INT, + GPIO_EC_INT, + /* Other inputs */ + /* Outputs */ + GPIO_EN_PP1350, /* DDR 1.35v rail enable */ + GPIO_EN_PP5000, /* 5.0v rail enable */ + GPIO_EN_PP3300, /* 3.3v rail enable */ + GPIO_PMIC_ACOK, /* 5v rail ready */ + GPIO_EC_ENTERING_RW, /* EC is R/W mode for the kbc mux */ + GPIO_CHARGER_EN, + + /* Number of GPIOs; not an actual GPIO */ + GPIO_COUNT +}; + +void configure_board(void); + +#endif /* __BOARD_H */ diff --git a/board/daisy/build.mk b/board/daisy/build.mk new file mode 100644 index 0000000000..2f0ebe32af --- /dev/null +++ b/board/daisy/build.mk @@ -0,0 +1,10 @@ +# Copyright (c) 2012 The Chromium OS Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. +# +# Board specific files build + +# the IC is STmicro STM32L151R8H6 +CHIP:=stm32l + +board-y=board.o diff --git a/board/daisy/ec.tasklist b/board/daisy/ec.tasklist new file mode 100644 index 0000000000..0e5992b96b --- /dev/null +++ b/board/daisy/ec.tasklist @@ -0,0 +1,18 @@ +/* Copyright (c) 2012 The Chromium OS Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/** + * List of enabled tasks in the priority order + * + * The first one has the lowest priority. + * + * For each task, use the macro TASK(n, r, d) where : + * 'n' in the name of the task + * 'r' in the main routine of the task + * 'd' in an opaque parameter passed to the routine at startup + */ +#define CONFIG_TASK_LIST \ + TASK(WATCHDOG, watchdog_task, NULL) \ + TASK(CONSOLE, console_task, NULL) |