diff mbox

powerpc/powernv: Remove powernv RTAS support

Message ID 1426141631-10741-1-git-send-email-mpe@ellerman.id.au (mailing list archive)
State Accepted
Commit 646b54f2f2041473495f166479e3e17fd59a9dd1
Delegated to: Michael Ellerman
Headers show

Commit Message

Michael Ellerman March 12, 2015, 6:27 a.m. UTC
The powernv code has some conditional support for running on bare metal
machines that have no OPAL firmware, but provide RTAS.

No released machines ever supported that, and even in the lab it was
just a transitional hack in the days when OPAL was still being
developed.

So remove the code.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
---
 arch/powerpc/platforms/powernv/Kconfig |  7 ---
 arch/powerpc/platforms/powernv/pci.c   | 98 +++++++---------------------------
 arch/powerpc/platforms/powernv/setup.c | 19 -------
 arch/powerpc/platforms/powernv/smp.c   | 13 -----
 4 files changed, 19 insertions(+), 118 deletions(-)

Comments

Benjamin Herrenschmidt March 25, 2015, 5:25 a.m. UTC | #1
On Thu, 2015-03-12 at 17:27 +1100, Michael Ellerman wrote:
> The powernv code has some conditional support for running on bare metal
> machines that have no OPAL firmware, but provide RTAS.
> 
> No released machines ever supported that, and even in the lab it was
> just a transitional hack in the days when OPAL was still being
> developed.
> 
> So remove the code.
> 
> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>

Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>

