Commit a5cb82da authored by Bharat Bhushan's avatar Bharat Bhushan Committed by Benjamin Herrenschmidt

powerpc: Fix assmption of end_of_DRAM() returns end address

memblock_end_of_DRAM() returns end_address + 1, not end address.
While some code assumes that it returns end address.
Signed-off-by: default avatarBharat Bhushan <bharat.bhushan@freescale.com>
Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
parent cf8fb553
...@@ -160,7 +160,7 @@ static void __init ppc47x_setup_arch(void) ...@@ -160,7 +160,7 @@ static void __init ppc47x_setup_arch(void)
/* No need to check the DMA config as we /know/ our windows are all of /* No need to check the DMA config as we /know/ our windows are all of
* RAM. Lets hope that doesn't change */ * RAM. Lets hope that doesn't change */
#ifdef CONFIG_SWIOTLB #ifdef CONFIG_SWIOTLB
if (memblock_end_of_DRAM() > 0xffffffff) { if ((memblock_end_of_DRAM() - 1) > 0xffffffff) {
ppc_swiotlb_enable = 1; ppc_swiotlb_enable = 1;
set_pci_dma_ops(&swiotlb_dma_ops); set_pci_dma_ops(&swiotlb_dma_ops);
ppc_md.pci_dma_dev_setup = pci_dma_dev_setup_swiotlb; ppc_md.pci_dma_dev_setup = pci_dma_dev_setup_swiotlb;
......
...@@ -77,7 +77,7 @@ void __init corenet_ds_setup_arch(void) ...@@ -77,7 +77,7 @@ void __init corenet_ds_setup_arch(void)
#endif #endif
#ifdef CONFIG_SWIOTLB #ifdef CONFIG_SWIOTLB
if (memblock_end_of_DRAM() > max) { if ((memblock_end_of_DRAM() - 1) > max) {
ppc_swiotlb_enable = 1; ppc_swiotlb_enable = 1;
set_pci_dma_ops(&swiotlb_dma_ops); set_pci_dma_ops(&swiotlb_dma_ops);
ppc_md.pci_dma_dev_setup = pci_dma_dev_setup_swiotlb; ppc_md.pci_dma_dev_setup = pci_dma_dev_setup_swiotlb;
......
...@@ -125,7 +125,7 @@ static void __init ge_imp3a_setup_arch(void) ...@@ -125,7 +125,7 @@ static void __init ge_imp3a_setup_arch(void)
mpc85xx_smp_init(); mpc85xx_smp_init();
#ifdef CONFIG_SWIOTLB #ifdef CONFIG_SWIOTLB
if (memblock_end_of_DRAM() > max) { if ((memblock_end_of_DRAM() - 1) > max) {
ppc_swiotlb_enable = 1; ppc_swiotlb_enable = 1;
set_pci_dma_ops(&swiotlb_dma_ops); set_pci_dma_ops(&swiotlb_dma_ops);
ppc_md.pci_dma_dev_setup = pci_dma_dev_setup_swiotlb; ppc_md.pci_dma_dev_setup = pci_dma_dev_setup_swiotlb;
......
...@@ -75,7 +75,7 @@ static void __init mpc8536_ds_setup_arch(void) ...@@ -75,7 +75,7 @@ static void __init mpc8536_ds_setup_arch(void)
#endif #endif
#ifdef CONFIG_SWIOTLB #ifdef CONFIG_SWIOTLB
if (memblock_end_of_DRAM() > max) { if ((memblock_end_of_DRAM() - 1) > max) {
ppc_swiotlb_enable = 1; ppc_swiotlb_enable = 1;
set_pci_dma_ops(&swiotlb_dma_ops); set_pci_dma_ops(&swiotlb_dma_ops);
ppc_md.pci_dma_dev_setup = pci_dma_dev_setup_swiotlb; ppc_md.pci_dma_dev_setup = pci_dma_dev_setup_swiotlb;
......
...@@ -173,7 +173,7 @@ static void __init mpc85xx_ds_setup_arch(void) ...@@ -173,7 +173,7 @@ static void __init mpc85xx_ds_setup_arch(void)
mpc85xx_smp_init(); mpc85xx_smp_init();
#ifdef CONFIG_SWIOTLB #ifdef CONFIG_SWIOTLB
if (memblock_end_of_DRAM() > max) { if ((memblock_end_of_DRAM() - 1) > max) {
ppc_swiotlb_enable = 1; ppc_swiotlb_enable = 1;
set_pci_dma_ops(&swiotlb_dma_ops); set_pci_dma_ops(&swiotlb_dma_ops);
ppc_md.pci_dma_dev_setup = pci_dma_dev_setup_swiotlb; ppc_md.pci_dma_dev_setup = pci_dma_dev_setup_swiotlb;
......
...@@ -359,7 +359,7 @@ static void __init mpc85xx_mds_setup_arch(void) ...@@ -359,7 +359,7 @@ static void __init mpc85xx_mds_setup_arch(void)
mpc85xx_mds_qe_init(); mpc85xx_mds_qe_init();
#ifdef CONFIG_SWIOTLB #ifdef CONFIG_SWIOTLB
if (memblock_end_of_DRAM() > max) { if ((memblock_end_of_DRAM() - 1) > max) {
ppc_swiotlb_enable = 1; ppc_swiotlb_enable = 1;
set_pci_dma_ops(&swiotlb_dma_ops); set_pci_dma_ops(&swiotlb_dma_ops);
ppc_md.pci_dma_dev_setup = pci_dma_dev_setup_swiotlb; ppc_md.pci_dma_dev_setup = pci_dma_dev_setup_swiotlb;
......
...@@ -450,7 +450,7 @@ static void __init p1022_ds_setup_arch(void) ...@@ -450,7 +450,7 @@ static void __init p1022_ds_setup_arch(void)
mpc85xx_smp_init(); mpc85xx_smp_init();
#ifdef CONFIG_SWIOTLB #ifdef CONFIG_SWIOTLB
if (memblock_end_of_DRAM() > max) { if ((memblock_end_of_DRAM() - 1) > max) {
ppc_swiotlb_enable = 1; ppc_swiotlb_enable = 1;
set_pci_dma_ops(&swiotlb_dma_ops); set_pci_dma_ops(&swiotlb_dma_ops);
ppc_md.pci_dma_dev_setup = pci_dma_dev_setup_swiotlb; ppc_md.pci_dma_dev_setup = pci_dma_dev_setup_swiotlb;
......
...@@ -102,7 +102,7 @@ mpc86xx_hpcn_setup_arch(void) ...@@ -102,7 +102,7 @@ mpc86xx_hpcn_setup_arch(void)
#endif #endif
#ifdef CONFIG_SWIOTLB #ifdef CONFIG_SWIOTLB
if (memblock_end_of_DRAM() > max) { if ((memblock_end_of_DRAM() - 1) > max) {
ppc_swiotlb_enable = 1; ppc_swiotlb_enable = 1;
set_pci_dma_ops(&swiotlb_dma_ops); set_pci_dma_ops(&swiotlb_dma_ops);
ppc_md.pci_dma_dev_setup = pci_dma_dev_setup_swiotlb; ppc_md.pci_dma_dev_setup = pci_dma_dev_setup_swiotlb;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment