diff options
Diffstat (limited to 'arch')
-rw-r--r-- | arch/powerpc/configs/pseries_defconfig | 206 | ||||
-rw-r--r-- | arch/powerpc/kernel/Makefile | 2 | ||||
-rw-r--r-- | arch/powerpc/kernel/rtas-rtc.c | 105 | ||||
-rw-r--r-- | arch/powerpc/platforms/powermac/time.c | 2 | ||||
-rw-r--r-- | arch/ppc64/kernel/Makefile | 1 | ||||
-rw-r--r-- | arch/ppc64/kernel/rtc.c | 358 |
6 files changed, 238 insertions, 436 deletions
diff --git a/arch/powerpc/configs/pseries_defconfig b/arch/powerpc/configs/pseries_defconfig index 9f09dff9e11a..913962c1dae0 100644 --- a/arch/powerpc/configs/pseries_defconfig +++ b/arch/powerpc/configs/pseries_defconfig | |||
@@ -1,18 +1,33 @@ | |||
1 | # | 1 | # |
2 | # Automatically generated make config: don't edit | 2 | # Automatically generated make config: don't edit |
3 | # Linux kernel version: 2.6.14-rc4 | 3 | # Linux kernel version: 2.6.15-rc1 |
4 | # Thu Oct 20 08:32:17 2005 | 4 | # Mon Nov 14 15:27:00 2005 |
5 | # | 5 | # |
6 | CONFIG_PPC64=y | ||
6 | CONFIG_64BIT=y | 7 | CONFIG_64BIT=y |
8 | CONFIG_PPC_MERGE=y | ||
7 | CONFIG_MMU=y | 9 | CONFIG_MMU=y |
10 | CONFIG_GENERIC_HARDIRQS=y | ||
8 | CONFIG_RWSEM_XCHGADD_ALGORITHM=y | 11 | CONFIG_RWSEM_XCHGADD_ALGORITHM=y |
9 | CONFIG_GENERIC_CALIBRATE_DELAY=y | 12 | CONFIG_GENERIC_CALIBRATE_DELAY=y |
10 | CONFIG_GENERIC_ISA_DMA=y | 13 | CONFIG_PPC=y |
11 | CONFIG_EARLY_PRINTK=y | 14 | CONFIG_EARLY_PRINTK=y |
12 | CONFIG_COMPAT=y | 15 | CONFIG_COMPAT=y |
16 | CONFIG_SYSVIPC_COMPAT=y | ||
13 | CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y | 17 | CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y |
14 | CONFIG_ARCH_MAY_HAVE_PC_FDC=y | 18 | CONFIG_ARCH_MAY_HAVE_PC_FDC=y |
15 | CONFIG_FORCE_MAX_ZONEORDER=13 | 19 | |
20 | # | ||
21 | # Processor support | ||
22 | # | ||
23 | # CONFIG_POWER4_ONLY is not set | ||
24 | CONFIG_POWER3=y | ||
25 | CONFIG_POWER4=y | ||
26 | CONFIG_PPC_FPU=y | ||
27 | CONFIG_ALTIVEC=y | ||
28 | CONFIG_PPC_STD_MMU=y | ||
29 | CONFIG_SMP=y | ||
30 | CONFIG_NR_CPUS=128 | ||
16 | 31 | ||
17 | # | 32 | # |
18 | # Code maturity level options | 33 | # Code maturity level options |
@@ -68,75 +83,103 @@ CONFIG_MODVERSIONS=y | |||
68 | CONFIG_MODULE_SRCVERSION_ALL=y | 83 | CONFIG_MODULE_SRCVERSION_ALL=y |
69 | CONFIG_KMOD=y | 84 | CONFIG_KMOD=y |
70 | CONFIG_STOP_MACHINE=y | 85 | CONFIG_STOP_MACHINE=y |
71 | CONFIG_SYSVIPC_COMPAT=y | 86 | |
87 | # | ||
88 | # Block layer | ||
89 | # | ||
90 | |||
91 | # | ||
92 | # IO Schedulers | ||
93 | # | ||
94 | CONFIG_IOSCHED_NOOP=y | ||
95 | CONFIG_IOSCHED_AS=y | ||
96 | CONFIG_IOSCHED_DEADLINE=y | ||
97 | CONFIG_IOSCHED_CFQ=y | ||
98 | CONFIG_DEFAULT_AS=y | ||
99 | # CONFIG_DEFAULT_DEADLINE is not set | ||
100 | # CONFIG_DEFAULT_CFQ is not set | ||
101 | # CONFIG_DEFAULT_NOOP is not set | ||
102 | CONFIG_DEFAULT_IOSCHED="anticipatory" | ||
72 | 103 | ||
73 | # | 104 | # |
74 | # Platform support | 105 | # Platform support |
75 | # | 106 | # |
76 | # CONFIG_PPC_ISERIES is not set | ||
77 | CONFIG_PPC_MULTIPLATFORM=y | 107 | CONFIG_PPC_MULTIPLATFORM=y |
108 | # CONFIG_PPC_ISERIES is not set | ||
109 | # CONFIG_EMBEDDED6xx is not set | ||
110 | # CONFIG_APUS is not set | ||
78 | CONFIG_PPC_PSERIES=y | 111 | CONFIG_PPC_PSERIES=y |
79 | # CONFIG_PPC_BPA is not set | ||
80 | # CONFIG_PPC_PMAC is not set | 112 | # CONFIG_PPC_PMAC is not set |
81 | # CONFIG_PPC_MAPLE is not set | 113 | # CONFIG_PPC_MAPLE is not set |
82 | CONFIG_PPC=y | 114 | # CONFIG_PPC_CELL is not set |
83 | CONFIG_PPC64=y | ||
84 | CONFIG_PPC_OF=y | 115 | CONFIG_PPC_OF=y |
85 | CONFIG_XICS=y | 116 | CONFIG_XICS=y |
117 | # CONFIG_U3_DART is not set | ||
86 | CONFIG_MPIC=y | 118 | CONFIG_MPIC=y |
87 | CONFIG_ALTIVEC=y | 119 | CONFIG_PPC_RTAS=y |
88 | CONFIG_PPC_SPLPAR=y | 120 | CONFIG_RTAS_ERROR_LOGGING=y |
89 | CONFIG_KEXEC=y | 121 | CONFIG_RTAS_PROC=y |
122 | CONFIG_RTAS_FLASH=m | ||
123 | # CONFIG_MMIO_NVRAM is not set | ||
90 | CONFIG_IBMVIO=y | 124 | CONFIG_IBMVIO=y |
91 | # CONFIG_U3_DART is not set | 125 | # CONFIG_PPC_MPC106 is not set |
92 | # CONFIG_BOOTX_TEXT is not set | 126 | # CONFIG_GENERIC_TBSYNC is not set |
93 | # CONFIG_POWER4_ONLY is not set | 127 | # CONFIG_CPU_FREQ is not set |
128 | # CONFIG_WANT_EARLY_SERIAL is not set | ||
129 | |||
130 | # | ||
131 | # Kernel options | ||
132 | # | ||
133 | # CONFIG_HZ_100 is not set | ||
134 | CONFIG_HZ_250=y | ||
135 | # CONFIG_HZ_1000 is not set | ||
136 | CONFIG_HZ=250 | ||
137 | CONFIG_PREEMPT_NONE=y | ||
138 | # CONFIG_PREEMPT_VOLUNTARY is not set | ||
139 | # CONFIG_PREEMPT is not set | ||
140 | # CONFIG_PREEMPT_BKL is not set | ||
141 | CONFIG_BINFMT_ELF=y | ||
142 | # CONFIG_BINFMT_MISC is not set | ||
143 | CONFIG_FORCE_MAX_ZONEORDER=13 | ||
94 | CONFIG_IOMMU_VMERGE=y | 144 | CONFIG_IOMMU_VMERGE=y |
95 | CONFIG_SMP=y | 145 | CONFIG_HOTPLUG_CPU=y |
96 | CONFIG_NR_CPUS=128 | 146 | CONFIG_KEXEC=y |
147 | # CONFIG_IRQ_ALL_CPUS is not set | ||
148 | CONFIG_PPC_SPLPAR=y | ||
149 | CONFIG_EEH=y | ||
150 | CONFIG_SCANLOG=m | ||
151 | CONFIG_LPARCFG=y | ||
152 | CONFIG_NUMA=y | ||
97 | CONFIG_ARCH_SELECT_MEMORY_MODEL=y | 153 | CONFIG_ARCH_SELECT_MEMORY_MODEL=y |
98 | CONFIG_ARCH_FLATMEM_ENABLE=y | ||
99 | CONFIG_ARCH_DISCONTIGMEM_ENABLE=y | ||
100 | CONFIG_ARCH_DISCONTIGMEM_DEFAULT=y | ||
101 | CONFIG_ARCH_SPARSEMEM_ENABLE=y | 154 | CONFIG_ARCH_SPARSEMEM_ENABLE=y |
155 | CONFIG_ARCH_SPARSEMEM_DEFAULT=y | ||
102 | CONFIG_SELECT_MEMORY_MODEL=y | 156 | CONFIG_SELECT_MEMORY_MODEL=y |
103 | # CONFIG_FLATMEM_MANUAL is not set | 157 | # CONFIG_FLATMEM_MANUAL is not set |
104 | CONFIG_DISCONTIGMEM_MANUAL=y | 158 | # CONFIG_DISCONTIGMEM_MANUAL is not set |
105 | # CONFIG_SPARSEMEM_MANUAL is not set | 159 | CONFIG_SPARSEMEM_MANUAL=y |
106 | CONFIG_DISCONTIGMEM=y | 160 | CONFIG_SPARSEMEM=y |
107 | CONFIG_FLAT_NODE_MEM_MAP=y | ||
108 | CONFIG_NEED_MULTIPLE_NODES=y | 161 | CONFIG_NEED_MULTIPLE_NODES=y |
162 | CONFIG_HAVE_MEMORY_PRESENT=y | ||
109 | # CONFIG_SPARSEMEM_STATIC is not set | 163 | # CONFIG_SPARSEMEM_STATIC is not set |
164 | CONFIG_SPARSEMEM_EXTREME=y | ||
165 | # CONFIG_MEMORY_HOTPLUG is not set | ||
166 | CONFIG_SPLIT_PTLOCK_CPUS=4096 | ||
110 | CONFIG_HAVE_ARCH_EARLY_PFN_TO_NID=y | 167 | CONFIG_HAVE_ARCH_EARLY_PFN_TO_NID=y |
111 | CONFIG_NODES_SPAN_OTHER_NODES=y | 168 | CONFIG_NODES_SPAN_OTHER_NODES=y |
112 | CONFIG_NUMA=y | 169 | # CONFIG_PPC_64K_PAGES is not set |
113 | CONFIG_SCHED_SMT=y | 170 | CONFIG_SCHED_SMT=y |
114 | CONFIG_PREEMPT_NONE=y | ||
115 | # CONFIG_PREEMPT_VOLUNTARY is not set | ||
116 | # CONFIG_PREEMPT is not set | ||
117 | # CONFIG_PREEMPT_BKL is not set | ||
118 | # CONFIG_HZ_100 is not set | ||
119 | CONFIG_HZ_250=y | ||
120 | # CONFIG_HZ_1000 is not set | ||
121 | CONFIG_HZ=250 | ||
122 | CONFIG_EEH=y | ||
123 | CONFIG_GENERIC_HARDIRQS=y | ||
124 | CONFIG_PPC_RTAS=y | ||
125 | CONFIG_RTAS_PROC=y | ||
126 | CONFIG_RTAS_FLASH=m | ||
127 | CONFIG_SCANLOG=m | ||
128 | CONFIG_LPARCFG=y | ||
129 | CONFIG_SECCOMP=y | ||
130 | CONFIG_BINFMT_ELF=y | ||
131 | # CONFIG_BINFMT_MISC is not set | ||
132 | CONFIG_HOTPLUG_CPU=y | ||
133 | CONFIG_PROC_DEVICETREE=y | 171 | CONFIG_PROC_DEVICETREE=y |
134 | # CONFIG_CMDLINE_BOOL is not set | 172 | # CONFIG_CMDLINE_BOOL is not set |
173 | # CONFIG_PM is not set | ||
174 | CONFIG_SECCOMP=y | ||
135 | CONFIG_ISA_DMA_API=y | 175 | CONFIG_ISA_DMA_API=y |
136 | 176 | ||
137 | # | 177 | # |
138 | # Bus Options | 178 | # Bus options |
139 | # | 179 | # |
180 | CONFIG_GENERIC_ISA_DMA=y | ||
181 | CONFIG_PPC_I8259=y | ||
182 | # CONFIG_PPC_INDIRECT_PCI is not set | ||
140 | CONFIG_PCI=y | 183 | CONFIG_PCI=y |
141 | CONFIG_PCI_DOMAINS=y | 184 | CONFIG_PCI_DOMAINS=y |
142 | CONFIG_PCI_LEGACY_PROC=y | 185 | CONFIG_PCI_LEGACY_PROC=y |
@@ -156,6 +199,7 @@ CONFIG_HOTPLUG_PCI=m | |||
156 | # CONFIG_HOTPLUG_PCI_SHPC is not set | 199 | # CONFIG_HOTPLUG_PCI_SHPC is not set |
157 | CONFIG_HOTPLUG_PCI_RPA=m | 200 | CONFIG_HOTPLUG_PCI_RPA=m |
158 | CONFIG_HOTPLUG_PCI_RPA_DLPAR=m | 201 | CONFIG_HOTPLUG_PCI_RPA_DLPAR=m |
202 | CONFIG_KERNEL_START=0xc000000000000000 | ||
159 | 203 | ||
160 | # | 204 | # |
161 | # Networking | 205 | # Networking |
@@ -197,6 +241,10 @@ CONFIG_TCP_CONG_BIC=y | |||
197 | # CONFIG_IPV6 is not set | 241 | # CONFIG_IPV6 is not set |
198 | CONFIG_NETFILTER=y | 242 | CONFIG_NETFILTER=y |
199 | # CONFIG_NETFILTER_DEBUG is not set | 243 | # CONFIG_NETFILTER_DEBUG is not set |
244 | |||
245 | # | ||
246 | # Core Netfilter Configuration | ||
247 | # | ||
200 | CONFIG_NETFILTER_NETLINK=y | 248 | CONFIG_NETFILTER_NETLINK=y |
201 | CONFIG_NETFILTER_NETLINK_QUEUE=m | 249 | CONFIG_NETFILTER_NETLINK_QUEUE=m |
202 | CONFIG_NETFILTER_NETLINK_LOG=m | 250 | CONFIG_NETFILTER_NETLINK_LOG=m |
@@ -299,6 +347,10 @@ CONFIG_LLC=y | |||
299 | # CONFIG_NET_DIVERT is not set | 347 | # CONFIG_NET_DIVERT is not set |
300 | # CONFIG_ECONET is not set | 348 | # CONFIG_ECONET is not set |
301 | # CONFIG_WAN_ROUTER is not set | 349 | # CONFIG_WAN_ROUTER is not set |
350 | |||
351 | # | ||
352 | # QoS and/or fair queueing | ||
353 | # | ||
302 | # CONFIG_NET_SCHED is not set | 354 | # CONFIG_NET_SCHED is not set |
303 | CONFIG_NET_CLS_ROUTE=y | 355 | CONFIG_NET_CLS_ROUTE=y |
304 | 356 | ||
@@ -368,14 +420,6 @@ CONFIG_BLK_DEV_RAM_COUNT=16 | |||
368 | CONFIG_BLK_DEV_RAM_SIZE=65536 | 420 | CONFIG_BLK_DEV_RAM_SIZE=65536 |
369 | CONFIG_BLK_DEV_INITRD=y | 421 | CONFIG_BLK_DEV_INITRD=y |
370 | # CONFIG_CDROM_PKTCDVD is not set | 422 | # CONFIG_CDROM_PKTCDVD is not set |
371 | |||
372 | # | ||
373 | # IO Schedulers | ||
374 | # | ||
375 | CONFIG_IOSCHED_NOOP=y | ||
376 | CONFIG_IOSCHED_AS=y | ||
377 | CONFIG_IOSCHED_DEADLINE=y | ||
378 | CONFIG_IOSCHED_CFQ=y | ||
379 | # CONFIG_ATA_OVER_ETH is not set | 423 | # CONFIG_ATA_OVER_ETH is not set |
380 | 424 | ||
381 | # | 425 | # |
@@ -473,6 +517,7 @@ CONFIG_SCSI_ISCSI_ATTRS=m | |||
473 | # | 517 | # |
474 | # SCSI low-level drivers | 518 | # SCSI low-level drivers |
475 | # | 519 | # |
520 | # CONFIG_ISCSI_TCP is not set | ||
476 | # CONFIG_BLK_DEV_3W_XXXX_RAID is not set | 521 | # CONFIG_BLK_DEV_3W_XXXX_RAID is not set |
477 | # CONFIG_SCSI_3W_9XXX is not set | 522 | # CONFIG_SCSI_3W_9XXX is not set |
478 | # CONFIG_SCSI_ACARD is not set | 523 | # CONFIG_SCSI_ACARD is not set |
@@ -559,6 +604,7 @@ CONFIG_DM_MULTIPATH_EMC=m | |||
559 | # | 604 | # |
560 | # Macintosh device drivers | 605 | # Macintosh device drivers |
561 | # | 606 | # |
607 | # CONFIG_WINDFARM is not set | ||
562 | 608 | ||
563 | # | 609 | # |
564 | # Network device support | 610 | # Network device support |
@@ -645,7 +691,6 @@ CONFIG_IXGB=m | |||
645 | # CONFIG_IXGB_NAPI is not set | 691 | # CONFIG_IXGB_NAPI is not set |
646 | CONFIG_S2IO=m | 692 | CONFIG_S2IO=m |
647 | # CONFIG_S2IO_NAPI is not set | 693 | # CONFIG_S2IO_NAPI is not set |
648 | # CONFIG_2BUFF_MODE is not set | ||
649 | 694 | ||
650 | # | 695 | # |
651 | # Token Ring devices | 696 | # Token Ring devices |
@@ -674,6 +719,7 @@ CONFIG_PPP_ASYNC=m | |||
674 | CONFIG_PPP_SYNC_TTY=m | 719 | CONFIG_PPP_SYNC_TTY=m |
675 | CONFIG_PPP_DEFLATE=m | 720 | CONFIG_PPP_DEFLATE=m |
676 | CONFIG_PPP_BSDCOMP=m | 721 | CONFIG_PPP_BSDCOMP=m |
722 | # CONFIG_PPP_MPPE is not set | ||
677 | CONFIG_PPPOE=m | 723 | CONFIG_PPPOE=m |
678 | # CONFIG_SLIP is not set | 724 | # CONFIG_SLIP is not set |
679 | # CONFIG_NET_FC is not set | 725 | # CONFIG_NET_FC is not set |
@@ -784,6 +830,8 @@ CONFIG_HVCS=m | |||
784 | # | 830 | # |
785 | # CONFIG_WATCHDOG is not set | 831 | # CONFIG_WATCHDOG is not set |
786 | # CONFIG_RTC is not set | 832 | # CONFIG_RTC is not set |
833 | CONFIG_GEN_RTC=y | ||
834 | # CONFIG_GEN_RTC_X is not set | ||
787 | # CONFIG_DTLK is not set | 835 | # CONFIG_DTLK is not set |
788 | # CONFIG_R3964 is not set | 836 | # CONFIG_R3964 is not set |
789 | # CONFIG_APPLICOM is not set | 837 | # CONFIG_APPLICOM is not set |
@@ -801,6 +849,7 @@ CONFIG_MAX_RAW_DEVS=1024 | |||
801 | # TPM devices | 849 | # TPM devices |
802 | # | 850 | # |
803 | # CONFIG_TCG_TPM is not set | 851 | # CONFIG_TCG_TPM is not set |
852 | # CONFIG_TELCLOCK is not set | ||
804 | 853 | ||
805 | # | 854 | # |
806 | # I2C support | 855 | # I2C support |
@@ -852,6 +901,7 @@ CONFIG_I2C_ALGOBIT=y | |||
852 | # CONFIG_SENSORS_PCF8591 is not set | 901 | # CONFIG_SENSORS_PCF8591 is not set |
853 | # CONFIG_SENSORS_RTC8564 is not set | 902 | # CONFIG_SENSORS_RTC8564 is not set |
854 | # CONFIG_SENSORS_MAX6875 is not set | 903 | # CONFIG_SENSORS_MAX6875 is not set |
904 | # CONFIG_RTC_X1205_I2C is not set | ||
855 | # CONFIG_I2C_DEBUG_CORE is not set | 905 | # CONFIG_I2C_DEBUG_CORE is not set |
856 | # CONFIG_I2C_DEBUG_ALGO is not set | 906 | # CONFIG_I2C_DEBUG_ALGO is not set |
857 | # CONFIG_I2C_DEBUG_BUS is not set | 907 | # CONFIG_I2C_DEBUG_BUS is not set |
@@ -893,7 +943,6 @@ CONFIG_FB=y | |||
893 | CONFIG_FB_CFB_FILLRECT=y | 943 | CONFIG_FB_CFB_FILLRECT=y |
894 | CONFIG_FB_CFB_COPYAREA=y | 944 | CONFIG_FB_CFB_COPYAREA=y |
895 | CONFIG_FB_CFB_IMAGEBLIT=y | 945 | CONFIG_FB_CFB_IMAGEBLIT=y |
896 | CONFIG_FB_SOFT_CURSOR=y | ||
897 | CONFIG_FB_MACMODES=y | 946 | CONFIG_FB_MACMODES=y |
898 | CONFIG_FB_MODE_HELPERS=y | 947 | CONFIG_FB_MODE_HELPERS=y |
899 | CONFIG_FB_TILEBLITTING=y | 948 | CONFIG_FB_TILEBLITTING=y |
@@ -905,6 +954,7 @@ CONFIG_FB_OF=y | |||
905 | # CONFIG_FB_ASILIANT is not set | 954 | # CONFIG_FB_ASILIANT is not set |
906 | # CONFIG_FB_IMSTT is not set | 955 | # CONFIG_FB_IMSTT is not set |
907 | # CONFIG_FB_VGA16 is not set | 956 | # CONFIG_FB_VGA16 is not set |
957 | # CONFIG_FB_S1D13XXX is not set | ||
908 | # CONFIG_FB_NVIDIA is not set | 958 | # CONFIG_FB_NVIDIA is not set |
909 | # CONFIG_FB_RIVA is not set | 959 | # CONFIG_FB_RIVA is not set |
910 | CONFIG_FB_MATROX=y | 960 | CONFIG_FB_MATROX=y |
@@ -927,7 +977,6 @@ CONFIG_FB_RADEON_I2C=y | |||
927 | # CONFIG_FB_VOODOO1 is not set | 977 | # CONFIG_FB_VOODOO1 is not set |
928 | # CONFIG_FB_CYBLA is not set | 978 | # CONFIG_FB_CYBLA is not set |
929 | # CONFIG_FB_TRIDENT is not set | 979 | # CONFIG_FB_TRIDENT is not set |
930 | # CONFIG_FB_S1D13XXX is not set | ||
931 | # CONFIG_FB_VIRTUAL is not set | 980 | # CONFIG_FB_VIRTUAL is not set |
932 | 981 | ||
933 | # | 982 | # |
@@ -936,6 +985,7 @@ CONFIG_FB_RADEON_I2C=y | |||
936 | # CONFIG_VGA_CONSOLE is not set | 985 | # CONFIG_VGA_CONSOLE is not set |
937 | CONFIG_DUMMY_CONSOLE=y | 986 | CONFIG_DUMMY_CONSOLE=y |
938 | CONFIG_FRAMEBUFFER_CONSOLE=y | 987 | CONFIG_FRAMEBUFFER_CONSOLE=y |
988 | # CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set | ||
939 | # CONFIG_FONTS is not set | 989 | # CONFIG_FONTS is not set |
940 | CONFIG_FONT_8x8=y | 990 | CONFIG_FONT_8x8=y |
941 | CONFIG_FONT_8x16=y | 991 | CONFIG_FONT_8x16=y |
@@ -990,12 +1040,15 @@ CONFIG_USB_OHCI_LITTLE_ENDIAN=y | |||
990 | # | 1040 | # |
991 | # USB Device Class drivers | 1041 | # USB Device Class drivers |
992 | # | 1042 | # |
993 | # CONFIG_USB_BLUETOOTH_TTY is not set | ||
994 | # CONFIG_USB_ACM is not set | 1043 | # CONFIG_USB_ACM is not set |
995 | # CONFIG_USB_PRINTER is not set | 1044 | # CONFIG_USB_PRINTER is not set |
996 | 1045 | ||
997 | # | 1046 | # |
998 | # NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information | 1047 | # NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' |
1048 | # | ||
1049 | |||
1050 | # | ||
1051 | # may also be needed; see USB_STORAGE Help for more information | ||
999 | # | 1052 | # |
1000 | CONFIG_USB_STORAGE=y | 1053 | CONFIG_USB_STORAGE=y |
1001 | # CONFIG_USB_STORAGE_DEBUG is not set | 1054 | # CONFIG_USB_STORAGE_DEBUG is not set |
@@ -1106,6 +1159,7 @@ CONFIG_INFINIBAND_MTHCA=m | |||
1106 | # CONFIG_INFINIBAND_MTHCA_DEBUG is not set | 1159 | # CONFIG_INFINIBAND_MTHCA_DEBUG is not set |
1107 | CONFIG_INFINIBAND_IPOIB=m | 1160 | CONFIG_INFINIBAND_IPOIB=m |
1108 | # CONFIG_INFINIBAND_IPOIB_DEBUG is not set | 1161 | # CONFIG_INFINIBAND_IPOIB_DEBUG is not set |
1162 | # CONFIG_INFINIBAND_SRP is not set | ||
1109 | 1163 | ||
1110 | # | 1164 | # |
1111 | # SN Devices | 1165 | # SN Devices |
@@ -1288,10 +1342,25 @@ CONFIG_NLS_ISO8859_1=y | |||
1288 | # CONFIG_NLS_UTF8 is not set | 1342 | # CONFIG_NLS_UTF8 is not set |
1289 | 1343 | ||
1290 | # | 1344 | # |
1291 | # Profiling support | 1345 | # Library routines |
1346 | # | ||
1347 | CONFIG_CRC_CCITT=m | ||
1348 | # CONFIG_CRC16 is not set | ||
1349 | CONFIG_CRC32=y | ||
1350 | CONFIG_LIBCRC32C=m | ||
1351 | CONFIG_ZLIB_INFLATE=y | ||
1352 | CONFIG_ZLIB_DEFLATE=m | ||
1353 | CONFIG_TEXTSEARCH=y | ||
1354 | CONFIG_TEXTSEARCH_KMP=m | ||
1355 | CONFIG_TEXTSEARCH_BM=m | ||
1356 | CONFIG_TEXTSEARCH_FSM=m | ||
1357 | |||
1358 | # | ||
1359 | # Instrumentation Support | ||
1292 | # | 1360 | # |
1293 | CONFIG_PROFILING=y | 1361 | CONFIG_PROFILING=y |
1294 | CONFIG_OPROFILE=y | 1362 | CONFIG_OPROFILE=y |
1363 | # CONFIG_KPROBES is not set | ||
1295 | 1364 | ||
1296 | # | 1365 | # |
1297 | # Kernel hacking | 1366 | # Kernel hacking |
@@ -1308,14 +1377,15 @@ CONFIG_DETECT_SOFTLOCKUP=y | |||
1308 | # CONFIG_DEBUG_KOBJECT is not set | 1377 | # CONFIG_DEBUG_KOBJECT is not set |
1309 | # CONFIG_DEBUG_INFO is not set | 1378 | # CONFIG_DEBUG_INFO is not set |
1310 | CONFIG_DEBUG_FS=y | 1379 | CONFIG_DEBUG_FS=y |
1380 | # CONFIG_DEBUG_VM is not set | ||
1381 | # CONFIG_RCU_TORTURE_TEST is not set | ||
1311 | CONFIG_DEBUG_STACKOVERFLOW=y | 1382 | CONFIG_DEBUG_STACKOVERFLOW=y |
1312 | # CONFIG_KPROBES is not set | ||
1313 | CONFIG_DEBUG_STACK_USAGE=y | 1383 | CONFIG_DEBUG_STACK_USAGE=y |
1314 | CONFIG_DEBUGGER=y | 1384 | CONFIG_DEBUGGER=y |
1315 | CONFIG_XMON=y | 1385 | CONFIG_XMON=y |
1316 | CONFIG_XMON_DEFAULT=y | 1386 | CONFIG_XMON_DEFAULT=y |
1317 | # CONFIG_PPCDBG is not set | ||
1318 | CONFIG_IRQSTACKS=y | 1387 | CONFIG_IRQSTACKS=y |
1388 | # CONFIG_BOOTX_TEXT is not set | ||
1319 | 1389 | ||
1320 | # | 1390 | # |
1321 | # Security options | 1391 | # Security options |
@@ -1355,17 +1425,3 @@ CONFIG_CRYPTO_TEST=m | |||
1355 | # | 1425 | # |
1356 | # Hardware crypto devices | 1426 | # Hardware crypto devices |
1357 | # | 1427 | # |
1358 | |||
1359 | # | ||
1360 | # Library routines | ||
1361 | # | ||
1362 | CONFIG_CRC_CCITT=m | ||
1363 | # CONFIG_CRC16 is not set | ||
1364 | CONFIG_CRC32=y | ||
1365 | CONFIG_LIBCRC32C=m | ||
1366 | CONFIG_ZLIB_INFLATE=y | ||
1367 | CONFIG_ZLIB_DEFLATE=m | ||
1368 | CONFIG_TEXTSEARCH=y | ||
1369 | CONFIG_TEXTSEARCH_KMP=m | ||
1370 | CONFIG_TEXTSEARCH_BM=m | ||
1371 | CONFIG_TEXTSEARCH_FSM=m | ||
diff --git a/arch/powerpc/kernel/Makefile b/arch/powerpc/kernel/Makefile index 9a74b7ab03a4..046b4bf1f21e 100644 --- a/arch/powerpc/kernel/Makefile +++ b/arch/powerpc/kernel/Makefile | |||
@@ -25,7 +25,7 @@ obj-$(CONFIG_PPC_OF) += of_device.o | |||
25 | procfs-$(CONFIG_PPC64) := proc_ppc64.o | 25 | procfs-$(CONFIG_PPC64) := proc_ppc64.o |
26 | obj-$(CONFIG_PROC_FS) += $(procfs-y) | 26 | obj-$(CONFIG_PROC_FS) += $(procfs-y) |
27 | rtaspci-$(CONFIG_PPC64) := rtas_pci.o | 27 | rtaspci-$(CONFIG_PPC64) := rtas_pci.o |
28 | obj-$(CONFIG_PPC_RTAS) += rtas.o $(rtaspci-y) | 28 | obj-$(CONFIG_PPC_RTAS) += rtas.o rtas-rtc.o $(rtaspci-y) |
29 | obj-$(CONFIG_RTAS_FLASH) += rtas_flash.o | 29 | obj-$(CONFIG_RTAS_FLASH) += rtas_flash.o |
30 | obj-$(CONFIG_RTAS_PROC) += rtas-proc.o | 30 | obj-$(CONFIG_RTAS_PROC) += rtas-proc.o |
31 | obj-$(CONFIG_LPARCFG) += lparcfg.o | 31 | obj-$(CONFIG_LPARCFG) += lparcfg.o |
diff --git a/arch/powerpc/kernel/rtas-rtc.c b/arch/powerpc/kernel/rtas-rtc.c new file mode 100644 index 000000000000..7b948662704c --- /dev/null +++ b/arch/powerpc/kernel/rtas-rtc.c | |||
@@ -0,0 +1,105 @@ | |||
1 | #include <linux/kernel.h> | ||
2 | #include <linux/time.h> | ||
3 | #include <linux/timer.h> | ||
4 | #include <linux/init.h> | ||
5 | #include <linux/rtc.h> | ||
6 | #include <linux/delay.h> | ||
7 | #include <asm/prom.h> | ||
8 | #include <asm/rtas.h> | ||
9 | #include <asm/time.h> | ||
10 | |||
11 | |||
12 | #define MAX_RTC_WAIT 5000 /* 5 sec */ | ||
13 | #define RTAS_CLOCK_BUSY (-2) | ||
14 | unsigned long __init rtas_get_boot_time(void) | ||
15 | { | ||
16 | int ret[8]; | ||
17 | int error, wait_time; | ||
18 | unsigned long max_wait_tb; | ||
19 | |||
20 | max_wait_tb = get_tb() + tb_ticks_per_usec * 1000 * MAX_RTC_WAIT; | ||
21 | do { | ||
22 | error = rtas_call(rtas_token("get-time-of-day"), 0, 8, ret); | ||
23 | if (error == RTAS_CLOCK_BUSY || rtas_is_extended_busy(error)) { | ||
24 | wait_time = rtas_extended_busy_delay_time(error); | ||
25 | /* This is boot time so we spin. */ | ||
26 | udelay(wait_time*1000); | ||
27 | error = RTAS_CLOCK_BUSY; | ||
28 | } | ||
29 | } while (error == RTAS_CLOCK_BUSY && (get_tb() < max_wait_tb)); | ||
30 | |||
31 | if (error != 0 && printk_ratelimit()) { | ||
32 | printk(KERN_WARNING "error: reading the clock failed (%d)\n", | ||
33 | error); | ||
34 | return 0; | ||
35 | } | ||
36 | |||
37 | return mktime(ret[0], ret[1], ret[2], ret[3], ret[4], ret[5]); | ||
38 | } | ||
39 | |||
40 | /* NOTE: get_rtc_time will get an error if executed in interrupt context | ||
41 | * and if a delay is needed to read the clock. In this case we just | ||
42 | * silently return without updating rtc_tm. | ||
43 | */ | ||
44 | void rtas_get_rtc_time(struct rtc_time *rtc_tm) | ||
45 | { | ||
46 | int ret[8]; | ||
47 | int error, wait_time; | ||
48 | unsigned long max_wait_tb; | ||
49 | |||
50 | max_wait_tb = get_tb() + tb_ticks_per_usec * 1000 * MAX_RTC_WAIT; | ||
51 | do { | ||
52 | error = rtas_call(rtas_token("get-time-of-day"), 0, 8, ret); | ||
53 | if (error == RTAS_CLOCK_BUSY || rtas_is_extended_busy(error)) { | ||
54 | if (in_interrupt() && printk_ratelimit()) { | ||
55 | memset(&rtc_tm, 0, sizeof(struct rtc_time)); | ||
56 | printk(KERN_WARNING "error: reading clock" | ||
57 | " would delay interrupt\n"); | ||
58 | return; /* delay not allowed */ | ||
59 | } | ||
60 | wait_time = rtas_extended_busy_delay_time(error); | ||
61 | msleep(wait_time); | ||
62 | error = RTAS_CLOCK_BUSY; | ||
63 | } | ||
64 | } while (error == RTAS_CLOCK_BUSY && (get_tb() < max_wait_tb)); | ||
65 | |||
66 | if (error != 0 && printk_ratelimit()) { | ||
67 | printk(KERN_WARNING "error: reading the clock failed (%d)\n", | ||
68 | error); | ||
69 | return; | ||
70 | } | ||
71 | |||
72 | rtc_tm->tm_sec = ret[5]; | ||
73 | rtc_tm->tm_min = ret[4]; | ||
74 | rtc_tm->tm_hour = ret[3]; | ||
75 | rtc_tm->tm_mday = ret[2]; | ||
76 | rtc_tm->tm_mon = ret[1] - 1; | ||
77 | rtc_tm->tm_year = ret[0] - 1900; | ||
78 | } | ||
79 | |||
80 | int rtas_set_rtc_time(struct rtc_time *tm) | ||
81 | { | ||
82 | int error, wait_time; | ||
83 | unsigned long max_wait_tb; | ||
84 | |||
85 | max_wait_tb = get_tb() + tb_ticks_per_usec * 1000 * MAX_RTC_WAIT; | ||
86 | do { | ||
87 | error = rtas_call(rtas_token("set-time-of-day"), 7, 1, NULL, | ||
88 | tm->tm_year + 1900, tm->tm_mon + 1, | ||
89 | tm->tm_mday, tm->tm_hour, tm->tm_min, | ||
90 | tm->tm_sec, 0); | ||
91 | if (error == RTAS_CLOCK_BUSY || rtas_is_extended_busy(error)) { | ||
92 | if (in_interrupt()) | ||
93 | return 1; /* probably decrementer */ | ||
94 | wait_time = rtas_extended_busy_delay_time(error); | ||
95 | msleep(wait_time); | ||
96 | error = RTAS_CLOCK_BUSY; | ||
97 | } | ||
98 | } while (error == RTAS_CLOCK_BUSY && (get_tb() < max_wait_tb)); | ||
99 | |||
100 | if (error != 0 && printk_ratelimit()) | ||
101 | printk(KERN_WARNING "error: setting the clock failed (%d)\n", | ||
102 | error); | ||
103 | |||
104 | return 0; | ||
105 | } | ||
diff --git a/arch/powerpc/platforms/powermac/time.c b/arch/powerpc/platforms/powermac/time.c index 4c7682a65227..b1714f9bd920 100644 --- a/arch/powerpc/platforms/powermac/time.c +++ b/arch/powerpc/platforms/powermac/time.c | |||
@@ -199,7 +199,7 @@ static unsigned long smu_get_time(void) | |||
199 | #define smu_set_rtc_time(tm, spin) 0 | 199 | #define smu_set_rtc_time(tm, spin) 0 |
200 | #endif | 200 | #endif |
201 | 201 | ||
202 | unsigned long pmac_get_boot_time(void) | 202 | unsigned long __init pmac_get_boot_time(void) |
203 | { | 203 | { |
204 | /* Get the time from the RTC, used only at boot time */ | 204 | /* Get the time from the RTC, used only at boot time */ |
205 | switch (sys_ctrler) { | 205 | switch (sys_ctrler) { |
diff --git a/arch/ppc64/kernel/Makefile b/arch/ppc64/kernel/Makefile index dac4cc20fa93..d0edea503c49 100644 --- a/arch/ppc64/kernel/Makefile +++ b/arch/ppc64/kernel/Makefile | |||
@@ -13,7 +13,6 @@ endif | |||
13 | 13 | ||
14 | obj-y += idle.o dma.o \ | 14 | obj-y += idle.o dma.o \ |
15 | align.o \ | 15 | align.o \ |
16 | rtc.o \ | ||
17 | iommu.o | 16 | iommu.o |
18 | 17 | ||
19 | pci-obj-$(CONFIG_PPC_MULTIPLATFORM) += pci_dn.o pci_direct_iommu.o | 18 | pci-obj-$(CONFIG_PPC_MULTIPLATFORM) += pci_dn.o pci_direct_iommu.o |
diff --git a/arch/ppc64/kernel/rtc.c b/arch/ppc64/kernel/rtc.c deleted file mode 100644 index 79e7ed2858dd..000000000000 --- a/arch/ppc64/kernel/rtc.c +++ /dev/null | |||
@@ -1,358 +0,0 @@ | |||
1 | /* | ||
2 | * Real Time Clock interface for PPC64. | ||
3 | * | ||
4 | * Based on rtc.c by Paul Gortmaker | ||
5 | * | ||
6 | * This driver allows use of the real time clock | ||
7 | * from user space. It exports the /dev/rtc | ||
8 | * interface supporting various ioctl() and also the | ||
9 | * /proc/driver/rtc pseudo-file for status information. | ||
10 | * | ||
11 | * Interface does not support RTC interrupts nor an alarm. | ||
12 | * | ||
13 | * This program is free software; you can redistribute it and/or | ||
14 | * modify it under the terms of the GNU General Public License | ||
15 | * as published by the Free Software Foundation; either version | ||
16 | * 2 of the License, or (at your option) any later version. | ||
17 | * | ||
18 | * 1.0 Mike Corrigan: IBM iSeries rtc support | ||
19 | * 1.1 Dave Engebretsen: IBM pSeries rtc support | ||
20 | */ | ||
21 | |||
22 | #define RTC_VERSION "1.1" | ||
23 | |||
24 | #include <linux/config.h> | ||
25 | #include <linux/module.h> | ||
26 | #include <linux/kernel.h> | ||
27 | #include <linux/types.h> | ||
28 | #include <linux/miscdevice.h> | ||
29 | #include <linux/ioport.h> | ||
30 | #include <linux/fcntl.h> | ||
31 | #include <linux/mc146818rtc.h> | ||
32 | #include <linux/init.h> | ||
33 | #include <linux/poll.h> | ||
34 | #include <linux/proc_fs.h> | ||
35 | #include <linux/spinlock.h> | ||
36 | #include <linux/bcd.h> | ||
37 | #include <linux/interrupt.h> | ||
38 | #include <linux/delay.h> | ||
39 | |||
40 | #include <asm/io.h> | ||
41 | #include <asm/uaccess.h> | ||
42 | #include <asm/system.h> | ||
43 | #include <asm/time.h> | ||
44 | #include <asm/rtas.h> | ||
45 | |||
46 | #include <asm/machdep.h> | ||
47 | |||
48 | /* | ||
49 | * We sponge a minor off of the misc major. No need slurping | ||
50 | * up another valuable major dev number for this. If you add | ||
51 | * an ioctl, make sure you don't conflict with SPARC's RTC | ||
52 | * ioctls. | ||
53 | */ | ||
54 | |||
55 | static ssize_t rtc_read(struct file *file, char __user *buf, | ||
56 | size_t count, loff_t *ppos); | ||
57 | |||
58 | static int rtc_ioctl(struct inode *inode, struct file *file, | ||
59 | unsigned int cmd, unsigned long arg); | ||
60 | |||
61 | static int rtc_read_proc(char *page, char **start, off_t off, | ||
62 | int count, int *eof, void *data); | ||
63 | |||
64 | /* | ||
65 | * If this driver ever becomes modularised, it will be really nice | ||
66 | * to make the epoch retain its value across module reload... | ||
67 | */ | ||
68 | |||
69 | static unsigned long epoch = 1900; /* year corresponding to 0x00 */ | ||
70 | |||
71 | static const unsigned char days_in_mo[] = | ||
72 | {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; | ||
73 | |||
74 | /* | ||
75 | * Now all the various file operations that we export. | ||
76 | */ | ||
77 | |||
78 | static ssize_t rtc_read(struct file *file, char __user *buf, | ||
79 | size_t count, loff_t *ppos) | ||
80 | { | ||
81 | return -EIO; | ||
82 | } | ||
83 | |||
84 | static int rtc_ioctl(struct inode *inode, struct file *file, unsigned int cmd, | ||
85 | unsigned long arg) | ||
86 | { | ||
87 | struct rtc_time wtime; | ||
88 | |||
89 | switch (cmd) { | ||
90 | case RTC_RD_TIME: /* Read the time/date from RTC */ | ||
91 | { | ||
92 | memset(&wtime, 0, sizeof(struct rtc_time)); | ||
93 | ppc_md.get_rtc_time(&wtime); | ||
94 | break; | ||
95 | } | ||
96 | case RTC_SET_TIME: /* Set the RTC */ | ||
97 | { | ||
98 | struct rtc_time rtc_tm; | ||
99 | unsigned char mon, day, hrs, min, sec, leap_yr; | ||
100 | unsigned int yrs; | ||
101 | |||
102 | if (!capable(CAP_SYS_TIME)) | ||
103 | return -EACCES; | ||
104 | |||
105 | if (copy_from_user(&rtc_tm, (struct rtc_time __user *)arg, | ||
106 | sizeof(struct rtc_time))) | ||
107 | return -EFAULT; | ||
108 | |||
109 | yrs = rtc_tm.tm_year; | ||
110 | mon = rtc_tm.tm_mon + 1; /* tm_mon starts at zero */ | ||
111 | day = rtc_tm.tm_mday; | ||
112 | hrs = rtc_tm.tm_hour; | ||
113 | min = rtc_tm.tm_min; | ||
114 | sec = rtc_tm.tm_sec; | ||
115 | |||
116 | if (yrs < 70) | ||
117 | return -EINVAL; | ||
118 | |||
119 | leap_yr = ((!(yrs % 4) && (yrs % 100)) || !(yrs % 400)); | ||
120 | |||
121 | if ((mon > 12) || (day == 0)) | ||
122 | return -EINVAL; | ||
123 | |||
124 | if (day > (days_in_mo[mon] + ((mon == 2) && leap_yr))) | ||
125 | return -EINVAL; | ||
126 | |||
127 | if ((hrs >= 24) || (min >= 60) || (sec >= 60)) | ||
128 | return -EINVAL; | ||
129 | |||
130 | if ( yrs > 169 ) | ||
131 | return -EINVAL; | ||
132 | |||
133 | ppc_md.set_rtc_time(&rtc_tm); | ||
134 | |||
135 | return 0; | ||
136 | } | ||
137 | case RTC_EPOCH_READ: /* Read the epoch. */ | ||
138 | { | ||
139 | return put_user (epoch, (unsigned long __user *)arg); | ||
140 | } | ||
141 | case RTC_EPOCH_SET: /* Set the epoch. */ | ||
142 | { | ||
143 | /* | ||
144 | * There were no RTC clocks before 1900. | ||
145 | */ | ||
146 | if (arg < 1900) | ||
147 | return -EINVAL; | ||
148 | |||
149 | if (!capable(CAP_SYS_TIME)) | ||
150 | return -EACCES; | ||
151 | |||
152 | epoch = arg; | ||
153 | return 0; | ||
154 | } | ||
155 | default: | ||
156 | return -EINVAL; | ||
157 | } | ||
158 | return copy_to_user((void __user *)arg, &wtime, sizeof wtime) ? -EFAULT : 0; | ||
159 | } | ||
160 | |||
161 | static int rtc_open(struct inode *inode, struct file *file) | ||
162 | { | ||
163 | nonseekable_open(inode, file); | ||
164 | return 0; | ||
165 | } | ||
166 | |||
167 | static int rtc_release(struct inode *inode, struct file *file) | ||
168 | { | ||
169 | return 0; | ||
170 | } | ||
171 | |||
172 | /* | ||
173 | * The various file operations we support. | ||
174 | */ | ||
175 | static struct file_operations rtc_fops = { | ||
176 | .owner = THIS_MODULE, | ||
177 | .llseek = no_llseek, | ||
178 | .read = rtc_read, | ||
179 | .ioctl = rtc_ioctl, | ||
180 | .open = rtc_open, | ||
181 | .release = rtc_release, | ||
182 | }; | ||
183 | |||
184 | static struct miscdevice rtc_dev = { | ||
185 | .minor = RTC_MINOR, | ||
186 | .name = "rtc", | ||
187 | .fops = &rtc_fops | ||
188 | }; | ||
189 | |||
190 | static int __init rtc_init(void) | ||
191 | { | ||
192 | int retval; | ||
193 | |||
194 | retval = misc_register(&rtc_dev); | ||
195 | if(retval < 0) | ||
196 | return retval; | ||
197 | |||
198 | #ifdef CONFIG_PROC_FS | ||
199 | if (create_proc_read_entry("driver/rtc", 0, NULL, rtc_read_proc, NULL) | ||
200 | == NULL) { | ||
201 | misc_deregister(&rtc_dev); | ||
202 | return -ENOMEM; | ||
203 | } | ||
204 | #endif | ||
205 | |||
206 | printk(KERN_INFO "i/pSeries Real Time Clock Driver v" RTC_VERSION "\n"); | ||
207 | |||
208 | return 0; | ||
209 | } | ||
210 | |||
211 | static void __exit rtc_exit (void) | ||
212 | { | ||
213 | remove_proc_entry ("driver/rtc", NULL); | ||
214 | misc_deregister(&rtc_dev); | ||
215 | } | ||
216 | |||
217 | module_init(rtc_init); | ||
218 | module_exit(rtc_exit); | ||
219 | |||
220 | /* | ||
221 | * Info exported via "/proc/driver/rtc". | ||
222 | */ | ||
223 | |||
224 | static int rtc_proc_output (char *buf) | ||
225 | { | ||
226 | |||
227 | char *p; | ||
228 | struct rtc_time tm; | ||
229 | |||
230 | p = buf; | ||
231 | |||
232 | ppc_md.get_rtc_time(&tm); | ||
233 | |||
234 | /* | ||
235 | * There is no way to tell if the luser has the RTC set for local | ||
236 | * time or for Universal Standard Time (GMT). Probably local though. | ||
237 | */ | ||
238 | p += sprintf(p, | ||
239 | "rtc_time\t: %02d:%02d:%02d\n" | ||
240 | "rtc_date\t: %04d-%02d-%02d\n" | ||
241 | "rtc_epoch\t: %04lu\n", | ||
242 | tm.tm_hour, tm.tm_min, tm.tm_sec, | ||
243 | tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday, epoch); | ||
244 | |||
245 | p += sprintf(p, | ||
246 | "DST_enable\t: no\n" | ||
247 | "BCD\t\t: yes\n" | ||
248 | "24hr\t\t: yes\n" ); | ||
249 | |||
250 | return p - buf; | ||
251 | } | ||
252 | |||
253 | static int rtc_read_proc(char *page, char **start, off_t off, | ||
254 | int count, int *eof, void *data) | ||
255 | { | ||
256 | int len = rtc_proc_output (page); | ||
257 | if (len <= off+count) *eof = 1; | ||
258 | *start = page + off; | ||
259 | len -= off; | ||
260 | if (len>count) len = count; | ||
261 | if (len<0) len = 0; | ||
262 | return len; | ||
263 | } | ||
264 | |||
265 | #ifdef CONFIG_PPC_RTAS | ||
266 | #define MAX_RTC_WAIT 5000 /* 5 sec */ | ||
267 | #define RTAS_CLOCK_BUSY (-2) | ||
268 | unsigned long rtas_get_boot_time(void) | ||
269 | { | ||
270 | int ret[8]; | ||
271 | int error, wait_time; | ||
272 | unsigned long max_wait_tb; | ||
273 | |||
274 | max_wait_tb = __get_tb() + tb_ticks_per_usec * 1000 * MAX_RTC_WAIT; | ||
275 | do { | ||
276 | error = rtas_call(rtas_token("get-time-of-day"), 0, 8, ret); | ||
277 | if (error == RTAS_CLOCK_BUSY || rtas_is_extended_busy(error)) { | ||
278 | wait_time = rtas_extended_busy_delay_time(error); | ||
279 | /* This is boot time so we spin. */ | ||
280 | udelay(wait_time*1000); | ||
281 | error = RTAS_CLOCK_BUSY; | ||
282 | } | ||
283 | } while (error == RTAS_CLOCK_BUSY && (__get_tb() < max_wait_tb)); | ||
284 | |||
285 | if (error != 0 && printk_ratelimit()) { | ||
286 | printk(KERN_WARNING "error: reading the clock failed (%d)\n", | ||
287 | error); | ||
288 | return 0; | ||
289 | } | ||
290 | |||
291 | return mktime(ret[0], ret[1], ret[2], ret[3], ret[4], ret[5]); | ||
292 | } | ||
293 | |||
294 | /* NOTE: get_rtc_time will get an error if executed in interrupt context | ||
295 | * and if a delay is needed to read the clock. In this case we just | ||
296 | * silently return without updating rtc_tm. | ||
297 | */ | ||
298 | void rtas_get_rtc_time(struct rtc_time *rtc_tm) | ||
299 | { | ||
300 | int ret[8]; | ||
301 | int error, wait_time; | ||
302 | unsigned long max_wait_tb; | ||
303 | |||
304 | max_wait_tb = __get_tb() + tb_ticks_per_usec * 1000 * MAX_RTC_WAIT; | ||
305 | do { | ||
306 | error = rtas_call(rtas_token("get-time-of-day"), 0, 8, ret); | ||
307 | if (error == RTAS_CLOCK_BUSY || rtas_is_extended_busy(error)) { | ||
308 | if (in_interrupt() && printk_ratelimit()) { | ||
309 | printk(KERN_WARNING "error: reading clock would delay interrupt\n"); | ||
310 | return; /* delay not allowed */ | ||
311 | } | ||
312 | wait_time = rtas_extended_busy_delay_time(error); | ||
313 | msleep_interruptible(wait_time); | ||
314 | error = RTAS_CLOCK_BUSY; | ||
315 | } | ||
316 | } while (error == RTAS_CLOCK_BUSY && (__get_tb() < max_wait_tb)); | ||
317 | |||
318 | if (error != 0 && printk_ratelimit()) { | ||
319 | printk(KERN_WARNING "error: reading the clock failed (%d)\n", | ||
320 | error); | ||
321 | return; | ||
322 | } | ||
323 | |||
324 | rtc_tm->tm_sec = ret[5]; | ||
325 | rtc_tm->tm_min = ret[4]; | ||
326 | rtc_tm->tm_hour = ret[3]; | ||
327 | rtc_tm->tm_mday = ret[2]; | ||
328 | rtc_tm->tm_mon = ret[1] - 1; | ||
329 | rtc_tm->tm_year = ret[0] - 1900; | ||
330 | } | ||
331 | |||
332 | int rtas_set_rtc_time(struct rtc_time *tm) | ||
333 | { | ||
334 | int error, wait_time; | ||
335 | unsigned long max_wait_tb; | ||
336 | |||
337 | max_wait_tb = __get_tb() + tb_ticks_per_usec * 1000 * MAX_RTC_WAIT; | ||
338 | do { | ||
339 | error = rtas_call(rtas_token("set-time-of-day"), 7, 1, NULL, | ||
340 | tm->tm_year + 1900, tm->tm_mon + 1, | ||
341 | tm->tm_mday, tm->tm_hour, tm->tm_min, | ||
342 | tm->tm_sec, 0); | ||
343 | if (error == RTAS_CLOCK_BUSY || rtas_is_extended_busy(error)) { | ||
344 | if (in_interrupt()) | ||
345 | return 1; /* probably decrementer */ | ||
346 | wait_time = rtas_extended_busy_delay_time(error); | ||
347 | msleep_interruptible(wait_time); | ||
348 | error = RTAS_CLOCK_BUSY; | ||
349 | } | ||
350 | } while (error == RTAS_CLOCK_BUSY && (__get_tb() < max_wait_tb)); | ||
351 | |||
352 | if (error != 0 && printk_ratelimit()) | ||
353 | printk(KERN_WARNING "error: setting the clock failed (%d)\n", | ||
354 | error); | ||
355 | |||
356 | return 0; | ||
357 | } | ||
358 | #endif | ||