> ---
>  arch/powerpc/platforms/powernv/Kconfig |  7 ---
>  arch/powerpc/platforms/powernv/pci.c   | 98 +++++++---------------------------
>  arch/powerpc/platforms/powernv/setup.c | 19 -------
>  arch/powerpc/platforms/powernv/smp.c   | 13 -----
>  4 files changed, 19 insertions(+), 118 deletions(-)
> 
> diff --git a/arch/powerpc/platforms/powernv/Kconfig b/arch/powerpc/platforms/powernv/Kconfig
> index 45a8ed0585cd..4b044d8cb49a 100644
> --- a/arch/powerpc/platforms/powernv/Kconfig
> +++ b/arch/powerpc/platforms/powernv/Kconfig
> @@ -19,10 +19,3 @@ config PPC_POWERNV
>  	select CPU_FREQ_GOV_CONSERVATIVE
>  	select PPC_DOORBELL
>  	default y
> -
> -config PPC_POWERNV_RTAS
> -	depends on PPC_POWERNV
> -	bool "Support for RTAS based PowerNV platforms such as BML"
> -	default y
> -	select PPC_ICS_RTAS
> -	select PPC_RTAS
> diff --git a/arch/powerpc/platforms/powernv/pci.c b/arch/powerpc/platforms/powernv/pci.c
> index 54323d6b5166..c8939ad221f9 100644
> --- a/arch/powerpc/platforms/powernv/pci.c
> +++ b/arch/powerpc/platforms/powernv/pci.c
> @@ -679,66 +679,13 @@ void pnv_pci_setup_iommu_table(struct iommu_table *tbl,
>  	tbl->it_type = TCE_PCI;
>  }
>  
> -static struct iommu_table *pnv_pci_setup_bml_iommu(struct pci_controller *hose)
> -{
> -	struct iommu_table *tbl;
> -	const __be64 *basep, *swinvp;
> -	const __be32 *sizep;
> -
> -	basep = of_get_property(hose->dn, "linux,tce-base", NULL);
> -	sizep = of_get_property(hose->dn, "linux,tce-size", NULL);
> -	if (basep == NULL || sizep == NULL) {
> -		pr_err("PCI: %s has missing tce entries !\n",
> -		       hose->dn->full_name);
> -		return NULL;
> -	}
> -	tbl = kzalloc_node(sizeof(struct iommu_table), GFP_KERNEL, hose->node);
> -	if (WARN_ON(!tbl))
> -		return NULL;
> -	pnv_pci_setup_iommu_table(tbl, __va(be64_to_cpup(basep)),
> -				  be32_to_cpup(sizep), 0, IOMMU_PAGE_SHIFT_4K);
> -	iommu_init_table(tbl, hose->node);
> -	iommu_register_group(tbl, pci_domain_nr(hose->bus), 0);
> -
> -	/* Deal with SW invalidated TCEs when needed (BML way) */
> -	swinvp = of_get_property(hose->dn, "linux,tce-sw-invalidate-info",
> -				 NULL);
> -	if (swinvp) {
> -		tbl->it_busno = be64_to_cpu(swinvp[1]);
> -		tbl->it_index = (unsigned long)ioremap(be64_to_cpup(swinvp), 8);
> -		tbl->it_type = TCE_PCI_SWINV_CREATE | TCE_PCI_SWINV_FREE;
> -	}
> -	return tbl;
> -}
> -
> -static void pnv_pci_dma_fallback_setup(struct pci_controller *hose,
> -				       struct pci_dev *pdev)
> -{
> -	struct device_node *np = pci_bus_to_OF_node(hose->bus);
> -	struct pci_dn *pdn;
> -
> -	if (np == NULL)
> -		return;
> -	pdn = PCI_DN(np);
> -	if (!pdn->iommu_table)
> -		pdn->iommu_table = pnv_pci_setup_bml_iommu(hose);
> -	if (!pdn->iommu_table)
> -		return;
> -	set_iommu_table_base_and_group(&pdev->dev, pdn->iommu_table);
> -}
> -
>  static void pnv_pci_dma_dev_setup(struct pci_dev *pdev)
>  {
>  	struct pci_controller *hose = pci_bus_to_host(pdev->bus);
>  	struct pnv_phb *phb = hose->private_data;
>  
> -	/* If we have no phb structure, try to setup a fallback based on
> -	 * the device-tree (RTAS PCI for example)
> -	 */
>  	if (phb && phb->dma_dev_setup)
>  		phb->dma_dev_setup(phb, pdev);
> -	else
> -		pnv_pci_dma_fallback_setup(hose, pdev);
>  }
>  
>  int pnv_pci_dma_set_mask(struct pci_dev *pdev, u64 dma_mask)
> @@ -784,38 +731,31 @@ DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_IBM, 0x3b9, pnv_p7ioc_rc_quirk);
>  void __init pnv_pci_init(void)
>  {
>  	struct device_node *np;
> +	bool found_ioda = false;
>  
>  	pci_add_flags(PCI_CAN_SKIP_ISA_ALIGN);
>  
> -	/* OPAL absent, try POPAL first then RTAS detection of PHBs */
> -	if (!firmware_has_feature(FW_FEATURE_OPAL)) {
> -#ifdef CONFIG_PPC_POWERNV_RTAS
> -		init_pci_config_tokens();
> -		find_and_init_phbs();
> -#endif /* CONFIG_PPC_POWERNV_RTAS */
> -	}
> -	/* OPAL is here, do our normal stuff */
> -	else {
> -		int found_ioda = 0;
> +	/* If we don't have OPAL, eg. in sim, just skip PCI probe */
> +	if (!firmware_has_feature(FW_FEATURE_OPAL))
> +		return;
>  
> -		/* Look for IODA IO-Hubs. We don't support mixing IODA
> -		 * and p5ioc2 due to the need to change some global
> -		 * probing flags
> -		 */
> -		for_each_compatible_node(np, NULL, "ibm,ioda-hub") {
> -			pnv_pci_init_ioda_hub(np);
> -			found_ioda = 1;
> -		}
> +	/* Look for IODA IO-Hubs. We don't support mixing IODA
> +	 * and p5ioc2 due to the need to change some global
> +	 * probing flags
> +	 */
> +	for_each_compatible_node(np, NULL, "ibm,ioda-hub") {
> +		pnv_pci_init_ioda_hub(np);
> +		found_ioda = true;
> +	}
>  
> -		/* Look for p5ioc2 IO-Hubs */
> -		if (!found_ioda)
> -			for_each_compatible_node(np, NULL, "ibm,p5ioc2")
> -				pnv_pci_init_p5ioc2_hub(np);
> +	/* Look for p5ioc2 IO-Hubs */
> +	if (!found_ioda)
> +		for_each_compatible_node(np, NULL, "ibm,p5ioc2")
> +			pnv_pci_init_p5ioc2_hub(np);
>  
> -		/* Look for ioda2 built-in PHB3's */
> -		for_each_compatible_node(np, NULL, "ibm,ioda2-phb")
> -			pnv_pci_init_ioda2_phb(np);
> -	}
> +	/* Look for ioda2 built-in PHB3's */
> +	for_each_compatible_node(np, NULL, "ibm,ioda2-phb")
> +		pnv_pci_init_ioda2_phb(np);
>  
>  	/* Setup the linkage between OF nodes and PHBs */
>  	pci_devs_phb_init();
> diff --git a/arch/powerpc/platforms/powernv/setup.c b/arch/powerpc/platforms/powernv/setup.c
> index d2de7d5d7574..499ddc0dcf66 100644
> --- a/arch/powerpc/platforms/powernv/setup.c
> +++ b/arch/powerpc/platforms/powernv/setup.c
> @@ -32,7 +32,6 @@
>  #include <asm/machdep.h>
>  #include <asm/firmware.h>
>  #include <asm/xics.h>
> -#include <asm/rtas.h>
>  #include <asm/opal.h>
>  #include <asm/kexec.h>
>  #include <asm/smp.h>
> @@ -278,20 +277,6 @@ static void __init pnv_setup_machdep_opal(void)
>  	ppc_md.handle_hmi_exception = opal_handle_hmi_exception;
>  }
>  
> -#ifdef CONFIG_PPC_POWERNV_RTAS
> -static void __init pnv_setup_machdep_rtas(void)
> -{
> -	if (rtas_token("get-time-of-day") != RTAS_UNKNOWN_SERVICE) {
> -		ppc_md.get_boot_time = rtas_get_boot_time;
> -		ppc_md.get_rtc_time = rtas_get_rtc_time;
> -		ppc_md.set_rtc_time = rtas_set_rtc_time;
> -	}
> -	ppc_md.restart = rtas_restart;
> -	pm_power_off = rtas_power_off;
> -	ppc_md.halt = rtas_halt;
> -}
> -#endif /* CONFIG_PPC_POWERNV_RTAS */
> -
>  static u32 supported_cpuidle_states;
>  
>  int pnv_save_sprs_for_winkle(void)
> @@ -465,10 +450,6 @@ static int __init pnv_probe(void)
>  
>  	if (firmware_has_feature(FW_FEATURE_OPAL))
>  		pnv_setup_machdep_opal();
> -#ifdef CONFIG_PPC_POWERNV_RTAS
> -	else if (rtas.base)
> -		pnv_setup_machdep_rtas();
> -#endif /* CONFIG_PPC_POWERNV_RTAS */
>  
>  	pr_debug("PowerNV detected !\n");
>  
> diff --git a/arch/powerpc/platforms/powernv/smp.c b/arch/powerpc/platforms/powernv/smp.c
> index fc34025ef822..273d7b46f72a 100644
> --- a/arch/powerpc/platforms/powernv/smp.c
> +++ b/arch/powerpc/platforms/powernv/smp.c
> @@ -25,7 +25,6 @@
>  #include <asm/machdep.h>
>  #include <asm/cputable.h>
>  #include <asm/firmware.h>
> -#include <asm/rtas.h>
>  #include <asm/vdso_datapage.h>
>  #include <asm/cputhreads.h>
>  #include <asm/xics.h>
> @@ -241,18 +240,6 @@ void __init pnv_smp_init(void)
>  {
>  	smp_ops = &pnv_smp_ops;
>  
> -	/* XXX We don't yet have a proper entry point from HAL, for
> -	 * now we rely on kexec-style entry from BML
> -	 */
> -
> -#ifdef CONFIG_PPC_RTAS
> -	/* Non-lpar has additional take/give timebase */
> -	if (rtas_token("freeze-time-base") != RTAS_UNKNOWN_SERVICE) {
> -		smp_ops->give_timebase = rtas_give_timebase;
> -		smp_ops->take_timebase = rtas_take_timebase;
> -	}
> -#endif /* CONFIG_PPC_RTAS */
> -
>  #ifdef CONFIG_HOTPLUG_CPU
>  	ppc_md.cpu_die	= pnv_smp_cpu_kill_self;
>  #endif
Stewart Smith March 25, 2015, 5:46 a.m. UTC | #2
Michael Ellerman <mpe@ellerman.id.au> writes:

> The powernv code has some conditional support for running on bare metal
> machines that have no OPAL firmware, but provide RTAS.
>
> No released machines ever supported that, and even in the lab it was
> just a transitional hack in the days when OPAL was still being
> developed.
>
> So remove the code.
>
> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>

The only current place I could think this could be remotely possible
would be in simulator... and we should instead make the OPAL calls work
properly in the simulator for all the RTAS functionality (that we care
about).

In related news.. I should poke the simulator guys.

Acked-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Michael Ellerman March 25, 2015, 9:42 a.m. UTC | #3
On Wed, 2015-03-25 at 16:46 +1100, Stewart Smith wrote:
> Michael Ellerman <mpe@ellerman.id.au> writes:
> 
> > The powernv code has some conditional support for running on bare metal
> > machines that have no OPAL firmware, but provide RTAS.
> >
> > No released machines ever supported that, and even in the lab it was
> > just a transitional hack in the days when OPAL was still being
> > developed.
> >
> > So remove the code.
> >
> > Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
> 
> The only current place I could think this could be remotely possible
> would be in simulator... and we should instead make the OPAL calls work
> properly in the simulator for all the RTAS functionality (that we care
> about).

If you mean mambo, I tested that, at least the public version, and it doesn't
provide or need RTAS.

On the other sims we ran without RTAS during the Power8 bringup, though it was
eventually used a little bit late in the cycle. In future we should be using
skiboot, or just putting logic directly into the kernel for early bringup - or
permanently :)

