@@ -523,7 +523,7 @@ static int mvebu_pcie_handle_iobase_change(struct mvebu_pcie_port *port)
523
523
524
524
/* Are the new iobase/iolimit values invalid? */
525
525
if (conf -> iolimit < conf -> iobase ||
526
- conf -> iolimitupper < conf -> iobaseupper )
526
+ le16_to_cpu ( conf -> iolimitupper ) < le16_to_cpu ( conf -> iobaseupper ) )
527
527
return mvebu_pcie_set_window (port , port -> io_target , port -> io_attr ,
528
528
& desired , & port -> iowin );
529
529
@@ -535,10 +535,10 @@ static int mvebu_pcie_handle_iobase_change(struct mvebu_pcie_port *port)
535
535
* is the CPU address.
536
536
*/
537
537
desired .remap = ((conf -> iobase & 0xF0 ) << 8 ) |
538
- (conf -> iobaseupper << 16 );
538
+ (le16_to_cpu ( conf -> iobaseupper ) << 16 );
539
539
desired .base = port -> pcie -> io .start + desired .remap ;
540
540
desired .size = ((0xFFF | ((conf -> iolimit & 0xF0 ) << 8 ) |
541
- (conf -> iolimitupper << 16 )) -
541
+ (le16_to_cpu ( conf -> iolimitupper ) << 16 )) -
542
542
desired .remap ) +
543
543
1 ;
544
544
@@ -552,7 +552,7 @@ static int mvebu_pcie_handle_membase_change(struct mvebu_pcie_port *port)
552
552
struct pci_bridge_emul_conf * conf = & port -> bridge .conf ;
553
553
554
554
/* Are the new membase/memlimit values invalid? */
555
- if (conf -> memlimit < conf -> membase )
555
+ if (le16_to_cpu ( conf -> memlimit ) < le16_to_cpu ( conf -> membase ) )
556
556
return mvebu_pcie_set_window (port , port -> mem_target , port -> mem_attr ,
557
557
& desired , & port -> memwin );
558
558
@@ -562,8 +562,8 @@ static int mvebu_pcie_handle_membase_change(struct mvebu_pcie_port *port)
562
562
* window to setup, according to the PCI-to-PCI bridge
563
563
* specifications.
564
564
*/
565
- desired .base = ((conf -> membase & 0xFFF0 ) << 16 );
566
- desired .size = (((conf -> memlimit & 0xFFF0 ) << 16 ) | 0xFFFFF ) -
565
+ desired .base = ((le16_to_cpu ( conf -> membase ) & 0xFFF0 ) << 16 );
566
+ desired .size = (((le16_to_cpu ( conf -> memlimit ) & 0xFFF0 ) << 16 ) | 0xFFFFF ) -
567
567
desired .base + 1 ;
568
568
569
569
return mvebu_pcie_set_window (port , port -> mem_target , port -> mem_attr , & desired ,
0 commit comments