aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel
diff options
context:
space:
mode:
authorPaul Mackerras <paulus@samba.org>2006-02-28 00:35:24 -0500
committerPaul Mackerras <paulus@samba.org>2006-02-28 00:35:24 -0500
commit6749c5507388f3fc3719f57a54b540ee83f6661a (patch)
treec069f990f86b020a14b50759d0c75475eedde186 /arch/powerpc/kernel
parent2cf82c0256b198ae28c465f2c4d7c12c836ea5ea (diff)
parent56ec6462af9cba56a04439154e5768672d6f390f (diff)
Merge ../powerpc-merge
Diffstat (limited to 'arch/powerpc/kernel')
-rw-r--r--arch/powerpc/kernel/prom.c54
-rw-r--r--arch/powerpc/kernel/vdso64/gettimeofday.S4
2 files changed, 40 insertions, 18 deletions
diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c
index 82d117c60d7f..d63cd562d9d5 100644
--- a/arch/powerpc/kernel/prom.c
+++ b/arch/powerpc/kernel/prom.c
@@ -816,8 +816,6 @@ void __init unflatten_device_tree(void)
816{ 816{
817 unsigned long start, mem, size; 817 unsigned long start, mem, size;
818 struct device_node **allnextp = &allnodes; 818 struct device_node **allnextp = &allnodes;
819 char *p = NULL;
820 int l = 0;
821 819
822 DBG(" -> unflatten_device_tree()\n"); 820 DBG(" -> unflatten_device_tree()\n");
823 821
@@ -853,19 +851,6 @@ void __init unflatten_device_tree(void)
853 if (of_chosen == NULL) 851 if (of_chosen == NULL)
854 of_chosen = of_find_node_by_path("/chosen@0"); 852 of_chosen = of_find_node_by_path("/chosen@0");
855 853
856 /* Retreive command line */
857 if (of_chosen != NULL) {
858 p = (char *)get_property(of_chosen, "bootargs", &l);
859 if (p != NULL && l > 0)
860 strlcpy(cmd_line, p, min(l, COMMAND_LINE_SIZE));
861 }
862#ifdef CONFIG_CMDLINE
863 if (l == 0 || (l == 1 && (*p) == 0))
864 strlcpy(cmd_line, CONFIG_CMDLINE, COMMAND_LINE_SIZE);
865#endif /* CONFIG_CMDLINE */
866
867 DBG("Command line is: %s\n", cmd_line);
868
869 DBG(" <- unflatten_device_tree()\n"); 854 DBG(" <- unflatten_device_tree()\n");
870} 855}
871 856
@@ -936,6 +921,8 @@ static int __init early_init_dt_scan_chosen(unsigned long node,
936{ 921{
937 u32 *prop; 922 u32 *prop;
938 unsigned long *lprop; 923 unsigned long *lprop;
924 unsigned long l;
925 char *p;
939 926
940 DBG("search \"chosen\", depth: %d, uname: %s\n", depth, uname); 927 DBG("search \"chosen\", depth: %d, uname: %s\n", depth, uname);
941 928
@@ -1000,6 +987,41 @@ static int __init early_init_dt_scan_chosen(unsigned long node,
1000 crashk_res.end = crashk_res.start + *lprop - 1; 987 crashk_res.end = crashk_res.start + *lprop - 1;
1001#endif 988#endif
1002 989
990 /* Retreive command line */
991 p = of_get_flat_dt_prop(node, "bootargs", &l);
992 if (p != NULL && l > 0)
993 strlcpy(cmd_line, p, min((int)l, COMMAND_LINE_SIZE));
994
995#ifdef CONFIG_CMDLINE
996 if (l == 0 || (l == 1 && (*p) == 0))
997 strlcpy(cmd_line, CONFIG_CMDLINE, COMMAND_LINE_SIZE);
998#endif /* CONFIG_CMDLINE */
999
1000 DBG("Command line is: %s\n", cmd_line);
1001
1002 if (strstr(cmd_line, "mem=")) {
1003 char *p, *q;
1004 unsigned long maxmem = 0;
1005
1006 for (q = cmd_line; (p = strstr(q, "mem=")) != 0; ) {
1007 q = p + 4;
1008 if (p > cmd_line && p[-1] != ' ')
1009 continue;
1010 maxmem = simple_strtoul(q, &q, 0);
1011 if (*q == 'k' || *q == 'K') {
1012 maxmem <<= 10;
1013 ++q;
1014 } else if (*q == 'm' || *q == 'M') {
1015 maxmem <<= 20;
1016 ++q;
1017 } else if (*q == 'g' || *q == 'G') {
1018 maxmem <<= 30;
1019 ++q;
1020 }
1021 }
1022 memory_limit = maxmem;
1023 }
1024
1003 /* break now */ 1025 /* break now */
1004 return 1; 1026 return 1;
1005} 1027}
@@ -1120,7 +1142,7 @@ static void __init early_reserve_mem(void)
1120 size_32 = *(reserve_map_32++); 1142 size_32 = *(reserve_map_32++);
1121 if (size_32 == 0) 1143 if (size_32 == 0)
1122 break; 1144 break;
1123 DBG("reserving: %lx -> %lx\n", base_32, size_32); 1145 DBG("reserving: %x -> %x\n", base_32, size_32);
1124 lmb_reserve(base_32, size_32); 1146 lmb_reserve(base_32, size_32);
1125 } 1147 }
1126 return; 1148 return;
diff --git a/arch/powerpc/kernel/vdso64/gettimeofday.S b/arch/powerpc/kernel/vdso64/gettimeofday.S
index ccaeda5136d1..4ee871f1cadb 100644
--- a/arch/powerpc/kernel/vdso64/gettimeofday.S
+++ b/arch/powerpc/kernel/vdso64/gettimeofday.S
@@ -225,9 +225,9 @@ V_FUNCTION_BEGIN(__do_get_xsec)
225 .cfi_startproc 225 .cfi_startproc
226 /* check for update count & load values */ 226 /* check for update count & load values */
2271: ld r8,CFG_TB_UPDATE_COUNT(r3) 2271: ld r8,CFG_TB_UPDATE_COUNT(r3)
228 andi. r0,r4,1 /* pending update ? loop */ 228 andi. r0,r8,1 /* pending update ? loop */
229 bne- 1b 229 bne- 1b
230 xor r0,r4,r4 /* create dependency */ 230 xor r0,r8,r8 /* create dependency */
231 add r3,r3,r0 231 add r3,r3,r0
232 232
233 /* Get TB & offset it */ 233 /* Get TB & offset it */