issues while porting clocks in linux kernel (4.9) -


i trying port system clocks custom soc linux kernel (4.9). had setup minimal lookup table crystal osc, pll & spi below:

static struct clk_lookup clocks[] = {         clkdev_init(null,           "ref",              &ref_clk),         clkdev_init(null,           "pll1",             &pll1_clk),         clkdev_init(null,           "apb_pclk",         &apb_clk),         clkdev_init("spi0",         null,               &spi_clk), }; 

and im trying add clocks using func:

int __init clocks_init(void) {     clkdev_add_table(clocks, array_size(clocks)); }; 

but booting fails while trying setup clocks. below error:

unable handle kernel null pointer dereference @ virtual address 00000008 [    0.000000]` pgd = c0004000 [    0.000000] [00000008] *pgd=00000000 [    0.000000] internal error: oops: 5 [#1] arm [    0.000000] modules linked in: [    0.000000] cpu: 0 pid: 1 comm: swapper not tainted 4.9.22+ #22 [    0.000000] hardware name: customsoc [    0.000000] task: c6898000 task.stack: c688e000 [    0.000000] pc @ __clk_get_hw+0x1c/0x24 [    0.000000] lr @ clkdev_add_table+0x40/0x78 [    0.000000] pc : [<c025ce40>]    lr : [<c025cda8>]    psr: a0000053 [    0.000000] sp : c688fe58  ip : c688fe68  fp : c688fe64 [    0.000000] r10: 00000000  r9 : 0000003d  r8 : c04867f0 [    0.000000] r7 : c04ea720  r6 : c04ea714  r5 : 00000004  r4 : c04cbf50 [    0.000000] r3 : 00000000  r2 : 00000000  r1 : 00000004  r0 : c04cbf98 [    0.000000] flags: nzcv  irqs on  fiqs off  mode svc_32  isa arm  segment user [    0.000000] control: 00c5387d  table: c0004008  dac: 00000055 [    0.000000] process swapper (pid: 1, stack limit = 0xc688e188) [    0.000000] stack: (0xc688fe58 0xc6890000) [    0.000000] fe40:                                                       c688fe84 c688fe68 [    0.000000] fe60: c025cda8 c025ce30 00000000 c8905000 c0501020 c04ae820 c688fea4 c688fe88 [    0.000000] fe80: c048a6d8 c025cd74 00000000 c03004d4 c04ca798 c04cd718 c688febc c688fea8 [    0.000000] fea0: c048a4a8 c048a62c c04c27f8 00000003 c688fecc c688fec0 c0486814 c048a49c [    0.000000] fec0: c688ff4c c688fed0 c0009a6c c04867fc c0483614 c02268b8 00000000 c0434e84 [    0.000000] fee0: c6fffe00 c032ca2c c688ff4c c688fef8 c003e5f4 c0483604 c0050050 c00bb438 [    0.000000] ff00: 00000000 c030f938 00000003 00000003 00000000 c04349c0 c03d2654 00000000 [    0.000000] ff20: c688ff4c c04c27f8 00000003 c0501020 c04ae820 00000000 0000003d c04ae838 [    0.000000] ff40: c688ff94 c688ff50 c0483ec0 c0009a2c 00000003 00000003 00000000 c04835f8 [    0.000000] ff60: 9d322010 62802229 20a41903 00000000 c030cc94 00000000 00000000 00000000 [    0.000000] ff80: 00000000 00000000 c688ffac c688ff98 c030ccac c0483d48 ffffffff 00000000 [    0.000000] ffa0: 00000000 c688ffb0 c00107c8 c030cca0 00000000 00000000 00000000 00000000 [    0.000000] ffc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 [    0.000000] ffe0: 00000000 00000000 00000000 00000000 00000013 00000000 0114212a 8dce8aa8 [    0.000000] [<c025ce40>] (__clk_get_hw) [<c025cda8>] (clkdev_add_table+0x40/0x78) [    0.000000] [<c025cda8>] (clkdev_add_table) [<c048a6d8>] (bbsoc_clocks_init+0xb8/0xec) [    0.000000] [<c048a6d8>] (clocks_init) [<c048a4a8>] (bcm2835_init+0x18/0x74) [    0.000000] [<c048a4a8>] (board_init) [<c0486814>] (customize_machine+0x24/0x30) [    0.000000] [<c0486814>] (customize_machine) [<c0009a6c>] (do_one_initcall+0x4c/0x180) [    0.000000] [<c0009a6c>] (do_one_initcall) [<c0483ec0>] (kernel_init_freeable+0x184/0x254) [    0.000000] [<c0483ec0>] (kernel_init_freeable) [<c030ccac>] (kernel_init+0x18/0x114) [    0.000000] [<c030ccac>] (kernel_init) [<c00107c8>] (ret_from_fork+0x14/0x2c) [    0.000000] code: e52de004 e8bd4000 e3500000 15903000 (15930008)  [    0.000000] ---[ end trace 671b49261be9dc6a ]--- [    0.000000] kernel panic - not syncing: attempted kill init! exitcode=0x0000000b 

upon investigation func: __clk_get_hw(cl->clk); trying access clk->core->hw (this failing!)

struct clk_hw *__clk_get_hw(struct clk *clk) {                        return !clk ? null : clk->core->hw; } export_symbol_gpl(__clk_get_hw); 

any suggestions on setting clock configuration linux kernel, highly helpful. thanks, vivek


Comments

Popular posts from this blog

c# - Binding a comma separated list to a List<int> in asp.net web api -

Delphi 7 and decode UTF-8 base64 -

html - Is there any way to exclude a single element from the style? (Bootstrap) -