> Acked-by: Stewart Smith <stewart@linux.vnet.ibm.com>

Thanks.

cheers
Aneesh Kumar K.V March 27, 2015, 12:54 p.m. UTC | #4
Michael Ellerman <mpe@ellerman.id.au> writes:

> The powernv code has some conditional support for running on bare metal
> machines that have no OPAL firmware, but provide RTAS.
>
> No released machines ever supported that, and even in the lab it was
> just a transitional hack in the days when OPAL was still being
> developed.
>
> So remove the code.

So when we select CONFIG_PPC_PSERIES, we end up selecting
CONFIG_PPC_RTAS. What is the expected behaviour there for powernv ? Can
we use RTAS call from powernv code if rtas node is present in device
tree ? Or do we want to make sure powernv always use OPAL call ?

For example, right now we will use rtas_node get-term-char and
put-term-char even with this patch applied.

-aneesh
Michael Ellerman March 28, 2015, 10:57 a.m. UTC | #5
On Fri, 2015-03-27 at 18:24 +0530, Aneesh Kumar K.V wrote:
> Michael Ellerman <mpe@ellerman.id.au> writes:
> 
> > The powernv code has some conditional support for running on bare metal
> > machines that have no OPAL firmware, but provide RTAS.
> >
> > No released machines ever supported that, and even in the lab it was
> > just a transitional hack in the days when OPAL was still being
> > developed.
> >
> > So remove the code.
> 
> So when we select CONFIG_PPC_PSERIES, we end up selecting
> CONFIG_PPC_RTAS. What is the expected behaviour there for powernv ? 

