Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
  • 5 commits
  • 15 files changed
  • 0 comments
  • 1 contributor
Jul 24, 2011
Michael Walle lm32: lm32 has no dma capabilities
Remove DMA stuff, instead use generic dma 'broken' header files.
408d2f2
Michael Walle lm32: support for simpleImage 41046e6
Michael Walle lm32: move dtb section definition
Define dtb section symbols in sections.h.
15ebf01
Jul 25, 2011
Michael Walle lm32: add a more complete MM1 device tree 037fe16
Michael Walle lm32: split arch setup
Move device tree functions into prom.c and platform initialization into
platform.c. Be consistent with other architectures.
aaa25ab
4  arch/lm32/Kconfig
@@ -17,6 +17,10 @@ config MMU
17 17
 	bool
18 18
 	default n
19 19
 
  20
+config NO_DMA
  21
+	bool
  22
+	default y
  23
+
20 24
 config VGA_CONSOLE
21 25
 	bool
22 26
 	default n
33  arch/lm32/Makefile
@@ -39,11 +39,36 @@ OBJCOPYFLAGS	:=-O binary -R .note -R .comment -S
39 39
 head-y := arch/lm32/kernel/head.o arch/lm32/kernel/init_task.o
40 40
 
41 41
 core-y	+= arch/lm32/
42  
-core-y	+= arch/lm32/boot/
43 42
 libs-y	+= arch/lm32/lib/
44 43
 
  44
+boot := arch/lm32/boot
  45
+
  46
+# Are we making a simpleImage.<boardname> target? If so, crack out the boardname
  47
+DTB:=$(subst simpleImage.,,$(filter simpleImage.%, $(MAKECMDGOALS)))
  48
+
  49
+ifneq ($(DTB),)
  50
+	core-y  += $(boot)/
  51
+endif
  52
+
  53
+export DTB
  54
+
45 55
 vmlinux.bin: vmlinux
46  
-	$(OBJCOPY) $(OBJCOPYFLAGS) $< $@
  56
