NanoPayload

Annotated stage2/board.h

219:a6159a678002
2017-06-29 Paul Boddie Introduced separate abstractions for GPIO keymap details and moved initialisation into the keyscan task. Disabled the power button GPIO interrupt for now.
paul@33 1
#ifndef __BOARD_H__
paul@33 2
#define __BOARD_H__
paul@33 3
paul@209 4
#ifndef __ASSEMBLER__
paul@209 5
paul@33 6
/* Utility functions. */
paul@33 7
paul@195 8
void udelay(unsigned long);
paul@195 9
unsigned long get_memory_size();
paul@33 10
paul@197 11
/* Common timer definitions. */
paul@197 12
paul@68 13
#define TIMER_HZ		CONFIG_SYS_HZ
paul@68 14
#define TIMER_CHAN		0
paul@68 15
#define TIMER_FDATA		0xffff				/* timer full data value, limited to 16 bits */
paul@68 16
paul@197 17
/* Select the CPU definitions according to the configuration. */
paul@197 18
paul@33 19
#ifdef CONFIG_CPU_JZ4730
paul@197 20
paul@33 21
#include "jz4730.h"
paul@112 22
#include "jz4730_compat.h"
paul@68 23
#define READ_TIMER		__ost_get_count(TIMER_CHAN)	/* macro to read the 32 bit timer */
paul@68 24
#define TIMER_CHAN_IRQ		IRQ_OST0
paul@197 25
paul@197 26
#else /* assume jz4740 */
paul@197 27
paul@33 28
#include "jz4740.h"
paul@68 29
#define READ_TIMER		REG_TCU_TCNT(TIMER_CHAN)	/* macro to read the 16 bit timer */
paul@68 30
#define TIMER_CHAN_IRQ		IRQ_TCU0
paul@197 31
paul@197 32
#endif /* CONFIG_CPU_JZ4730 */
paul@197 33
paul@209 34
#endif /* __ASSEMBLER__ */
paul@209 35
paul@209 36
paul@209 37
paul@197 38
/* Select the board definitions according to the configuration. */
paul@197 39
paul@197 40
#ifdef CONFIG_CPU_JZ4730_MINIPC
paul@197 41
paul@197 42
#include "minipc.h"
paul@219 43
#include "minipc_gpio.h"
paul@197 44
paul@197 45
#else /* assume NanoNote */
paul@197 46
paul@197 47
#include "nanonote.h"
paul@219 48
#include "nanonote_gpio.h"
paul@197 49
paul@197 50
#endif /* CONFIG_CPU_JZ4730_MINIPC */
paul@33 51
paul@33 52
#endif /* __BOARD_H__ */