After this patch, the expected behaviour is that the powernv platform code
won't use RTAS, even if it's there. And that's fine because no real powernv
machines have RTAS.

In a perfect world the RTAS code would be isolated in platforms/pseries, but
it's used on other platforms, so it's a bit messier than that. But the expected
behaviour is that the powernv code won't use RTAS, even if the code is still
built in.

Is that what you meant?

> Can we use RTAS call from powernv code if rtas node is present in device
> tree ? 

Yes you can, if you build with CONFIG_PPC_RTAS=y. Though when I add a
powernv_defconfig (soon), it won't have CONFIG_PPC_RTAS.

> Or do we want to make sure powernv always use OPAL call ?

It depends what you mean by "powernv". Once this patch is applied the powernv
*platform* code will not use RTAS.

There may still be other code that can be built into a kernel and booted on
powernv that then uses RTAS. That's fine, if it makes sense for someone, I
don't think we need to prevent that happening.

> For example, right now we will use rtas_node get-term-char and
> put-term-char even with this patch applied.

Well you will *if* your machine has RTAS, and you have CONFIG_HVC_RTAS=y and/or
CONFIG_UDBG_RTAS_CONSOLE=y.

So I think that's fine?

cheers
Stewart Smith April 7, 2015, 5:36 a.m. UTC | #6
Michael Ellerman <mpe@ellerman.id.au> writes:
>> The only current place I could think this could be remotely possible
>> would be in simulator... and we should instead make the OPAL calls work
>> properly in the simulator for all the RTAS functionality (that we care
>> about).
>
> If you mean mambo, I tested that, at least the public version, and it doesn't
> provide or need RTAS.
>
> On the other sims we ran without RTAS during the Power8 bringup, though it was
> eventually used a little bit late in the cycle. In future we should be using
> skiboot, or just putting logic directly into the kernel for early bringup - or
> permanently :)

