1 // 2 // Copyright (c) 2010-2018 Antmicro 3 // Copyright (c) 2011-2015 Realtime Embedded 4 // 5 // This file is licensed under the MIT License. 6 // Full license text is available in 'licenses/MIT.txt'. 7 // 8 using Antmicro.Renode.Logging; 9 using Antmicro.Renode.Peripherals.Bus; 10 11 namespace Antmicro.Renode.Peripherals.Cache 12 { 13 public class PL310 : IDoubleWordPeripheral 14 { ReadDoubleWord(long offset)15 public uint ReadDoubleWord(long offset) 16 { 17 switch((Offset)offset) 18 { 19 case Offset.CacheId: 20 return 0x410000C0; 21 default: 22 this.LogUnhandledRead(offset); 23 break; 24 } 25 return 0; 26 } 27 WriteDoubleWord(long offset, uint value)28 public void WriteDoubleWord(long offset, uint value) 29 { 30 switch((Offset)offset) 31 { 32 case Offset.CacheSync: 33 case Offset.CacheSyncProbably: 34 case Offset.InvalidateLineByPA: 35 case Offset.CleanLinebyPA: 36 case Offset.CleanAndInvalidateLine: 37 case Offset.Debug: 38 break; 39 default: 40 this.LogUnhandledWrite(offset, value); 41 break; 42 } 43 } 44 Reset()45 public void Reset() 46 { 47 48 } 49 50 public enum Offset 51 { 52 CacheId = 0x0, 53 CacheSync = 0x730, 54 CacheSyncProbably = 0x740, // TODO: check this offset, 55 InvalidateLineByPA = 0x770, 56 CleanLinebyPA = 0x7b0, 57 CleanAndInvalidateLine = 0x7f0, 58 Debug = 0xf40 59 } 60 61 } 62 } 63 64