move new files out from platform support patch
[openwrt/staging/yousong.git] / target / linux / ubicom32 / files / arch / ubicom32 / kernel / os_node.c
1 /*
2 * arch/ubicom32/kernel/os_node.c
3 * <TODO: Replace with short file description>
4 *
5 * (C) Copyright 2009, Ubicom, Inc.
6 *
7 * This file is part of the Ubicom32 Linux Kernel Port.
8 *
9 * The Ubicom32 Linux Kernel Port is free software: you can redistribute
10 * it and/or modify it under the terms of the GNU General Public License
11 * as published by the Free Software Foundation, either version 2 of the
12 * License, or (at your option) any later version.
13 *
14 * The Ubicom32 Linux Kernel Port is distributed in the hope that it
15 * will be useful, but WITHOUT ANY WARRANTY; without even the implied
16 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
17 * the GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with the Ubicom32 Linux Kernel Port. If not,
21 * see <http://www.gnu.org/licenses/>.
22 *
23 */
24 #include "linux/types.h"
25 #include "linux/linkage.h"
26 #include "linux/uts.h"
27 #include "linux/utsrelease.h"
28 #include "linux/version.h"
29 #include <asm/ocm_size.h>
30 #include <asm/devtree.h>
31 #include <asm/ip5000.h>
32
33 extern asmlinkage void *_start;
34
35 /*
36 * This file provides static information to the boot code allowing it to decide
37 * if the os is compatible. Thus hopefully enabling the boot code to prevent
38 * accidentally booting a kernel that has no hope of running.
39 */
40 struct os_node {
41 struct devtree_node node;
42 unsigned long version; /* Always 1 */
43 unsigned long entry_point;
44 const char os_name[32]; /* For diagnostic purposes only */
45 const char os_version_str[32];
46 unsigned long os_version_num;
47 unsigned long expected_ocm_code_start;/* OS Code */
48 unsigned long expected_ocm_data_end; /* OS Data */
49 unsigned long expected_ram_start;
50 unsigned long expected_ram_end;
51 unsigned long arch_version;
52 unsigned long expected_os_syscall_begin;
53 unsigned long expected_os_syscall_end;
54 };
55
56
57 extern void __os_syscall_begin;
58 extern void __os_syscall_end;
59 /*
60 * The os_node is only referenced by head.S and should never be modified at
61 * run-time.
62 */
63 asmlinkage const struct os_node _os_node = {
64 .node = {
65 .next = NULL,
66 .name = { "OS" },
67 .magic = 0x10203040,
68 },
69 .version = 0x10002,
70 .entry_point = (unsigned long)&_start,
71 #if APP_OCM_CODE_SIZE || APP_OCM_DATA_SIZE
72 .expected_ocm_code_start = OCMSTART + APP_OCM_CODE_SIZE,
73 .expected_ocm_data_end = OCMEND - APP_OCM_DATA_SIZE,
74 #else
75 .expected_ocm_code_start = OCMEND,
76 .expected_ocm_data_end = OCMEND,
77 #endif
78 .os_name = { UTS_SYSNAME },
79 .os_version_str = { UTS_RELEASE },
80 .os_version_num = LINUX_VERSION_CODE,
81 .expected_ram_start = KERNELSTART,
82 .expected_ram_end = SDRAMSTART + CONFIG_MIN_RAMSIZE,
83 .arch_version = UBICOM32_ARCH_VERSION,
84 .expected_os_syscall_begin = (unsigned long)&__os_syscall_begin,
85 .expected_os_syscall_end = (unsigned long)&__os_syscall_end,
86
87
88 };