agreed on using skiboot. If we're going as far as booting a linux
kernel, the overhead of loading skiboot is next to nothing in
comparison. Or at least it should be.
diff mbox

Patch

diff --git a/arch/powerpc/platforms/powernv/Kconfig b/arch/powerpc/platforms/powernv/Kconfig
index 45a8ed0585cd..4b044d8cb49a 100644
--- a/arch/powerpc/platforms/powernv/Kconfig
+++ b/arch/powerpc/platforms/powernv/Kconfig
@@ -19,10 +19,3 @@  config PPC_POWERNV
 	select CPU_FREQ_GOV_CONSERVATIVE
 	select PPC_DOORBELL
 	default y
-
-config PPC_POWERNV_RTAS
-	depends on PPC_POWERNV
-	bool "Support for RTAS based PowerNV platforms such as BML"
-	default y
-	select PPC_ICS_RTAS
-	select PPC_RTAS
diff --git a/arch/powerpc/platforms/powernv/pci.c b/arch/powerpc/platforms/powernv/pci.c
index 54323d6b5166..c8939ad221f9 100644
--- a/arch/powerpc/platforms/powernv/pci.c
+++ b/arch/powerpc/platforms/powernv/pci.c
@@ -679,66 +679,13 @@  void pnv_pci_setup_iommu_table(struct iommu_table *tbl,
 	tbl->it_type = TCE_PCI;
 }
 
