diff options
author | Stephen Rothwell <sfr@canb.auug.org.au> | 2005-09-27 04:44:42 -0400 |
---|---|---|
committer | Stephen Rothwell <sfr@canb.auug.org.au> | 2005-09-27 04:44:42 -0400 |
commit | c8b84976f86adcd10c221d398e1d0be2b778f3c8 (patch) | |
tree | 54924b199234c014ad6d70269e24c59041a69432 | |
parent | 2960eb661a82131b9492cdd1b6500a5f74ccc394 (diff) |
powerpc: move iSeries_setup.[ch] and mf.c into platforms/iseries
iSeries_setup.c becomes setup.c
iSeries_setup.h becomes setup.h
mf.c retains its name
Also moved iSeries_[gs]et_rtc_time and iSeries_get_boot_time into
mf.c since they are just small wrappers around mf_ functions.
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
-rw-r--r-- | arch/powerpc/platforms/iseries/Makefile | 2 | ||||
-rw-r--r-- | arch/powerpc/platforms/iseries/mf.c (renamed from arch/ppc64/kernel/mf.c) | 85 | ||||
-rw-r--r-- | arch/powerpc/platforms/iseries/setup.c (renamed from arch/ppc64/kernel/iSeries_setup.c) | 5 | ||||
-rw-r--r-- | arch/powerpc/platforms/iseries/setup.h (renamed from arch/ppc64/kernel/iSeries_setup.h) | 2 | ||||
-rw-r--r-- | arch/ppc64/kernel/Makefile | 4 | ||||
-rw-r--r-- | arch/ppc64/kernel/rtc.c | 37 |
6 files changed, 65 insertions, 70 deletions
diff --git a/arch/powerpc/platforms/iseries/Makefile b/arch/powerpc/platforms/iseries/Makefile index 095471d50d9f..f5e11907cab1 100644 --- a/arch/powerpc/platforms/iseries/Makefile +++ b/arch/powerpc/platforms/iseries/Makefile | |||
@@ -1 +1 @@ | |||
obj-$(CONFIG_PPC_ISERIES) += hvcall.o hvlpconfig.o lpardata.o | obj-y += hvcall.o hvlpconfig.o lpardata.o setup.o mf.o | ||
diff --git a/arch/ppc64/kernel/mf.c b/arch/powerpc/platforms/iseries/mf.c index ef4a338ebd01..82f5abab9afa 100644 --- a/arch/ppc64/kernel/mf.c +++ b/arch/powerpc/platforms/iseries/mf.c | |||
@@ -1,29 +1,28 @@ | |||
1 | /* | 1 | /* |
2 | * mf.c | 2 | * Copyright (C) 2001 Troy D. Armstrong IBM Corporation |
3 | * Copyright (C) 2001 Troy D. Armstrong IBM Corporation | 3 | * Copyright (C) 2004-2005 Stephen Rothwell IBM Corporation |
4 | * Copyright (C) 2004-2005 Stephen Rothwell IBM Corporation | 4 | * |
5 | * | 5 | * This modules exists as an interface between a Linux secondary partition |
6 | * This modules exists as an interface between a Linux secondary partition | 6 | * running on an iSeries and the primary partition's Virtual Service |
7 | * running on an iSeries and the primary partition's Virtual Service | 7 | * Processor (VSP) object. The VSP has final authority over powering on/off |
8 | * Processor (VSP) object. The VSP has final authority over powering on/off | 8 | * all partitions in the iSeries. It also provides miscellaneous low-level |
9 | * all partitions in the iSeries. It also provides miscellaneous low-level | 9 | * machine facility type operations. |
10 | * machine facility type operations. | 10 | * |
11 | * | 11 | * |
12 | * | 12 | * This program is free software; you can redistribute it and/or modify |
13 | * This program is free software; you can redistribute it and/or modify | 13 | * it under the terms of the GNU General Public License as published by |
14 | * it under the terms of the GNU General Public License as published by | 14 | * the Free Software Foundation; either version 2 of the License, or |
15 | * the Free Software Foundation; either version 2 of the License, or | 15 | * (at your option) any later version. |
16 | * (at your option) any later version. | 16 | * |
17 | * | 17 | * This program is distributed in the hope that it will be useful, |
18 | * This program is distributed in the hope that it will be useful, | 18 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 20 | * GNU General Public License for more details. |
21 | * GNU General Public License for more details. | 21 | * |
22 | * | 22 | * You should have received a copy of the GNU General Public License |
23 | * You should have received a copy of the GNU General Public License | 23 | * along with this program; if not, write to the Free Software |
24 | * along with this program; if not, write to the Free Software | 24 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
25 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 25 | */ |
26 | */ | ||
27 | 26 | ||
28 | #include <linux/types.h> | 27 | #include <linux/types.h> |
29 | #include <linux/errno.h> | 28 | #include <linux/errno.h> |
@@ -42,6 +41,10 @@ | |||
42 | #include <asm/iSeries/HvLpConfig.h> | 41 | #include <asm/iSeries/HvLpConfig.h> |
43 | #include <asm/iSeries/ItLpQueue.h> | 42 | #include <asm/iSeries/ItLpQueue.h> |
44 | 43 | ||
44 | #include "setup.h" | ||
45 | |||
46 | extern int piranha_simulator; | ||
47 | |||
45 | /* | 48 | /* |
46 | * This is the structure layout for the Machine Facilites LPAR event | 49 | * This is the structure layout for the Machine Facilites LPAR event |
47 | * flows. | 50 | * flows. |
@@ -1279,3 +1282,35 @@ static int __init mf_proc_init(void) | |||
1279 | __initcall(mf_proc_init); | 1282 | __initcall(mf_proc_init); |
1280 | 1283 | ||
1281 | #endif /* CONFIG_PROC_FS */ | 1284 | #endif /* CONFIG_PROC_FS */ |
1285 | |||
1286 | /* | ||
1287 | * Get the RTC from the virtual service processor | ||
1288 | * This requires flowing LpEvents to the primary partition | ||
1289 | */ | ||
1290 | void iSeries_get_rtc_time(struct rtc_time *rtc_tm) | ||
1291 | { | ||
1292 | if (piranha_simulator) | ||
1293 | return; | ||
1294 | |||
1295 | mf_get_rtc(rtc_tm); | ||
1296 | rtc_tm->tm_mon--; | ||
1297 | } | ||
1298 | |||
1299 | /* | ||
1300 | * Set the RTC in the virtual service processor | ||
1301 | * This requires flowing LpEvents to the primary partition | ||
1302 | */ | ||
1303 | int iSeries_set_rtc_time(struct rtc_time *tm) | ||
1304 | { | ||
1305 | mf_set_rtc(tm); | ||
1306 | return 0; | ||
1307 | } | ||
1308 | |||
1309 | void iSeries_get_boot_time(struct rtc_time *tm) | ||
1310 | { | ||
1311 | if (piranha_simulator) | ||
1312 | return; | ||
1313 | |||
1314 | mf_get_boot_rtc(tm); | ||
1315 | tm->tm_mon -= 1; | ||
1316 | } | ||
diff --git a/arch/ppc64/kernel/iSeries_setup.c b/arch/powerpc/platforms/iseries/setup.c index 9daf734adbd5..ad78c8581a5a 100644 --- a/arch/ppc64/kernel/iSeries_setup.c +++ b/arch/powerpc/platforms/iseries/setup.c | |||
@@ -2,8 +2,6 @@ | |||
2 | * Copyright (c) 2000 Mike Corrigan <mikejc@us.ibm.com> | 2 | * Copyright (c) 2000 Mike Corrigan <mikejc@us.ibm.com> |
3 | * Copyright (c) 1999-2000 Grant Erickson <grant@lcse.umn.edu> | 3 | * Copyright (c) 1999-2000 Grant Erickson <grant@lcse.umn.edu> |
4 | * | 4 | * |
5 | * Module name: iSeries_setup.c | ||
6 | * | ||
7 | * Description: | 5 | * Description: |
8 | * Architecture- / platform-specific boot-time initialization code for | 6 | * Architecture- / platform-specific boot-time initialization code for |
9 | * the IBM iSeries LPAR. Adapted from original code by Grant Erickson and | 7 | * the IBM iSeries LPAR. Adapted from original code by Grant Erickson and |
@@ -42,7 +40,6 @@ | |||
42 | #include <asm/firmware.h> | 40 | #include <asm/firmware.h> |
43 | 41 | ||
44 | #include <asm/time.h> | 42 | #include <asm/time.h> |
45 | #include "iSeries_setup.h" | ||
46 | #include <asm/naca.h> | 43 | #include <asm/naca.h> |
47 | #include <asm/paca.h> | 44 | #include <asm/paca.h> |
48 | #include <asm/cache.h> | 45 | #include <asm/cache.h> |
@@ -62,6 +59,8 @@ | |||
62 | #include <asm/iSeries/ItVpdAreas.h> | 59 | #include <asm/iSeries/ItVpdAreas.h> |
63 | #include <asm/iSeries/LparMap.h> | 60 | #include <asm/iSeries/LparMap.h> |
64 | 61 | ||
62 | #include "setup.h" | ||
63 | |||
65 | extern void hvlog(char *fmt, ...); | 64 | extern void hvlog(char *fmt, ...); |
66 | 65 | ||
67 | #ifdef DEBUG | 66 | #ifdef DEBUG |
diff --git a/arch/ppc64/kernel/iSeries_setup.h b/arch/powerpc/platforms/iseries/setup.h index c6eb29a245ac..6da89ae991ce 100644 --- a/arch/ppc64/kernel/iSeries_setup.h +++ b/arch/powerpc/platforms/iseries/setup.h | |||
@@ -2,8 +2,6 @@ | |||
2 | * Copyright (c) 2000 Mike Corrigan <mikejc@us.ibm.com> | 2 | * Copyright (c) 2000 Mike Corrigan <mikejc@us.ibm.com> |
3 | * Copyright (c) 1999-2000 Grant Erickson <grant@lcse.umn.edu> | 3 | * Copyright (c) 1999-2000 Grant Erickson <grant@lcse.umn.edu> |
4 | * | 4 | * |
5 | * Module name: as400_setup.h | ||
6 | * | ||
7 | * Description: | 5 | * Description: |
8 | * Architecture- / platform-specific boot-time initialization code for | 6 | * Architecture- / platform-specific boot-time initialization code for |
9 | * the IBM AS/400 LPAR. Adapted from original code by Grant Erickson and | 7 | * the IBM AS/400 LPAR. Adapted from original code by Grant Erickson and |
diff --git a/arch/ppc64/kernel/Makefile b/arch/ppc64/kernel/Makefile index 4d95f0d0137a..b558cc0f4d9e 100644 --- a/arch/ppc64/kernel/Makefile +++ b/arch/ppc64/kernel/Makefile | |||
@@ -22,8 +22,8 @@ pci-obj-$(CONFIG_PPC_MULTIPLATFORM) += pci_dn.o pci_direct_iommu.o | |||
22 | 22 | ||
23 | obj-$(CONFIG_PCI) += pci.o pci_iommu.o iomap.o $(pci-obj-y) | 23 | obj-$(CONFIG_PCI) += pci.o pci_iommu.o iomap.o $(pci-obj-y) |
24 | 24 | ||
25 | obj-$(CONFIG_PPC_ISERIES) += iSeries_setup.o ItLpQueue.o hvCall.o \ | 25 | obj-$(CONFIG_PPC_ISERIES) += ItLpQueue.o hvCall.o \ |
26 | mf.o HvLpEvent.o iSeries_proc.o iSeries_htab.o \ | 26 | HvLpEvent.o iSeries_proc.o iSeries_htab.o \ |
27 | iSeries_iommu.o | 27 | iSeries_iommu.o |
28 | 28 | ||
29 | obj-$(CONFIG_PPC_MULTIPLATFORM) += nvram.o i8259.o prom_init.o | 29 | obj-$(CONFIG_PPC_MULTIPLATFORM) += nvram.o i8259.o prom_init.o |
diff --git a/arch/ppc64/kernel/rtc.c b/arch/ppc64/kernel/rtc.c index 6ff52bc61325..88ae13f81c46 100644 --- a/arch/ppc64/kernel/rtc.c +++ b/arch/ppc64/kernel/rtc.c | |||
@@ -43,11 +43,8 @@ | |||
43 | #include <asm/time.h> | 43 | #include <asm/time.h> |
44 | #include <asm/rtas.h> | 44 | #include <asm/rtas.h> |
45 | 45 | ||
46 | #include <asm/iSeries/mf.h> | ||
47 | #include <asm/machdep.h> | 46 | #include <asm/machdep.h> |
48 | 47 | ||
49 | extern int piranha_simulator; | ||
50 | |||
51 | /* | 48 | /* |
52 | * We sponge a minor off of the misc major. No need slurping | 49 | * We sponge a minor off of the misc major. No need slurping |
53 | * up another valuable major dev number for this. If you add | 50 | * up another valuable major dev number for this. If you add |
@@ -265,40 +262,6 @@ static int rtc_read_proc(char *page, char **start, off_t off, | |||
265 | return len; | 262 | return len; |
266 | } | 263 | } |
267 | 264 | ||
268 | #ifdef CONFIG_PPC_ISERIES | ||
269 | /* | ||
270 | * Get the RTC from the virtual service processor | ||
271 | * This requires flowing LpEvents to the primary partition | ||
272 | */ | ||
273 | void iSeries_get_rtc_time(struct rtc_time *rtc_tm) | ||
274 | { | ||
275 | if (piranha_simulator) | ||
276 | return; | ||
277 | |||
278 | mf_get_rtc(rtc_tm); | ||
279 | rtc_tm->tm_mon--; | ||
280 | } | ||
281 | |||
282 | /* | ||
283 | * Set the RTC in the virtual service processor | ||
284 | * This requires flowing LpEvents to the primary partition | ||
285 | */ | ||
286 | int iSeries_set_rtc_time(struct rtc_time *tm) | ||
287 | { | ||
288 | mf_set_rtc(tm); | ||
289 | return 0; | ||
290 | } | ||
291 | |||
292 | void iSeries_get_boot_time(struct rtc_time *tm) | ||
293 | { | ||
294 | if ( piranha_simulator ) | ||
295 | return; | ||
296 | |||
297 | mf_get_boot_rtc(tm); | ||
298 | tm->tm_mon -= 1; | ||
299 | } | ||
300 | #endif | ||
301 | |||
302 | #ifdef CONFIG_PPC_RTAS | 265 | #ifdef CONFIG_PPC_RTAS |
303 | #define MAX_RTC_WAIT 5000 /* 5 sec */ | 266 | #define MAX_RTC_WAIT 5000 /* 5 sec */ |
304 | #define RTAS_CLOCK_BUSY (-2) | 267 | #define RTAS_CLOCK_BUSY (-2) |