diff options
Diffstat (limited to 'arch/mips/txx9/generic/setup_tx4938.c')
-rw-r--r-- | arch/mips/txx9/generic/setup_tx4938.c | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/arch/mips/txx9/generic/setup_tx4938.c b/arch/mips/txx9/generic/setup_tx4938.c index 0d8517ad3ad0..af724e53ef91 100644 --- a/arch/mips/txx9/generic/setup_tx4938.c +++ b/arch/mips/txx9/generic/setup_tx4938.c | |||
@@ -334,3 +334,59 @@ void __init tx4938_mtd_init(int ch) | |||
334 | return; /* disabled */ | 334 | return; /* disabled */ |
335 | txx9_physmap_flash_init(ch, start, size, &pdata); | 335 | txx9_physmap_flash_init(ch, start, size, &pdata); |
336 | } | 336 | } |
337 | |||
338 | static void __init tx4938_stop_unused_modules(void) | ||
339 | { | ||
340 | __u64 pcfg, rst = 0, ckd = 0; | ||
341 | char buf[128]; | ||
342 | |||
343 | buf[0] = '\0'; | ||
344 | local_irq_disable(); | ||
345 | pcfg = ____raw_readq(&tx4938_ccfgptr->pcfg); | ||
346 | switch (txx9_pcode) { | ||
347 | case 0x4937: | ||
348 | if (!(pcfg & TX4938_PCFG_SEL2)) { | ||
349 | rst |= TX4938_CLKCTR_ACLRST; | ||
350 | ckd |= TX4938_CLKCTR_ACLCKD; | ||
351 | strcat(buf, " ACLC"); | ||
352 | } | ||
353 | break; | ||
354 | case 0x4938: | ||
355 | if (!(pcfg & TX4938_PCFG_SEL2) || | ||
356 | (pcfg & TX4938_PCFG_ETH0_SEL)) { | ||
357 | rst |= TX4938_CLKCTR_ACLRST; | ||
358 | ckd |= TX4938_CLKCTR_ACLCKD; | ||
359 | strcat(buf, " ACLC"); | ||
360 | } | ||
361 | if ((pcfg & | ||
362 | (TX4938_PCFG_ATA_SEL | TX4938_PCFG_ISA_SEL | | ||
363 | TX4938_PCFG_NDF_SEL)) | ||
364 | != TX4938_PCFG_NDF_SEL) { | ||
365 | rst |= TX4938_CLKCTR_NDFRST; | ||
366 | ckd |= TX4938_CLKCTR_NDFCKD; | ||
367 | strcat(buf, " NDFMC"); | ||
368 | } | ||
369 | if (!(pcfg & TX4938_PCFG_SPI_SEL)) { | ||
370 | rst |= TX4938_CLKCTR_SPIRST; | ||
371 | ckd |= TX4938_CLKCTR_SPICKD; | ||
372 | strcat(buf, " SPI"); | ||
373 | } | ||
374 | break; | ||
375 | } | ||
376 | if (rst | ckd) { | ||
377 | txx9_set64(&tx4938_ccfgptr->clkctr, rst); | ||
378 | txx9_set64(&tx4938_ccfgptr->clkctr, ckd); | ||
379 | } | ||
380 | local_irq_enable(); | ||
381 | if (buf[0]) | ||
382 | pr_info("%s: stop%s\n", txx9_pcode_str, buf); | ||
383 | } | ||
384 | |||
385 | static int __init tx4938_late_init(void) | ||
386 | { | ||
387 | if (txx9_pcode != 0x4937 && txx9_pcode != 0x4938) | ||
388 | return -ENODEV; | ||
389 | tx4938_stop_unused_modules(); | ||
390 | return 0; | ||
391 | } | ||
392 | late_initcall(tx4938_late_init); | ||