-static struct iommu_table *pnv_pci_setup_bml_iommu(struct pci_controller *hose)
-{
-	struct iommu_table *tbl;
-	const __be64 *basep, *swinvp;
-	const __be32 *sizep;
-
-	basep = of_get_property(hose->dn, "linux,tce-base", NULL);
-	sizep = of_get_property(hose->dn, "linux,tce-size", NULL);
-	if (basep == NULL || sizep == NULL) {
-		pr_err("PCI: %s has missing tce entries !\n",
-		       hose->dn->full_name);
-		return NULL;
-	}
-	tbl = kzalloc_node(sizeof(struct iommu_table), GFP_KERNEL, hose->node);
-	if (WARN_ON(!tbl))
-		return NULL;
-	pnv_pci_setup_iommu_table(tbl, __va(be64_to_cpup(basep)),
-				  be32_to_cpup(sizep), 0, IOMMU_PAGE_SHIFT_4K);
-	iommu_init_table(tbl, hose->node);
-	iommu_register_group(tbl, pci_domain_nr(hose->bus), 0);
-
-	/* Deal with SW invalidated TCEs when needed (BML way) */
-	swinvp = of_get_property(hose->dn, "linux,tce-sw-invalidate-info",
-				 NULL);
-	if (swinvp) {
-		tbl->it_busno = be64_to_cpu(swinvp[1]);
-		tbl->it_index = (unsigned long)ioremap(be64_to_cpup(swinvp), 8);
-		tbl->it_type = TCE_PCI_SWINV_CREATE | TCE_PCI_SWINV_FREE;
-	}
-	return tbl;
-}
-
-static void pnv_pci_dma_fallback_setup(struct pci_controller *hose,
-				       struct pci_dev *pdev)
-{
-	struct device_node *np = pci_bus_to_OF_node(hose->bus);
-	struct pci_dn *pdn;
-
-	if (np == NULL)
-		return;
-	pdn = PCI_DN(np);
-	if (!pdn->iommu_table)
-		pdn->iommu_table = pnv_pci_setup_bml_iommu(hose);
-	if (!pdn->iommu_table)
-		return;
-	set_iommu_table_base_and_group(&pdev->dev, pdn->iommu_table);
-}
-
 static void pnv_pci_dma_dev_setup(struct pci_dev *pdev)
 {
 	struct pci_controller *hose = pci_bus_to_host(pdev->bus);
 	struct pnv_phb *phb = hose->private_data;
 
-	/* If we have no phb structure, try to setup a fallback based on
-	 * the device-tree (RTAS PCI for example)
-	 */
 	if (phb && phb->dma_dev_setup)
 		phb->dma_dev_setup(phb, pdev);
-	else
-		pnv_pci_dma_fallback_setup(hose, pdev);
 }
 
 int pnv_pci_dma_set_mask(struct pci_dev *pdev, u64 dma_mask)
@@ -784,38 +731,31 @@  DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_IBM, 0x3b9, pnv_p7ioc_rc_quirk);
 void __init pnv_pci_init(void)
 {
 	struct device_node *np;
+	bool found_ioda = false;
 
 	pci_add_flags(PCI_CAN_SKIP_ISA_ALIGN);
 
-	/* OPAL absent, try POPAL first then RTAS detection of PHBs */
-	if (!firmware_has_feature(FW_FEATURE_OPAL)) {
-#ifdef CONFIG_PPC_POWERNV_RTAS
-		init_pci_config_tokens();
-		find_and_init_phbs();
-#endif /* CONFIG_PPC_POWERNV_RTAS */
-	}
-	/* OPAL is here, do our normal stuff */
-	else {
-		int found_ioda = 0;
+	/* If we don't have OPAL, eg. in sim, just skip PCI probe */
+	if (!firmware_has_feature(FW_FEATURE_OPAL))
+		return;
 
-		/* Look for IODA IO-Hubs. We don't support mixing IODA
-		 * and p5ioc2 due to the need to change some global
-		 * probing flags
-		 */
-		for_each_compatible_node(np, NULL, "ibm,ioda-hub") {
-			pnv_pci_init_ioda_hub(np);
-			found_ioda = 1;
-		}
+	/* Look for IODA IO-Hubs. We don't support mixing IODA
+	 * and p5ioc2 due to the need to change some global
+	 * probing flags
+	 */
+	for_each_compatible_node(np, NULL, "ibm,ioda-hub") {
+		pnv_pci_init_ioda_hub(np);
+		found_ioda = true;
+	}
 
-		/* Look for p5ioc2 IO-Hubs */
-		if (!found_ioda)
-			for_each_compatible_node(np, NULL, "ibm,p5ioc2")
-				pnv_pci_init_p5ioc2_hub(np);
+	/* Look for p5ioc2 IO-Hubs */
+	if (!found_ioda)
+		for_each_compatible_node(np, NULL, "ibm,p5ioc2")
+			pnv_pci_init_p5ioc2_hub(np);
 
-		/* Look for ioda2 built-in PHB3's */
-		for_each_compatible_node(np, NULL, "ibm,ioda2-phb")
-			pnv_pci_init_ioda2_phb(np);
-	}
+	/* Look for ioda2 built-in PHB3's */
+	for_each_compatible_node(np, NULL, "ibm,ioda2-phb")
+		pnv_pci_init_ioda2_phb(np);
 
 	/* Setup the linkage between OF nodes and PHBs */
 	pci_devs_phb_init();
diff --git a/arch/powerpc/platforms/powernv/setup.c b/arch/powerpc/platforms/powernv/setup.c
index d2de7d5d7574..499ddc0dcf66 100644
--- a/arch/powerpc/platforms/powernv/setup.c
+++ b/arch/powerpc/platforms/powernv/setup.c
@@ -32,7 +32,6 @@ 
 #include <asm/machdep.h>
 #include <asm/firmware.h>
 #include <asm/xics.h>
-#include <asm/rtas.h>
 #include <asm/opal.h>
 #include <asm/kexec.h>
 #include <asm/smp.h>
@@ -278,20 +277,6 @@  static void __init pnv_setup_machdep_opal(void)
 	ppc_md.handle_hmi_exception = opal_handle_hmi_exception;
 }
 
-#ifdef CONFIG_PPC_POWERNV_RTAS
-static void __init pnv_setup_machdep_rtas(void)
-{
-	if (rtas_token("get-time-of-day") != RTAS_UNKNOWN_SERVICE) {
-		ppc_md.get_boot_time = rtas_get_boot_time;
-		ppc_md.get_rtc_time = rtas_get_rtc_time;
-		ppc_md.set_rtc_time = rtas_set_rtc_time;
-	}
-	ppc_md.restart = rtas_restart;
-	pm_power_off = rtas_power_off;
-	ppc_md.halt = rtas_halt;
-}
-#endif /* CONFIG_PPC_POWERNV_RTAS */
-
 static u32 supported_cpuidle_states;
 
 int pnv_save_sprs_for_winkle(void)
@@ -465,10 +450,6 @@  static int __init pnv_probe(void)
 
 	if (firmware_has_feature(FW_FEATURE_OPAL))
 		pnv_setup_machdep_opal();
-#ifdef CONFIG_PPC_POWERNV_RTAS
-	else if (rtas.base)
-		pnv_setup_machdep_rtas();
-#endif /* CONFIG_PPC_POWERNV_RTAS */
 
 	pr_debug("PowerNV detected !\n");
 
diff --git a/arch/powerpc/platforms/powernv/smp.c b/arch/powerpc/platforms/powernv/smp.c
index fc34025ef822..273d7b46f72a 100644
--- a/arch/powerpc/platforms/powernv/smp.c
+++ b/arch/powerpc/platforms/powernv/smp.c
@@ -25,7 +25,6 @@ 
 #include <asm/machdep.h>
 #include <asm/cputable.h>
 #include <asm/firmware.h>
-#include <asm/rtas.h>
 #include <asm/vdso_datapage.h>
 #include <asm/cputhreads.h>
 #include <asm/xics.h>
@@ -241,18 +240,6 @@  void __init pnv_smp_init(void)
 {
 	smp_ops = &pnv_smp_ops;
 
-	/* XXX We don't yet have a proper entry point from HAL, for
-	 * now we rely on kexec-style entry from BML
-	 */
-
-#ifdef CONFIG_PPC_RTAS
-	/* Non-lpar has additional take/give timebase */
-	if (rtas_token("freeze-time-base") != RTAS_UNKNOWN_SERVICE) {
-		smp_ops->give_timebase = rtas_give_timebase;
-		smp_ops->take_timebase = rtas_take_timebase;
-	}
-#endif /* CONFIG_PPC_RTAS */
-
 #ifdef CONFIG_HOTPLUG_CPU
 	ppc_md.cpu_die	= pnv_smp_cpu_kill_self;
 #endif