+	$(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
  57
+
  58
+simpleImage.%: vmlinux
  59
+	$(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
  60
+
  61
+%.dtb:
  62
+	$(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
  63
+
  64
+archclean:
  65
+	@$(MAKE) $(clean)=$(boot)
  66
+
  67
+define archhelp
  68
+	echo '  vmlinux.bin          - Raw binary boot image'
  69
+	echo '  simpleImage.<dt>     - Raw binary boot image'
  70
+	echo
  71
+	echo '  These will be default as apropriate for a configured platform.'
  72
+endef
47 73
 
48  
-vmlinux.gz: vmlinux.bin
49  
-	cat $< |gzip >$@
  74
+MRPROPER_FILES += $(boot)/simpleImage.*
26  arch/lm32/boot/Makefile
... ...
@@ -1,7 +1,29 @@
1  
-obj-y += mm1.dtb.o
  1
+#
  2
+# arch/lm32/boot/Makefile
  3
+#
  4
+# This file is subject to the terms and conditions of the GNU General Public
  5
+# License.  See the file "COPYING" in the main directory of this archive
  6
+# for more details.
  7
+#
2 8
 
3  
-clean-files := *.dtb.S
  9
+targets        := vmlinux.bin
4 10
 
  11
+ifneq ($(DTB),)
  12
+obj-y += $(DTB).dtb.o
  13
+endif
  14
+
  15
+quiet_cmd_cp = CP      $< $@$2
  16
+      cmd_cp = cat $< >$@$2 || (rm -f $@ && echo false)
  17
+
  18
+$(obj)/simpleImage.%: vmlinux FORCE
  19
+	$(call if_changed,objcopy)
  20
+
  21
+$(obj)/vmlinux.bin: vmlinux FORCE
  22
+	$(call if_changed,objcopy)
  23
+	@echo 'Kernel: $@ is ready' ' (#'`cat .version`')'
  24
+
  25
+# Rule to build device tree blobs
5 26
 $(obj)/%.dtb: $(src)/dts/%.dts
6 27
 	$(call cmd,dtc)
7 28
 
  29
+clean-files += vmlinux.bin *.dtb.S
194  arch/lm32/boot/dts/milkymist_one.dts
... ...
@@ -0,0 +1,194 @@
  1
+/* Device Tree Source for Milkymist One
  2
+ *
  3
+ * Author: Michael Walle <michael@walle.cc>
  4
+ *
  5
+ * This program is free software; you can redistribute it and/or modify it
  6
+ * under the terms of the GNU General Public License version 2 as published
  7
+ * by the Free Software Foundation.
  8
+ */
  9
+
  10
+/dts-v1/;
  11
+
  12
+/ {
  13
+	#address-cells = <1>;
  14
+	#size-cells = <1>;
  15
+	model = "One";
  16
+	compatible = "milkymist,one";
  17
+
  18
+	cpus {
  19
+		#address-cells = <1>;
  20
+		#size-cells = <0>;
  21
+
  22
+		cpu@0 {
  23
+			device_type = "cpu";
  24
+			compatible = "lattice,mico32";
  25
+			reg = <0>;
  26
+			clock-frequency = <83333333>;	/* 83.3333 MHz */
  27
+			i-cache-line-size = <16>;
  28
+			d-cache-line-size = <16>;
  29
+			i-cache-size = <4096>;
  30
+			d-cache-size = <4096>;
  31
+
  32
+			pic: pic {
  33
+				#interrupt-cells = <1>;
  34
+				#address-cells = <0>;
  35
+				compatible = "lattice,mico32-pic";
  36
+				interrupt-controller;
  37
+			};
  38
+		};
  39
+	};
  40
+
  41
+	memory@40000000 {
  42
+		device_type = "memory";
  43
+		reg = <0x40000000 0x08000000>;	/* 128MB */
  44
+	};
  45
+
  46
+	flash@0 {
  47
+		compatible = "cfi-flash";
  48
+		reg = <0x80000000 0x02000000>;	/* 32MB */
  49
+		bank-width = <4>;
  50
+		device-width = <1>;
  51
+		#address-cells = <1>;
  52
+		#size-cells = <1>;
  53
+		partition@0 {
  54
+			label = "bitstream";
  55
+			reg = <0x00000000 0x00180000>;
  56
+			read-only;
  57
+		};
  58
+		partition@180000 {
  59
+			label = "unused";
  60
+			reg = <0x000a0000 0x02360000>;
  61
+			read-only;
  62
+		};
  63
+	};
  64
+
  65
+	softusb@0 {
  66
+		reg = <0xa0000000 0x02000000>;
  67
+	};
  68
+
  69
+	csr-bus@e0000000 {
  70
+		#address-cells = <1>;
  71
+		#size-cells = <1>;
  72
+		ranges = <0x0 0xe0000000 0x100000>;
  73
+		compatible = "milkymist,csr-bus";
  74
+
  75
+		uart@0 {
  76
+			device_type = "serial";
  77
+			compatible = "milkymist,uart";
  78
+			clock-frequency = <83333333>;
  79
+			reg = <0x0 0x1000>;
  80
+			interrupts = <0 1>;
  81
+			interrupt-parent = <&pic>;
  82
+		};
  83
+
  84
+		sysctl: sysctl@1000 {
  85
+			compatible = "milkymist,sysctl";
  86
+			reg = <0x1000 0x1000>;
  87
+			interrupts = <2 3 4>;
  88
+			#gpio-cells = <2>;
  89
+			gpio-controller;
  90
+			num-gpi = <7>;
  91
+			num-gpo = <2>;
  92
+		};
  93
+
  94
+		gpio-leds {
  95
+			compatible = "gpio-leds";
  96
+			led1 {
  97
+				gpios = <&sysctl 0 0>;
  98
+				default-state = "keep";
  99
+			};
  100
+			led2 {
  101
+				gpios = <&sysctl 1 0>;
  102
+				default-state = "keep";
  103
+			};
  104
+		};
  105
+
  106
+		memctrl@2000 {
  107
+			compatible = "milkymist,hpdmc";
  108
+			reg = <0x2000 0x1000>;
  109
+		};
  110
+
  111
+		vgafb@3000 {
  112
+			compatible = "milkymist,vgafb";
  113
+			reg = <0x3000 0x1000>;
  114
+			video-mem-size = <1572864>; /* 1024*768*2 */
  115
+		};
  116
+
  117
+		memcard@4000 {
  118
+			compatible = "milkymist,memcard";
  119
+			reg = <0x4000 0x1000>;
  120
+		};
  121
+
  122
+		ac97@5000 {
  123
+			compatible = "milkymist,ac97";
  124
+			reg = <0x5000 0x1000>;
  125
+			interrupts = <5 6 7 8>;
  126
+			interrupt-parent = <&pic>;
  127
+		};
  128
+
  129
+		pfpu@6000 {
  130
+			compatible = "milkymist,pfpu";
  131
+			reg = <0x6000 0x1000>;
  132
+			interrupts = <9>;
  133
+			interrupt-parent = <&pic>;
  134
+		};
  135
+
  136
+		tmu@7000 {
  137
+			compatible = "milkymist,tmu2";
  138
+			reg = <0x7000 0x1000>;
  139
+			interrupts = <10>;
  140
+			interrupt-parent = <&pic>;
  141
+		};
  142
+
  143
+		ethernet@8000 {
  144
+			#address-cells = <1>;
  145
+			#size-cells = <0>;
  146
+			compatible = "milkymist,minimac2";
  147
+			reg = <0x8000 0x1000>;
  148
+			interrupts = <11 12>;
  149
+			interrupt-parent = <&pic>;
  150
+
  151
+			phy0: ethernet-phy@0 {
  152
+				device_type = "ethernet-phy";
  153
+				reg = <0>;
  154
+				phy = <&phy0>;
  155
+				local-mac-address = [ 00 00 00 00 00 00 ];
  156
+			};
  157
+		};
  158
+
  159
+		video-capture@a000 {
  160
+			compatible = "milkymist,bt656cap";
  161
+			reg = <0xa000 0x1000>;
  162
+			interrupts = <13>;
  163
+			interrupt-parent = <&pic>;
  164
+		};
  165
+
  166
+		midi@b000 {
  167
+			compatible = "milkymist,midi";
  168
+			reg = <0xb000 0x1000>;
  169
+			interrupts = <14 15>;
  170
+			interrupt-parent = <&pic>;
  171
+		};
  172
+
  173
+		dmx@c000 {
  174
+			compatible = "milkymist,dmx";
  175
+			reg = <0xc000 0x2000>;
  176
+		};
  177
+
  178
+		ir-receiver@e000 {
  179
+			compatible = "milkymist,rc5";
  180
+			reg = <0xe000 0x1000>;
  181
+			interrupts = <16>;
  182
+			interrupt-parent = <&pic>;
  183
+		};
  184
+
  185
+		usb-ctrl@f000 {
  186
+			compatible = "milkymist,softusb";
  187
+			reg = <0xf000 0x1000>;
  188
+			interrupts = <17>;
  189
+			interrupt-parent = <&pic>;
  190
+		};
  191
+	};
  192
+	chosen {
  193
+	};
  194
+};
1  arch/lm32/configs/test_defconfig
@@ -853,5 +853,4 @@ CONFIG_ZLIB_INFLATE=y
853 853
 CONFIG_ZLIB_DEFLATE=y
854 854
 CONFIG_DECOMPRESS_GZIP=y
855 855
 CONFIG_HAS_IOMEM=y
856  
-CONFIG_HAS_DMA=y
857 856
 CONFIG_NLATTR=y
1  arch/lm32/defconfig
@@ -793,5 +793,4 @@ CONFIG_ZLIB_INFLATE=y
793 793
 CONFIG_ZLIB_DEFLATE=y
794 794
 CONFIG_DECOMPRESS_GZIP=y
795 795
 CONFIG_HAS_IOMEM=y
796  
-CONFIG_HAS_DMA=y
797 796
 CONFIG_NLATTR=y
87  arch/lm32/include/asm/dma-mapping.h
... ...
@@ -1,91 +1,6 @@
1 1
 #ifndef _ASM_LM32_DMA_MAPPING_H
2 2
 #define _ASM_LM32_DMA_MAPPING_H
3 3
 
4  
-extern struct dma_map_ops *dma_ops;
5  
-extern void no_iommu_init(void);
6  
-
7  
-static inline struct dma_map_ops *get_dma_ops(struct device *dev)
8  
-{
9  
-	return dma_ops;
10  
-}
11  
-
12  
-#include <asm-generic/dma-coherent.h>
13  
-#include <asm-generic/dma-mapping-common.h>
14  
-
15  
-static inline int dma_supported(struct device *dev, u64 mask)
16  
-{
17  
-	struct dma_map_ops *ops = get_dma_ops(dev);
18  
-
19  
-	if (ops->dma_supported)
20  
-		return ops->dma_supported(dev, mask);
21  
-
22  
-	return 1;
23  
-}
24  
-
25  
-static inline int dma_set_mask(struct device *dev, u64 mask)
26  
-{
27  
-	struct dma_map_ops *ops = get_dma_ops(dev);
28  
-
29  
-	if (!dev->dma_mask || !dma_supported(dev, mask))
30  
-		return -EIO;
31  
-	if (ops->set_dma_mask)
32  
-		return ops->set_dma_mask(dev, mask);
33  
-
34  
-	*dev->dma_mask = mask;
35  
-
36  
-	return 0;
37  
-}
38  
-
39  
-void dma_cache_sync(struct device *dev, void *vaddr, size_t size,
40  
-		    enum dma_data_direction dir);
41  
-
42  
-#define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f)
43  
-#define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h)
44  
-
45  
-static inline int dma_mapping_error(struct device *dev, dma_addr_t dma_addr)
46  
-{
47  
-	struct dma_map_ops *ops = get_dma_ops(dev);
48  
-
49  
-	if (ops->mapping_error)
50  
-		return ops->mapping_error(dev, dma_addr);
51  
-
52  
-	return dma_addr == 0;
53  
-}
54  
-
55  
-static inline void *dma_alloc_coherent(struct device *dev, size_t size,
56  
-				       dma_addr_t *dma_handle, gfp_t gfp)
57  
-{
58  
-	struct dma_map_ops *ops = get_dma_ops(dev);
59  
-	void *memory;
60  
-
61  
-	if (dma_alloc_from_coherent(dev, size, dma_handle, &memory))
62  
-		return memory;
63  
-	if (!ops->alloc_coherent)
64  
-		return NULL;
65  
-
66  
-	memory = ops->alloc_coherent(dev, size, dma_handle, gfp);
67  
-	debug_dma_alloc_coherent(dev, size, *dma_handle, memory);
68  
-
69  
-	return memory;
70  
-}
71  
-
72  
-static inline void dma_free_coherent(struct device *dev, size_t size,
73  
-				     void *vaddr, dma_addr_t dma_handle)
74  
-{
75  
-	struct dma_map_ops *ops = get_dma_ops(dev);
76  
-
77  
-	if (dma_release_from_coherent(dev, get_order(size), vaddr))
78  
-		return;
79  
-
80  
-	debug_dma_free_coherent(dev, size, vaddr, dma_handle);
81  
-	if (ops->free_coherent)
82  
-		ops->free_coherent(dev, size, vaddr, dma_handle);
83  
-}
84  
-
85  
-/* arch/sh/mm/consistent.c */
86  
-extern void *dma_generic_alloc_coherent(struct device *dev, size_t size,
87  
-					dma_addr_t *dma_addr, gfp_t flag);
88  
-extern void dma_generic_free_coherent(struct device *dev, size_t size,
89  
-				      void *vaddr, dma_addr_t dma_handle);
  4
+#include <asm-generic/dma-mapping-broken.h>
90 5
 
91 6
 #endif /* _ASM_LM32_DMA_MAPPING_H */
17  arch/lm32/include/asm/prom.h
... ...
@@ -0,0 +1,17 @@
  1
+/*
  2
+ *  arch/lm32/include/asm/prom.h
  3
+ *
  4
+ * This program is free software; you can redistribute it and/or modify
  5
+ * it under the terms of the GNU General Public License version 2 as
  6
+ * published by the Free Software Foundation.
  7
+ *
  8
+ */
  9
+#ifndef __ASM_LM32_PROM_H
  10
+#define __ASM_LM32_PROM_H
  11
+
  12
+#ifdef CONFIG_OF
  13
+void device_tree_init(void);
  14
+#endif /* CONFIG_OF */
  15
+
  16
+#endif /* __ASM_LM32_PROM_H */
  17
+
1  arch/lm32/include/asm/sections.h
@@ -5,6 +5,7 @@
5 5
 
6 6
 #ifndef __ASSEMBLY__
7 7
 extern char __exception_text_start[], __exception_text_end[];
  8
+extern char __dtb_start[], __dtb_end[];
8 9
 #endif /* __ASSEMBLY__ */
9 10
 
10 11
 #endif /* _ASM_LM32_SECTIONS_H */
15  arch/lm32/include/asm/setup.h
... ...
@@ -0,0 +1,15 @@
  1
+#ifndef _ASM_LM32_SETUP_H
  2
+#define _ASM_LM32_SETUP_H
  3
+
  4
+#include <asm-generic/setup.h>
  5
+
  6
+#ifndef __ASSEMBLY__
  7
+#ifdef __KERNEL__
  8
+
  9
+extern char cmd_line[COMMAND_LINE_SIZE];
  10
+extern unsigned int cpu_frequency;
  11
+
  12
+#endif /* __KERNEL__ */
  13
+#endif /* !__ASSEMLBLY__ */
  14
+
  15
+#endif /* _ASM_LM32_SETUP_H */
5  arch/lm32/kernel/Makefile
@@ -5,8 +5,9 @@
5 5
 extra-y := head.o init_task.o vmlinux.lds
6 6
 obj-y := \
7 7
 	sys_lm32.o setup.o traps.o signal.o time.o \
8  
-	ptrace.o irq.o process.o entry.o dma.o gpio.o \
9  
-	flat.o sys_call_table.o cpuinfo.o
  8
+	ptrace.o irq.o process.o entry.o gpio.o \
  9
+	flat.o sys_call_table.o cpuinfo.o prom.o \
  10
+	platform.o
10 11
 
11 12
 obj-$(CONFIG_EARLY_PRINTK)  += early_printk.o
12 13
 obj-$(CONFIG_MODULES)       += module.o
14  arch/lm32/kernel/dma.c
... ...
@@ -1,14 +0,0 @@
1  
-/*
2  
- * Dynamic DMA mapping support.
3  
- *
4  
- * We never have any address translations to worry about, so this
5  
- * is just alloc/free.
6  
- */
7  
-
8  
-#include <linux/types.h>
9  
-#include <linux/mm.h>
10  
-#include <linux/device.h>
11  
-#include <linux/dma-mapping.h>
12  
-#include <asm/cacheflush.h>
13  
-
14  
-struct dma_map_ops *dma_ops;
16  arch/lm32/kernel/platform.c
... ...
@@ -0,0 +1,16 @@
  1
+/*
  2
+ * This file is licensed under the terms of the GNU General Public License
  3
+ * version 2. This program is licensed "as is" without any warranty of any
  4
+ * kind, whether express or implied.
  5
+ */
  6
+#include <linux/kernel.h>
  7
+#include <linux/of_platform.h>
  8
+
  9
+static int __init lm32_device_probe(void)
  10
+{
  11
+	of_platform_populate(NULL, NULL, NULL);
  12
+	//of_platform_reset_gpio_probe();
  13
+
  14
+	return 0;
  15
+}
  16
+arch_initcall(lm32_device_probe);
87  arch/lm32/kernel/prom.c
... ...
@@ -0,0 +1,87 @@
  1
+/*
  2
+ * Procedures for creating, accessing and interpreting the device tree.
  3
+ */
  4
+
  5
+#include <linux/kernel.h>
  6
+#include <linux/string.h>
  7
+#include <linux/init.h>
  8
+#include <linux/of.h>
  9
+#include <linux/of_fdt.h>
  10
+#include <linux/of_platform.h>
  11
+#include <linux/bootmem.h>
  12
+#include <linux/initrd.h>
  13
+#include <linux/memblock.h>
  14
+#include <asm/setup.h>
  15
+
  16
+int __init early_init_dt_scan_memory_arch(unsigned long node,
  17
+					  const char *uname, int depth,
  18
+					  void *data)
  19
+{
  20
+	return early_init_dt_scan_memory(node, uname, depth, data);
  21
+}
  22
+
  23
+void __init early_init_dt_add_memory_arch(u64 base, u64 size)
  24
+{
  25
+}
  26
+
  27
+void * __init early_init_dt_alloc_memory_arch(u64 size, u64 align)
  28
+{
  29
+	return __alloc_bootmem(size, align, 0);
  30
+}
  31
+
  32
+#ifdef CONFIG_BLK_DEV_INITRD
  33
+void __init early_init_dt_setup_initrd_arch(unsigned long start,
  34
+		unsigned long end)
  35
+{
  36
+	initrd_start = (unsigned long)__va(start);
  37
+	initrd_end = (unsigned long)__va(end);
  38
+	initrd_below_start_ok = 1;
  39
+}
  40
+#endif
  41
+
  42
+void __init early_init_devtree(void *params)
  43
+{
  44
+	/* Setup flat device-tree pointer */
  45
+	initial_boot_params = params;
  46
+
  47
+	/* Retrieve various informations from the /chosen node of the
  48
+	 * device-tree, including the platform type, initrd location and
  49
+	 * size, and more ...
  50
+	 */
  51
+	of_scan_flat_dt(early_init_dt_scan_chosen, cmd_line);
  52
+
  53
+	/* Scan memory nodes */
  54
+	of_scan_flat_dt(early_init_dt_scan_root, NULL);
  55
+	of_scan_flat_dt(early_init_dt_scan_memory_arch, NULL);
  56
+}
  57
+
  58
+void __init device_tree_init(void)
  59
+{
  60
+	unsigned long base, size;
  61
+	struct device_node *cpu;
  62
+	int ret;
  63
+
  64
+	if (!initial_boot_params)
  65
+		return;
  66
+
  67
+	base = __pa(initial_boot_params);
  68
+	size = be32_to_cpu(initial_boot_params->totalsize);
  69
+
  70
+	/* Before we do anything, lets reserve the dt blob */
  71
+	memblock_reserve(base, size);
  72
+
  73
+	unflatten_device_tree();
  74
+
  75
+	/* free the space reserved for the dt blob */
  76
+	memblock_free(base, size);
  77
+
  78
+	cpu = of_find_compatible_node(NULL, NULL, "lattice,lm32");
  79
+	if (!cpu)
  80
+		panic("No compatible CPU found in device tree\n");
  81
+
  82
+	ret = of_property_read_u32(cpu, "clock-frequency", &cpu_frequency);
  83
+	if (ret)
  84
+		cpu_frequency = (unsigned long)CONFIG_CPU_CLOCK;
  85
+
  86
+	of_node_put(cpu);
  87
+}
91  arch/lm32/kernel/setup.c
@@ -48,10 +48,11 @@
48 48
 #include <asm/sections.h>
49 49
 #include <asm/pgtable.h>
50 50
 #include <asm/page.h>
  51
+#include <asm/setup.h>
51 52
 
52 53
 unsigned int kernel_mode = PT_MODE_KERNEL;
53 54
 
54  
-static char __initdata cmd_line[COMMAND_LINE_SIZE];
  55
+char cmd_line[COMMAND_LINE_SIZE];
55 56
 
56 57
 extern void setup_early_printk(void);
57 58
 
@@ -60,85 +61,6 @@ extern void bootmem_init(void);
60 61
 
61 62
 unsigned int cpu_frequency;
62 63
 
63  
-int __init early_init_dt_scan_memory_arch(unsigned long node,
64  
-					  const char *uname, int depth,
65  
-					  void *data)
66  
-{
67  
-	return early_init_dt_scan_memory(node, uname, depth, data);
68  
-}
69  
-
70  
-void __init early_init_dt_add_memory_arch(u64 base, u64 size)
71  
-{
72  
-	memblock_add(base, size);
73  
-}
74  
-
75  
-void * __init early_init_dt_alloc_memory_arch(u64 size, u64 align)
76  
-{
77  
-/*	return __va(memblock_alloc(size, align));*/
78  
-	return __alloc_bootmem(size, align, 0);
79  
-}
80  
-
81  
-#ifdef CONFIG_BLK_DEV_INITRD
82  
-void __init early_init_dt_setup_initrd_arch(unsigned long start,
83  
-					    unsigned long end)
84  
-{
85  
-	initrd_start = (unsigned long)__va(start);
86  
-	initrd_end = (unsigned long)__va(end);
87  
-	initrd_below_start_ok = 1;
88  
-}
89  
-#endif
90  
-
91  
-void __init early_init_devtree(void *params)
92  
-{
93  
-	/* Setup flat device-tree pointer */
94  
-	initial_boot_params = params;
95  
-
96  
-	/* Retrieve various informations from the /chosen node of the
97  
-	 * device-tree, including the platform type, initrd location and
98  
-	 * size, and more ...
99  
-	 */
100  
-	of_scan_flat_dt(early_init_dt_scan_chosen, cmd_line);
101  
-
102  
-	/* Scan memory nodes */
103  
-	memblock_init();
104  
-	of_scan_flat_dt(early_init_dt_scan_root, NULL);
105  
-	of_scan_flat_dt(early_init_dt_scan_memory_arch, NULL);
106  
-	memblock_analyze();
107  
-}
108  
-
109  
-static void __init device_tree_init(void)
110  
-{
111  
-	unsigned long base, size;
112  
-	struct device_node *cpu;
113  
-	int ret;
114  
-
115  
-	if (!initial_boot_params)
116  
-		return;
117  
-
118  
-	base = __pa(initial_boot_params);
119  
-	size = be32_to_cpu(initial_boot_params->totalsize);
120  
-
121  
-	/* Before we do anything, lets reserve the dt blob */
122  
-	memblock_reserve(base, size);
123  
-
124  
-	unflatten_device_tree();
125  
-
126  
-	/* free the space reserved for the dt blob */
127  
-	memblock_free(base, size);
128  
-
129  
-	cpu = of_find_compatible_node(NULL, NULL, "lattice,lm32");
130  
-	if (!cpu)
131  
-		panic("No compatible CPU found in device tree\n");
132  
-
133  
-	ret = of_property_read_u32(cpu, "clock-frequency", &cpu_frequency);
134  
-	if (ret)
135  
-		cpu_frequency = (unsigned long)CONFIG_CPU_CLOCK;
136  
-
137  
-	of_node_put(cpu);
138  
-}
139  
-
140  
-extern char __dtb_start[];
141  
-
142 64
 void __init machine_early_init(char *cmdline, unsigned long p_initrd_start,
143 65
 		unsigned long p_initrd_end)
144 66
 {
@@ -190,12 +112,3 @@ void __init setup_arch(char **cmdline_p)
190 112
 	 */
191 113
 	paging_init();
192 114
 }
193  
-
194  
-static int __init lm32_device_probe(void)
195  
-{
196  
-	of_platform_populate(NULL, NULL, NULL);
197  
-
198  
-	return 0;
199  
-}
200  
-arch_initcall(lm32_device_probe);
201  
-

No commit comments for this range

Something went wrong with that request. Please try again.