summaryrefslogtreecommitdiff
path: root/firmware/target/hosted/samsungypr/ypr1/system-ypr1.c
diff options
context:
space:
mode:
authorLorenzo Miori <memoryS60@gmail.com>2013-09-10 22:48:34 +0200
committerThomas Martitz <kugel@rockbox.org>2014-02-05 09:56:21 +0100
commite876f4df6d240bd2e319b1e63be95a625f049a97 (patch)
treece2fe1b24650e3be7a6cd2d346d29090a5422a8c /firmware/target/hosted/samsungypr/ypr1/system-ypr1.c
parentb828b9d99bff2acc0e1f543f3176fd4b632cba68 (diff)
downloadrockbox-e876f4df6d240bd2e319b1e63be95a625f049a97.tar.gz
rockbox-e876f4df6d240bd2e319b1e63be95a625f049a97.zip
Samsung YP-R1 target port
This is the basic port to the new target Samsung YP-R1, which runs on a similar platform as YP-R0. Port is usable, although there are still some optimizations that have to be done. Change-Id: If83a8e386369e413581753780c159026d9e41f04
Diffstat (limited to 'firmware/target/hosted/samsungypr/ypr1/system-ypr1.c')
-rw-r--r--firmware/target/hosted/samsungypr/ypr1/system-ypr1.c67
1 files changed, 67 insertions, 0 deletions
diff --git a/firmware/target/hosted/samsungypr/ypr1/system-ypr1.c b/firmware/target/hosted/samsungypr/ypr1/system-ypr1.c
new file mode 100644
index 0000000000..d0cbddc55a
--- /dev/null
+++ b/firmware/target/hosted/samsungypr/ypr1/system-ypr1.c
@@ -0,0 +1,67 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 *
9 * Copyright (C) 2013 Lorenzo Miori
10 *
11 * This program is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public License
13 * as published by the Free Software Foundation; either version 2
14 * of the License, or (at your option) any later version.
15 *
16 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
17 * KIND, either express or implied.
18 *
19 ****************************************************************************/
20
21#include <stdlib.h>
22#include <string.h>
23#include <inttypes.h>
24#include "system.h"
25#include "panic.h"
26#include "debug.h"
27
28#include "gpio-target.h"
29#include "pmu-ypr1.h"
30#include "ioctl-ypr1.h"
31#include "audiohw.h"
32#include "button-target.h"
33
34void power_off(void)
35{
36 /* Something that we need to do before exit on our platform */
37 pmu_close();
38 max17040_close();
39 button_close_device();
40 gpio_close();
41 exit(EXIT_SUCCESS);
42}
43
44uintptr_t *stackbegin;
45uintptr_t *stackend;
46void system_init(void)
47{
48 int *s;
49 /* fake stack, OS manages size (and growth) */
50 stackbegin = stackend = (uintptr_t*)&s;
51
52 /* Here begins our platform specific initilization for various things */
53 audiohw_init();
54 gpio_init();
55 max17040_init();
56 pmu_init();
57}
58
59void system_reboot(void)
60{
61 power_off();
62}
63
64void system_exception_wait(void)
65{
66 system_reboot();
67}