Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

sparc,leon: Introduce the sparc-leon CPU type.

Add sparc_leon enum, M_LEON|M_LEON3_SOC machine. Add compilation of
leon.c in mm and kernel
if CONFIG_SPARC_LEON is defined. Add sparc_leon dependent
initialization to switch statements + head.S.

Signed-off-by: Konrad Eisele <konrad@gaisler.com>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Konrad Eisele and committed by
David S. Miller
0fd7ef1f 97fb58fa

+43 -1
+5 -1
arch/sparc/include/asm/machines.h
··· 15 15 /* Current number of machines we know about that has an IDPROM 16 16 * machtype entry including one entry for the 0x80 OBP machines. 17 17 */ 18 - #define NUM_SUN_MACHINES 15 18 + #define NUM_SUN_MACHINES 16 19 19 20 20 /* The machine type in the idprom area looks like this: 21 21 * ··· 30 30 31 31 #define SM_ARCH_MASK 0xf0 32 32 #define SM_SUN4 0x20 33 + #define M_LEON 0x30 33 34 #define SM_SUN4C 0x50 34 35 #define SM_SUN4M 0x70 35 36 #define SM_SUN4M_OBP 0x80 ··· 41 40 #define SM_4_110 0x02 /* Sun 4/100 series */ 42 41 #define SM_4_330 0x03 /* Sun 4/300 series */ 43 42 #define SM_4_470 0x04 /* Sun 4/400 series */ 43 + 44 + /* Leon machines */ 45 + #define M_LEON3_SOC 0x02 /* Leon3 SoC */ 44 46 45 47 /* Sun4c machines Full Name - PROM NAME */ 46 48 #define SM_4C_SS1 0x01 /* Sun4c SparcStation 1 - Sun 4/60 */
+4
arch/sparc/include/asm/pgtsrmmu.h
··· 267 267 268 268 } 269 269 270 + #ifndef CONFIG_SPARC_LEON 270 271 static inline unsigned long srmmu_hwprobe(unsigned long vaddr) 271 272 { 272 273 unsigned long retval; ··· 279 278 280 279 return retval; 281 280 } 281 + #else 282 + #define srmmu_hwprobe(addr) (srmmu_swprobe(addr, 0) & SRMMU_PTE_PMASK) 283 + #endif 282 284 283 285 static inline int 284 286 srmmu_get_pte (unsigned long addr)
+3
arch/sparc/include/asm/prom.h
··· 118 118 extern char *of_console_path; 119 119 extern char *of_console_options; 120 120 121 + extern void (*prom_build_more)(struct device_node *dp, struct device_node ***nextp); 122 + extern char *build_full_name(struct device_node *dp); 123 + 121 124 #endif /* __KERNEL__ */ 122 125 #endif /* _SPARC_PROM_H */
+1
arch/sparc/include/asm/system_32.h
··· 32 32 sun4u = 0x05, /* V8 ploos ploos */ 33 33 sun_unknown = 0x06, 34 34 ap1000 = 0x07, /* almost a sun4m */ 35 + sparc_leon = 0x08, /* Leon SoC */ 35 36 }; 36 37 37 38 /* Really, userland should not be looking at any of this... */
+2
arch/sparc/kernel/Makefile
··· 41 41 obj-y += of_device_$(BITS).o 42 42 obj-$(CONFIG_SPARC64) += prom_irqtrans.o 43 43 44 + obj-$(CONFIG_SPARC_LEON)+= leon_kernel.o 45 + 44 46 obj-$(CONFIG_SPARC64) += reboot.o 45 47 obj-$(CONFIG_SPARC64) += sysfs.o 46 48 obj-$(CONFIG_SPARC64) += iommu.o
+5
arch/sparc/kernel/cpu.c
··· 312 312 313 313 psr = get_psr(); 314 314 put_psr(psr | PSR_EF); 315 + #ifdef CONFIG_SPARC_LEON 316 + fpu_vers = 7; 317 + #else 315 318 fpu_vers = ((get_fsr() >> 17) & 0x7); 319 + #endif 320 + 316 321 put_psr(psr); 317 322 318 323 set_cpu_and_fpu(psr_impl, psr_vers, fpu_vers);
+5
arch/sparc/kernel/head_32.S
··· 809 809 nop 810 810 811 811 got_prop: 812 + #ifdef CONFIG_SPARC_LEON 813 + /* no cpu-type check is needed, it is a SPARC-LEON */ 814 + ba sun4c_continue_boot 815 + nop 816 + #endif 812 817 set cputypval, %o2 813 818 ldub [%o2 + 0x4], %l1 814 819
+2
arch/sparc/kernel/idprom.c
··· 31 31 { .name = "Sun 4/200 Series", .id_machtype = (SM_SUN4 | SM_4_260) }, 32 32 { .name = "Sun 4/300 Series", .id_machtype = (SM_SUN4 | SM_4_330) }, 33 33 { .name = "Sun 4/400 Series", .id_machtype = (SM_SUN4 | SM_4_470) }, 34 + /* Now Leon */ 35 + { .name = "Leon3 System-on-a-Chip", .id_machtype = (M_LEON | M_LEON3_SOC) }, 34 36 /* Now, Sun4c's */ 35 37 { .name = "Sun4c SparcStation 1", .id_machtype = (SM_SUN4C | SM_4C_SS1) }, 36 38 { .name = "Sun4c SparcStation IPC", .id_machtype = (SM_SUN4C | SM_4C_IPC) },
+5
arch/sparc/kernel/irq_32.c
··· 45 45 #include <asm/pcic.h> 46 46 #include <asm/cacheflush.h> 47 47 #include <asm/irq_regs.h> 48 + #include <asm/leon.h> 48 49 49 50 #include "kernel.h" 50 51 #include "irq.h" ··· 660 659 661 660 case sun4d: 662 661 sun4d_init_IRQ(); 662 + break; 663 + 664 + case sparc_leon: 665 + leon_init_IRQ(); 663 666 break; 664 667 665 668 default:
+5
arch/sparc/kernel/setup_32.c
··· 235 235 sparc_cpu_model = sun4e; 236 236 if (!strcmp(&cputypval,"sun4u")) 237 237 sparc_cpu_model = sun4u; 238 + if (!strncmp(&cputypval, "leon" , 4)) 239 + sparc_cpu_model = sparc_leon; 238 240 239 241 printk("ARCH: "); 240 242 switch(sparc_cpu_model) { ··· 257 255 break; 258 256 case sun4u: 259 257 printk("SUN4U\n"); 258 + break; 259 + case sparc_leon: 260 + printk("LEON\n"); 260 261 break; 261 262 default: 262 263 printk("UNKNOWN!\n");
+1
arch/sparc/mm/Makefile
··· 11 11 obj-y += generic_$(BITS).o 12 12 obj-$(CONFIG_SPARC32) += extable.o btfixup.o srmmu.o iommu.o io-unit.o 13 13 obj-$(CONFIG_SPARC32) += hypersparc.o viking.o tsunami.o swift.o 14 + obj-$(CONFIG_SPARC_LEON)+= leon_mm.o 14 15 15 16 # Only used by sparc64 16 17 obj-$(CONFIG_HUGETLB_PAGE) += hugetlbpage.o
+4
arch/sparc/mm/init_32.c
··· 34 34 #include <asm/pgalloc.h> /* bug in asm-generic/tlb.h: check_pgt_cache */ 35 35 #include <asm/tlb.h> 36 36 #include <asm/prom.h> 37 + #include <asm/leon.h> 37 38 38 39 DEFINE_PER_CPU(struct mmu_gather, mmu_gathers); 39 40 ··· 327 326 sparc_unmapped_base = 0xe0000000; 328 327 BTFIXUPSET_SETHI(sparc_unmapped_base, 0xe0000000); 329 328 break; 329 + case sparc_leon: 330 + leon_init(); 331 + /* fall through */ 330 332 case sun4m: 331 333 case sun4d: 332 334 srmmu_paging_init();
+1
arch/sparc/mm/loadmmu.c
··· 33 33 break; 34 34 case sun4m: 35 35 case sun4d: 36 + case sparc_leon: 36 37 ld_mmu_srmmu(); 37 38 break; 38 39 default: