hw/arm/mps2: Add I2C devices
From 'Application Note AN385', chapter 3.14: The SMM implements a simple SBCon interface based on I2C. There are 4 SBCon interfaces on the FPGA APB subsystem. Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Message-id: 20200617072539.32686-13-f4bug@amsat.org Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
		
				
					committed by
					
						
						Peter Maydell
					
				
			
			
				
	
			
			
			
						parent
						
							58f7f3c452
						
					
				
				
					commit
					ada45de9ea
				
			@@ -406,6 +406,7 @@ config MPS2
 | 
				
			|||||||
    select SPLIT_IRQ
 | 
					    select SPLIT_IRQ
 | 
				
			||||||
    select UNIMP
 | 
					    select UNIMP
 | 
				
			||||||
    select CMSDK_APB_WATCHDOG
 | 
					    select CMSDK_APB_WATCHDOG
 | 
				
			||||||
 | 
					    select VERSATILE_I2C
 | 
				
			||||||
 | 
					
 | 
				
			||||||
config FSL_IMX7
 | 
					config FSL_IMX7
 | 
				
			||||||
    bool
 | 
					    bool
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -40,6 +40,7 @@
 | 
				
			|||||||
#include "hw/misc/mps2-scc.h"
 | 
					#include "hw/misc/mps2-scc.h"
 | 
				
			||||||
#include "hw/misc/mps2-fpgaio.h"
 | 
					#include "hw/misc/mps2-fpgaio.h"
 | 
				
			||||||
#include "hw/ssi/pl022.h"
 | 
					#include "hw/ssi/pl022.h"
 | 
				
			||||||
 | 
					#include "hw/i2c/arm_sbcon_i2c.h"
 | 
				
			||||||
#include "hw/net/lan9118.h"
 | 
					#include "hw/net/lan9118.h"
 | 
				
			||||||
#include "net/net.h"
 | 
					#include "net/net.h"
 | 
				
			||||||
#include "hw/watchdog/cmsdk-apb-watchdog.h"
 | 
					#include "hw/watchdog/cmsdk-apb-watchdog.h"
 | 
				
			||||||
@@ -365,6 +366,13 @@ static void mps2_common_init(MachineState *machine)
 | 
				
			|||||||
                                 qdev_get_gpio_in(orgate_dev, j));
 | 
					                                 qdev_get_gpio_in(orgate_dev, j));
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					    for (i = 0; i < 4; i++) {
 | 
				
			||||||
 | 
					        static const hwaddr i2cbase[] = {0x40022000,    /* Touch */
 | 
				
			||||||
 | 
					                                         0x40023000,    /* Audio */
 | 
				
			||||||
 | 
					                                         0x40029000,    /* Shield0 */
 | 
				
			||||||
 | 
					                                         0x4002a000};   /* Shield1 */
 | 
				
			||||||
 | 
					        sysbus_create_simple(TYPE_ARM_SBCON_I2C, i2cbase[i], NULL);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /* In hardware this is a LAN9220; the LAN9118 is software compatible
 | 
					    /* In hardware this is a LAN9220; the LAN9118 is software compatible
 | 
				
			||||||
     * except that it doesn't support the checksum-offload feature.
 | 
					     * except that it doesn't support the checksum-offload feature.
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user