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

parisc: Show machine product number during boot

Ask PDC firmware during boot for the original and current product
number as well as the serial number and show it (if available).

Signed-off-by: Helge Deller <deller@gmx.de>

+34
+1
arch/parisc/include/asm/pdc.h
··· 44 44 int pdc_model_cpuid(unsigned long *cpu_id); 45 45 int pdc_model_versions(unsigned long *versions, int id); 46 46 int pdc_model_capabilities(unsigned long *capabilities); 47 + int pdc_model_platform_info(char *orig_prod_num, char *current_prod_num, char *serial_no); 47 48 int pdc_cache_info(struct pdc_cache_info *cache); 48 49 int pdc_spaceid_bits(unsigned long *space_bits); 49 50 #ifndef CONFIG_PA20
+24
arch/parisc/kernel/firmware.c
··· 569 569 } 570 570 571 571 /** 572 + * pdc_model_platform_info - Returns machine product and serial number. 573 + * @orig_prod_num: Return buffer for original product number. 574 + * @current_prod_num: Return buffer for current product number. 575 + * @serial_no: Return buffer for serial number. 576 + * 577 + * Returns strings containing the original and current product numbers and the 578 + * serial number of the system. 579 + */ 580 + int pdc_model_platform_info(char *orig_prod_num, char *current_prod_num, 581 + char *serial_no) 582 + { 583 + int retval; 584 + unsigned long flags; 585 + 586 + spin_lock_irqsave(&pdc_lock, flags); 587 + retval = mem_pdc_call(PDC_MODEL, PDC_MODEL_GET_PLATFORM_INFO, 588 + __pa(orig_prod_num), __pa(current_prod_num), __pa(serial_no)); 589 + convert_to_wide(pdc_result); 590 + spin_unlock_irqrestore(&pdc_lock, flags); 591 + 592 + return retval; 593 + } 594 + 595 + /** 572 596 * pdc_cache_info - Return cache and TLB information. 573 597 * @cache_info: The return buffer. 574 598 *
+9
arch/parisc/kernel/processor.c
··· 242 242 void __init collect_boot_cpu_data(void) 243 243 { 244 244 unsigned long cr16_seed; 245 + char orig_prod_num[64], current_prod_num[64], serial_no[64]; 245 246 246 247 memset(&boot_cpu_data, 0, sizeof(boot_cpu_data)); 247 248 ··· 302 301 _parisc_requires_coherency = (boot_cpu_data.cpu_type == mako) || 303 302 (boot_cpu_data.cpu_type == mako2); 304 303 #endif 304 + 305 + if (pdc_model_platform_info(orig_prod_num, current_prod_num, serial_no) == PDC_OK) { 306 + printk(KERN_INFO "product %s, original product %s, S/N: %s\n", 307 + current_prod_num, orig_prod_num, serial_no); 308 + add_device_randomness(orig_prod_num, strlen(orig_prod_num)); 309 + add_device_randomness(current_prod_num, strlen(current_prod_num)); 310 + add_device_randomness(serial_no, strlen(serial_no)); 311 + } 305 312 } 306 313 307 314