aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/nvram.c
diff options
context:
space:
mode:
authorRobert P. J. Day <rpjday@mindspring.com>2007-07-16 02:41:04 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-07-16 12:05:47 -0400
commitea5a3dcfda1c9140228f2842ea9b01e1713c559a (patch)
tree3b422886c10c5d93c9d6960aa1b0f5732dc366c4 /drivers/char/nvram.c
parentef48bd246124ccdef0e1fa5b03b62d69cbf71fa7 (diff)
COBALT: remove all references to Cobalt NVRAM
Remove not only the references to Cobalt NVRAM, but the header file as well. Signed-off-by: Robert P. J. Day <rpjday@mindspring.com> Acked-by: Tim Hockin <thockin@hockin.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/char/nvram.c')
-rw-r--r--drivers/char/nvram.c192
1 files changed, 1 insertions, 191 deletions
diff --git a/drivers/char/nvram.c b/drivers/char/nvram.c
index 204deaa0de80..98dec380af49 100644
--- a/drivers/char/nvram.c
+++ b/drivers/char/nvram.c
@@ -42,19 +42,12 @@
42 42
43#define PC 1 43#define PC 1
44#define ATARI 2 44#define ATARI 2
45#define COBALT 3
46 45
47/* select machine configuration */ 46/* select machine configuration */
48#if defined(CONFIG_ATARI) 47#if defined(CONFIG_ATARI)
49# define MACH ATARI 48# define MACH ATARI
50#elif defined(__i386__) || defined(__x86_64__) || defined(__arm__) /* and others?? */ 49#elif defined(__i386__) || defined(__x86_64__) || defined(__arm__) /* and others?? */
51#define MACH PC 50# define MACH PC
52# if defined(CONFIG_COBALT)
53# include <linux/cobalt-nvram.h>
54# define MACH COBALT
55# else
56# define MACH PC
57# endif
58#else 51#else
59# error Cannot build nvram driver for this machine configuration. 52# error Cannot build nvram driver for this machine configuration.
60#endif 53#endif
@@ -76,18 +69,6 @@
76 69
77#endif 70#endif
78 71
79#if MACH == COBALT
80
81#define CHECK_DRIVER_INIT() 1
82
83#define NVRAM_BYTES (128-NVRAM_FIRST_BYTE)
84
85#define mach_check_checksum cobalt_check_checksum
86#define mach_set_checksum cobalt_set_checksum
87#define mach_proc_infos cobalt_proc_infos
88
89#endif
90
91#if MACH == ATARI 72#if MACH == ATARI
92 73
93/* Special parameters for RTC in Atari machines */ 74/* Special parameters for RTC in Atari machines */
@@ -604,177 +585,6 @@ pc_proc_infos(unsigned char *nvram, char *buffer, int *len,
604 585
605#endif /* MACH == PC */ 586#endif /* MACH == PC */
606 587
607#if MACH == COBALT
608
609/* the cobalt CMOS has a wider range of its checksum */
610static int cobalt_check_checksum(void)
611{
612 int i;
613 unsigned short sum = 0;
614 unsigned short expect;
615
616 for (i = COBT_CMOS_CKS_START; i <= COBT_CMOS_CKS_END; ++i) {
617 if ((i == COBT_CMOS_CHECKSUM) || (i == (COBT_CMOS_CHECKSUM+1)))
618 continue;
619
620 sum += __nvram_read_byte(i);
621 }
622 expect = __nvram_read_byte(COBT_CMOS_CHECKSUM) << 8 |
623 __nvram_read_byte(COBT_CMOS_CHECKSUM+1);
624 return ((sum & 0xffff) == expect);
625}
626
627static void cobalt_set_checksum(void)
628{
629 int i;
630 unsigned short sum = 0;
631
632 for (i = COBT_CMOS_CKS_START; i <= COBT_CMOS_CKS_END; ++i) {
633 if ((i == COBT_CMOS_CHECKSUM) || (i == (COBT_CMOS_CHECKSUM+1)))
634 continue;
635
636 sum += __nvram_read_byte(i);
637 }
638
639 __nvram_write_byte(sum >> 8, COBT_CMOS_CHECKSUM);
640 __nvram_write_byte(sum & 0xff, COBT_CMOS_CHECKSUM+1);
641}
642
643#ifdef CONFIG_PROC_FS
644
645static int cobalt_proc_infos(unsigned char *nvram, char *buffer, int *len,
646 off_t *begin, off_t offset, int size)
647{
648 int i;
649 unsigned int checksum;
650 unsigned int flags;
651 char sernum[14];
652 char *key = "cNoEbTaWlOtR!";
653 unsigned char bto_csum;
654
655 spin_lock_irq(&rtc_lock);
656 checksum = __nvram_check_checksum();
657 spin_unlock_irq(&rtc_lock);
658
659 PRINT_PROC("Checksum status: %svalid\n", checksum ? "" : "not ");
660
661 flags = nvram[COBT_CMOS_FLAG_BYTE_0] << 8
662 | nvram[COBT_CMOS_FLAG_BYTE_1];
663
664 PRINT_PROC("Console: %s\n",
665 flags & COBT_CMOS_CONSOLE_FLAG ? "on": "off");
666
667 PRINT_PROC("Firmware Debug Messages: %s\n",
668 flags & COBT_CMOS_DEBUG_FLAG ? "on": "off");
669
670 PRINT_PROC("Auto Prompt: %s\n",
671 flags & COBT_CMOS_AUTO_PROMPT_FLAG ? "on": "off");
672
673 PRINT_PROC("Shutdown Status: %s\n",
674 flags & COBT_CMOS_CLEAN_BOOT_FLAG ? "clean": "dirty");
675
676 PRINT_PROC("Hardware Probe: %s\n",
677 flags & COBT_CMOS_HW_NOPROBE_FLAG ? "partial": "full");
678
679 PRINT_PROC("System Fault: %sdetected\n",
680 flags & COBT_CMOS_SYSFAULT_FLAG ? "": "not ");
681
682 PRINT_PROC("Panic on OOPS: %s\n",
683 flags & COBT_CMOS_OOPSPANIC_FLAG ? "yes": "no");
684
685 PRINT_PROC("Delayed Cache Initialization: %s\n",
686 flags & COBT_CMOS_DELAY_CACHE_FLAG ? "yes": "no");
687
688 PRINT_PROC("Show Logo at Boot: %s\n",
689 flags & COBT_CMOS_NOLOGO_FLAG ? "no": "yes");
690
691 PRINT_PROC("Boot Method: ");
692 switch (nvram[COBT_CMOS_BOOT_METHOD]) {
693 case COBT_CMOS_BOOT_METHOD_DISK:
694 PRINT_PROC("disk\n");
695 break;
696
697 case COBT_CMOS_BOOT_METHOD_ROM:
698 PRINT_PROC("rom\n");
699 break;
700
701 case COBT_CMOS_BOOT_METHOD_NET:
702 PRINT_PROC("net\n");
703 break;
704
705 default:
706 PRINT_PROC("unknown\n");
707 break;
708 }
709
710 PRINT_PROC("Primary Boot Device: %d:%d\n",
711 nvram[COBT_CMOS_BOOT_DEV0_MAJ],
712 nvram[COBT_CMOS_BOOT_DEV0_MIN] );
713 PRINT_PROC("Secondary Boot Device: %d:%d\n",
714 nvram[COBT_CMOS_BOOT_DEV1_MAJ],
715 nvram[COBT_CMOS_BOOT_DEV1_MIN] );
716 PRINT_PROC("Tertiary Boot Device: %d:%d\n",
717 nvram[COBT_CMOS_BOOT_DEV2_MAJ],
718 nvram[COBT_CMOS_BOOT_DEV2_MIN] );
719
720 PRINT_PROC("Uptime: %d\n",
721 nvram[COBT_CMOS_UPTIME_0] << 24 |
722 nvram[COBT_CMOS_UPTIME_1] << 16 |
723 nvram[COBT_CMOS_UPTIME_2] << 8 |
724 nvram[COBT_CMOS_UPTIME_3]);
725
726 PRINT_PROC("Boot Count: %d\n",
727 nvram[COBT_CMOS_BOOTCOUNT_0] << 24 |
728 nvram[COBT_CMOS_BOOTCOUNT_1] << 16 |
729 nvram[COBT_CMOS_BOOTCOUNT_2] << 8 |
730 nvram[COBT_CMOS_BOOTCOUNT_3]);
731
732 /* 13 bytes of serial num */
733 for (i=0 ; i<13 ; i++) {
734 sernum[i] = nvram[COBT_CMOS_SYS_SERNUM_0 + i];
735 }
736 sernum[13] = '\0';
737
738 checksum = 0;
739 for (i=0 ; i<13 ; i++) {
740 checksum += sernum[i] ^ key[i];
741 }
742 checksum = ((checksum & 0x7f) ^ (0xd6)) & 0xff;
743
744 PRINT_PROC("Serial Number: %s", sernum);
745 if (checksum != nvram[COBT_CMOS_SYS_SERNUM_CSUM]) {
746 PRINT_PROC(" (invalid checksum)");
747 }
748 PRINT_PROC("\n");
749
750 PRINT_PROC("Rom Revison: %d.%d.%d\n", nvram[COBT_CMOS_ROM_REV_MAJ],
751 nvram[COBT_CMOS_ROM_REV_MIN], nvram[COBT_CMOS_ROM_REV_REV]);
752
753 PRINT_PROC("BTO Server: %d.%d.%d.%d", nvram[COBT_CMOS_BTO_IP_0],
754 nvram[COBT_CMOS_BTO_IP_1], nvram[COBT_CMOS_BTO_IP_2],
755 nvram[COBT_CMOS_BTO_IP_3]);
756 bto_csum = nvram[COBT_CMOS_BTO_IP_0] + nvram[COBT_CMOS_BTO_IP_1]
757 + nvram[COBT_CMOS_BTO_IP_2] + nvram[COBT_CMOS_BTO_IP_3];
758 if (bto_csum != nvram[COBT_CMOS_BTO_IP_CSUM]) {
759 PRINT_PROC(" (invalid checksum)");
760 }
761 PRINT_PROC("\n");
762
763 if (flags & COBT_CMOS_VERSION_FLAG
764 && nvram[COBT_CMOS_VERSION] >= COBT_CMOS_VER_BTOCODE) {
765 PRINT_PROC("BTO Code: 0x%x\n",
766 nvram[COBT_CMOS_BTO_CODE_0] << 24 |
767 nvram[COBT_CMOS_BTO_CODE_1] << 16 |
768 nvram[COBT_CMOS_BTO_CODE_2] << 8 |
769 nvram[COBT_CMOS_BTO_CODE_3]);
770 }
771
772 return 1;
773}
774#endif /* CONFIG_PROC_FS */
775
776#endif /* MACH == COBALT */
777
778#if MACH == ATARI 588#if MACH == ATARI
779 589
780static int 590static int