Re: Initializing I2C on the RTEMS6 MVME3100 BSP

2023-06-27 Thread Chris Johns
On 28/6/2023 6:48 am, Zainab Olalekan wrote:
> I am encountering difficulties with initializing I2C on the RTEMS6 MVME3100 
> BSP,
> required to run EPICS test. I have made adaptations based on Heinz's patch for
> RTEMS5, but I am experiencing an error. Here is the specific error message
> alongside an attached file showing the modifications made.

The trace shows the code is crashing somewhere.

Has Heinz run I2C on the MVME3100?

We now have an #epics channel on our discord server
(https://devel.rtems.org/wiki/Developer/discord) which can be more interactive
depending on timezones.

Chris
___
users mailing list
users@rtems.org
http://lists.rtems.org/mailman/listinfo/users


Initializing I2C on the RTEMS6 MVME3100 BSP

2023-06-27 Thread Zainab Olalekan
Hello everyone,


I am encountering difficulties with initializing I2C on the RTEMS6 MVME3100 
BSP, required to run EPICS test. I have made adaptations based on Heinz's patch 
for RTEMS5, but I am experiencing an error. Here is the specific error message 
alongside an attached file showing the modifications made.

Welcome to rtems-6.0.0 (PowerPC/Generic (no FPU)/mvme3100)
BSP: mvme3100, CVS Release ($Name$)
CPU 0x8020 - rev 0x20
Additional boot options are
Initial system stack at 41cb0
Going to start PCI buses scanning and initialization
Board Type: MVME3100-1152 (S/N E1726C0)
External (=PCI Bus) Clock Freq   :    Hz
Core Complex Bus (CCB) Clock Freq:  0 Hz
CPU Clock Freq: 13332 Hz
Ethernet 0  EC:9E:CD:19:B3:53
Ethernet 1  EC:9E:CD:19:B3:54
Ethernet 2  EC:9E:CD:19:B3:55
Number of PCI buses found is : 2
BUS:SLOT:FUN  VENDOR-DEV_ID: COMMAND STATUS BASE_ADDR0 BASE_ADDR1 IRQ_PIN -> 
IRQ_LINE
  0:0x00:00x1057-0x0008:  0x0006 0x20b0 0x8000 0x   0 ->   
0 (=0x00)
  0:0x11:00x10e3-0x0148:  0x0146 0x02b0 0x8014 0x   1 ->   
0 (=0x00)
  0:0x12:00x10b5-0x6520:  0x0147 0x02b0 0x 0x   0 ->   
0 (=0x00)
  0:0x14:00x1095-0x3124:  0x01c7 0x02b0 0x8034 0x   1 ->   
2 (=0x02)
Memory: 268435456 bytes
Cleared PCI errors: pci_stat was 0x20b0
OpenPIC Version 1.2 (1 CPUs and 56 IRQ sources) at 0x3775135744
OpenPIC Vendor 0 (Unknown), Device 0 (Unknown), Stepping 0
OpenPIC timer frequency is not set
MSR is 0x1000, TCR 0x0400
-
Exit from bspstart
Tundra Tsi148 PCI-VME bridge detected at 0x8010, IRQ 0
Tsi148 Outbound Ports:
Port  VME-Addr   Size   PCI-Adrs   Mode:
0:0x2000 0x0e00 0xc000 A32, SUP, D32, SCT
1:0x 0x00ff 0xcf00 A24, SUP, D32, SCT
2:0x 0x0001 0xcfff A16, SUP, D32, SCT
7:0x 0x0100 0xce00 CSR, SUP, D32, SCT
Tsi148 Inbound Ports:
Port  VME-Addr   Size   PCI-Adrs   Mode:
0:0xc000 0x1000 0x A32, PGM, DAT, SUP, USR, MBLT, BLT
vmeTsi148 IRQ manager: looking for registers on VME...
Trying to find CSR on VME...
vmeTsi148 - IRQ manager using VME CSR to flush FIFO
 call BSP_i2c_initialize() with _IO_All_drivers_initialized = true
assumes that major 0 is assigned to i2c -
now trying to i2c intialized
libi2c: Claiming driver slot failed (rtems status code 10)
Initializing I2C library failed
now i2c intialized 2


*** BEGIN OF TEST HELLO WORLD ***
*** TEST VERSION: 6.0.0.b2967081e5daa673141d714a2e53280898dce566
*** TEST STATE: EXPECTED_PASS
*** TEST BUILD: RTEMS_POSIX_API
*** TEST TOOLS: 12.2.1 20230425 (RTEMS 6, RSB 
3c8c2ce38a8fe0a622f88fb3422d1f8fa609609b, Newlib 9ae9eef)
Hello World

*** END OF TEST HELLO WORLD ***

fatal source: RTEMS_FATAL_SOURCE_EXIT
exception vector 1 (0x1)
  next PC or address of fault = 0x902d8100
  saved MSR = 0x908d80f4
  context = task, ISR nest level = 0
  thread dispatch disable level = 0
  R0  = 0x9081003c R1  = 0x3883 R2  = 0x48014e50 R3  = 0x9421ff50
  R4  = 0x9081003c R5  = 0x3884 R6  = 0x48014e40 R7  = 0x902d8104
  R8  = 0x908d80f8 R9  = 0x38808005 R10 = 0x48014e2c R11 = 0x9421ff50
  R12 = 0x9081003c R13 = 0x3886 R14 = 0x48014e20 R15 = 0x9421ff50
  R16 = 0x9081003c R17 = 0x3887 R18 = 0x48014e10 R19 = 0x9421ff50
  R20 = 0x9081003c R21 = 0x3888 R22 = 0x48014e00 R23 = 0x9421ff50
  R24 = 0x9081003c R25 = 0x388c R26 = 0x48014df0 R27 = 0x9421ff50
  R28 = 0x9081003c R29 = 0x38800018 R30 = 0x48014de0 R31 = 0x902d8104
  CR  = 0x9421ff50
  CTR = 0x3882
  XER = 0x9081003c
  LR  = 0x48015578
 DEAR = 0x
  ESR = 0x0200
 MCSR = 0x
  executing thread ID = 0x0a010001, name = UI1



Best Regards,
Zainab Olalekan
diff --git a/bsps/powerpc/mvme3100/start/bspstart.c 
b/bsps/powerpc/mvme3100/start/bspstart.c
index f27304c144..4df6f5326a 100644
--- a/bsps/powerpc/mvme3100/start/bspstart.c
+++ b/bsps/powerpc/mvme3100/start/bspstart.c
@@ -52,6 +52,8 @@
 extern unsigned long __rtems_end[];
 extern unsigned  ppc_exc_lock_std, ppc_exc_gpr3_std;
 
+extern bool _IO_All_drivers_initialized;
+
 /*
  * Copy Additional boot param passed by boot loader
  */
@@ -249,7 +251,7 @@ VpdBufRec  vpdData [] = {
   printk("CPU 0x%x - rev 0x%x\n", myCpu, myCpuRevision);
 
 #ifdef SHOW_MORE_INIT_SETTINGS
-  printk("Additionnal boot options are %s\n", BSP_commandline_string);
+  printk("Additional boot options are %s\n", BSP_commandline_string);
   printk("Initial system stack at %" PRIxPTR "\n", (uintptr_t) stack);
 #endif
 
@@ -431,7 +433,15 @@ void bsp_start( void )
 
 static void mvme3100_i2c_initialize(void)
 {
+   
+  printk(" call BSP_i2c_initialize() with _IO_All_drivers_initialized 
= true\n");
+  printk("assumes that major 0 is assigned to i2c -\n");
+  
+  printk("now trying to i2c intializ