NanoPayload

Annotated stage2/stage2.c

58:f1960e25e2b3
2015-06-14 Paul Boddie Introduced initial support for non-PIC stage 2 payloads that do not need their objects relocating, tested to be bootable from MMC. stage2-non-pic
paul@6 1
/*
paul@6 2
 * Ben NanoNote stage 2 payload test.
paul@6 3
 *
paul@33 4
 * Copyright (C) Wolfgang Spraul <wolfgang@sharism.cc>
paul@6 5
 * Copyright (C) 2015 Paul Boddie <paul@boddie.org.uk>
paul@6 6
 *
paul@6 7
 * This program is free software; you can redistribute it and/or modify it under
paul@6 8
 * the terms of the GNU General Public License as published by the Free Software
paul@6 9
 * Foundation; either version 3 of the License, or (at your option) any later
paul@6 10
 * version.
paul@6 11
 *
paul@6 12
 * This program is distributed in the hope that it will be useful, but WITHOUT
paul@6 13
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
paul@6 14
 * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
paul@6 15
 * details.
paul@6 16
 *
paul@6 17
 * You should have received a copy of the GNU General Public License along with
paul@6 18
 * this program.  If not, see <http://www.gnu.org/licenses/>.
paul@6 19
 */
paul@6 20
paul@34 21
#ifdef CONFIG_CPU_JZ4730_MINIPC
paul@34 22
#include "board-minipc.h"
paul@34 23
#else
paul@18 24
#include "board-nanonote.h"
paul@34 25
#endif
paul@34 26
paul@15 27
#include "lcd.h"
paul@6 28
paul@6 29
void c_main(void)
paul@6 30
{
paul@54 31
	volatile int started;
paul@18 32
paul@18 33
	/* The actual work. */
paul@18 34
paul@54 35
	started = is_started();
paul@54 36
	if (!started) {
paul@54 37
		gpio_init2();
paul@54 38
		cpm_init();
paul@54 39
		rtc_init();
paul@54 40
		timer_init();
paul@54 41
	}
paul@15 42
	lcd_init();
paul@53 43
	while (1);
paul@6 44
}