summaryrefslogtreecommitdiffstats
path: root/kernel/arch/arm/mach-omap2/prm-regbits-44xx.h
blob: e794828dee553b2e943bc74b4ae819874c40455e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
/*
 * OMAP44xx Power Management register bits
 *
 * Copyright (C) 2009-2010 Texas Instruments, Inc.
 * Copyright (C) 2009-2010 Nokia Corporation
 *
 * Paul Walmsley (paul@pwsan.com)
 * Rajendra Nayak (rnayak@ti.com)
 * Benoit Cousson (b-cousson@ti.com)
 *
 * This file is automatically generated from the OMAP hardware databases.
 * We respectfully ask that any modifications to this file be coordinated
 * with the public linux-omap@vger.kernel.org mailing list and the
 * authors above to ensure that the autogeneration scripts are kept
 * up-to-date with the file contents.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 as
 * published by the Free Software Foundation.
 */

#ifndef __ARCH_ARM_MACH_OMAP2_PRM_REGBITS_44XX_H
#define __ARCH_ARM_MACH_OMAP2_PRM_REGBITS_44XX_H

#define OMAP4430_C2C_RST_SHIFT						10
#define OMAP4430_CMDRA_VDD_CORE_L_MASK					(0xff << 0)
#define OMAP4430_CMDRA_VDD_IVA_L_MASK					(0xff << 8)
#define OMAP4430_CMDRA_VDD_MPU_L_MASK					(0xff << 16)
#define OMAP4430_DATA_SHIFT						16
#define OMAP4430_ERRORGAIN_MASK						(0xff << 16)
#define OMAP4430_ERROROFFSET_MASK					(0xff << 24)
#define OMAP4430_EXTERNAL_WARM_RST_SHIFT				5
#define OMAP4430_FORCEUPDATE_MASK					(1 << 1)
#define OMAP4430_GLOBAL_COLD_RST_SHIFT					0
#define OMAP4430_GLOBAL_WARM_SW_RST_SHIFT				1
#define OMAP4430_GLOBAL_WUEN_MASK					(1 << 16)
#define OMAP4430_HSMCODE_MASK						(0x7 << 0)
#define OMAP4430_SRMODEEN_MASK						(1 << 4)
#define OMAP4430_HSMODEEN_MASK						(1 << 3)
#define OMAP4430_HSSCLL_SHIFT						24
#define OMAP4430_ICEPICK_RST_SHIFT					9
#define OMAP4430_INITVDD_MASK						(1 << 2)
#define OMAP4430_INITVOLTAGE_MASK					(0xff << 8)
#define OMAP4430_LASTPOWERSTATEENTERED_SHIFT				24
#define OMAP4430_LASTPOWERSTATEENTERED_MASK				(0x3 << 24)
#define OMAP4430_LOGICRETSTATE_SHIFT					2
#define OMAP4430_LOGICRETSTATE_MASK					(1 << 2)
#define OMAP4430_LOGICSTATEST_SHIFT					2
#define OMAP4430_LOGICSTATEST_MASK					(1 << 2)
#define OMAP4430_LOSTCONTEXT_DFF_MASK					(1 << 0)
#define OMAP4430_LOSTMEM_AESSMEM_MASK					(1 << 8)
#define OMAP4430_LOWPOWERSTATECHANGE_SHIFT				4
#define OMAP4430_LOWPOWERSTATECHANGE_MASK				(1 << 4)
#define OMAP4430_MPU_SECURITY_VIOL_RST_SHIFT				2
#define OMAP4430_MPU_WDT_RST_SHIFT					3
#define OMAP4430_OCP_NRET_BANK_ONSTATE_MASK				(0x3 << 24)
#define OMAP4430_OCP_NRET_BANK_RETSTATE_MASK				(1 << 12)
#define OMAP4430_OCP_NRET_BANK_STATEST_MASK				(0x3 << 12)
#define OMAP4430_OFF_SHIFT						0
#define OMAP4430_ON_SHIFT						24
#define OMAP4430_ON_MASK						(0xff << 24)
#define OMAP4430_ONLP_SHIFT						16
#define OMAP4430_RAMP_DOWN_COUNT_SHIFT					16
#define OMAP4430_RAMP_UP_COUNT_SHIFT					0
#define OMAP4430_RAMP_UP_PRESCAL_SHIFT					8
#define OMAP4430_REGADDR_SHIFT						8
#define OMAP4430_RET_SHIFT						8
#define OMAP4430_RST_GLOBAL_WARM_SW_MASK				(1 << 0)
#define OMAP4430_SA_VDD_CORE_L_SHIFT					0
#define OMAP4430_SA_VDD_CORE_L_0_6_MASK					(0x7f << 0)
#define OMAP4430_SA_VDD_IVA_L_SHIFT					8
#define OMAP4430_SA_VDD_IVA_L_PRM_VC_SMPS_SA_MASK			(0x7f << 8)
#define OMAP4430_SA_VDD_MPU_L_SHIFT					16
#define OMAP4430_SA_VDD_MPU_L_PRM_VC_SMPS_SA_MASK			(0x7f << 16)
#define OMAP4430_SCLH_SHIFT						0
#define OMAP4430_SCLL_SHIFT						8
#define OMAP4430_SECURE_WDT_RST_SHIFT					4
#define OMAP4430_SLAVEADDR_SHIFT					0
#define OMAP4430_SMPSWAITTIMEMAX_SHIFT					8
#define OMAP4430_SMPSWAITTIMEMIN_SHIFT					8
#define OMAP4430_TIMEOUT_SHIFT						0
#define OMAP4430_TIMEOUTEN_MASK						(1 << 3)
#define OMAP4430_VALID_MASK						(1 << 24)
#define OMAP4430_VDDMAX_SHIFT						24
#define OMAP4430_VDDMIN_SHIFT						16
#define OMAP4430_VDD_CORE_VOLT_MGR_RST_SHIFT				8
#define OMAP4430_VDD_IVA_VOLT_MGR_RST_SHIFT				7
#define OMAP4430_VDD_MPU_VOLT_MGR_RST_SHIFT				6
#define OMAP4430_VOLRA_VDD_CORE_L_MASK					(0xff << 0)
#define OMAP4430_VOLRA_VDD_IVA_L_MASK					(0xff << 8)
#define OMAP4430_VOLRA_VDD_MPU_L_MASK					(0xff << 16)
#define OMAP4430_VPENABLE_MASK						(1 << 0)
#define OMAP4430_VPVOLTAGE_MASK						(0xff << 0)
#define OMAP4430_VP_CORE_TRANXDONE_ST_MASK				(1 << 21)
#define OMAP4430_VP_IVA_TRANXDONE_ST_MASK				(1 << 29)
#define OMAP4430_VP_MPU_TRANXDONE_ST_MASK				(1 << 5)
#define OMAP4430_VSTEPMAX_SHIFT						0
#define OMAP4430_VSTEPMIN_SHIFT						0
#define OMAP4430_WUCLK_CTRL_MASK					(1 << 8)
#define OMAP4430_WUCLK_STATUS_SHIFT					9
#define OMAP4430_WUCLK_STATUS_MASK					(1 << 9)
#endif
platform_device *pdev = container_of(dev, struct platform_device, dev); int ret; ret = platform_get_irq(pdev, 0); if (ret < 0) return ret; ccp->irq = ret; ret = request_irq(ccp->irq, ccp_irq_handler, 0, "ccp", dev); if (ret) { dev_notice(dev, "unable to allocate IRQ (%d)\n", ret); return ret; } return 0; } static int ccp_get_irqs(struct ccp_device *ccp) { struct device *dev = ccp->dev; int ret; ret = ccp_get_irq(ccp); if (!ret) return 0; /* Couldn't get an interrupt */ dev_notice(dev, "could not enable interrupts (%d)\n", ret); return ret; } static void ccp_free_irqs(struct ccp_device *ccp) { struct device *dev = ccp->dev; free_irq(ccp->irq, dev); } static struct resource *ccp_find_mmio_area(struct ccp_device *ccp) { struct device *dev = ccp->dev; struct platform_device *pdev = container_of(dev, struct platform_device, dev); struct resource *ior; ior = platform_get_resource(pdev, IORESOURCE_MEM, 0); if (ior && (resource_size(ior) >= 0x800)) return ior; return NULL; } static int ccp_platform_probe(struct platform_device *pdev) { struct ccp_device *ccp; struct ccp_platform *ccp_platform; struct device *dev = &pdev->dev; enum dev_dma_attr attr; struct resource *ior; int ret; ret = -ENOMEM; ccp = ccp_alloc_struct(dev); if (!ccp) goto e_err; ccp_platform = devm_kzalloc(dev, sizeof(*ccp_platform), GFP_KERNEL); if (!ccp_platform) goto e_err; ccp->dev_specific = ccp_platform; ccp->get_irq = ccp_get_irqs; ccp->free_irq = ccp_free_irqs; ior = ccp_find_mmio_area(ccp); ccp->io_map = devm_ioremap_resource(dev, ior); if (IS_ERR(ccp->io_map)) { ret = PTR_ERR(ccp->io_map); goto e_err; } ccp->io_regs = ccp->io_map; attr = device_get_dma_attr(dev); if (attr == DEV_DMA_NOT_SUPPORTED) { dev_err(dev, "DMA is not supported"); goto e_err; } ccp_platform->coherent = (attr == DEV_DMA_COHERENT); if (ccp_platform->coherent) ccp->axcache = CACHE_WB_NO_ALLOC; else ccp->axcache = CACHE_NONE; ret = dma_set_mask_and_coherent(dev, DMA_BIT_MASK(48)); if (ret) { dev_err(dev, "dma_set_mask_and_coherent failed (%d)\n", ret); goto e_err; } dev_set_drvdata(dev, ccp); ret = ccp_init(ccp); if (ret) goto e_err; dev_notice(dev, "enabled\n"); return 0; e_err: dev_notice(dev, "initialization failed\n"); return ret; } static int ccp_platform_remove(struct platform_device *pdev) { struct device *dev = &pdev->dev; struct ccp_device *ccp = dev_get_drvdata(dev); ccp_destroy(ccp); dev_notice(dev, "disabled\n"); return 0; } #ifdef CONFIG_PM static int ccp_platform_suspend(struct platform_device *pdev, pm_message_t state) { struct device *dev = &pdev->dev; struct ccp_device *ccp = dev_get_drvdata(dev); unsigned long flags; unsigned int i; spin_lock_irqsave(&ccp->cmd_lock, flags); ccp->suspending = 1; /* Wake all the queue kthreads to prepare for suspend */ for (i = 0; i < ccp->cmd_q_count; i++) wake_up_process(ccp->cmd_q[i].kthread); spin_unlock_irqrestore(&ccp->cmd_lock, flags); /* Wait for all queue kthreads to say they're done */ while (!ccp_queues_suspended(ccp)) wait_event_interruptible(ccp->suspend_queue, ccp_queues_suspended(ccp)); return 0; } static int ccp_platform_resume(struct platform_device *pdev) { struct device *dev = &pdev->dev; struct ccp_device *ccp = dev_get_drvdata(dev); unsigned long flags; unsigned int i; spin_lock_irqsave(&ccp->cmd_lock, flags); ccp->suspending = 0; /* Wake up all the kthreads */ for (i = 0; i < ccp->cmd_q_count; i++) { ccp->cmd_q[i].suspended = 0; wake_up_process(ccp->cmd_q[i].kthread); } spin_unlock_irqrestore(&ccp->cmd_lock, flags); return 0; } #endif #ifdef CONFIG_ACPI static const struct acpi_device_id ccp_acpi_match[] = { { "AMDI0C00", 0 }, { }, }; MODULE_DEVICE_TABLE(acpi, ccp_acpi_match); #endif #ifdef CONFIG_OF static const struct of_device_id ccp_of_match[] = { { .compatible = "amd,ccp-seattle-v1a" }, { }, }; MODULE_DEVICE_TABLE(of, ccp_of_match); #endif static struct platform_driver ccp_platform_driver = { .driver = { .name = "ccp", #ifdef CONFIG_ACPI .acpi_match_table = ccp_acpi_match, #endif #ifdef CONFIG_OF .of_match_table = ccp_of_match, #endif }, .probe = ccp_platform_probe, .remove = ccp_platform_remove, #ifdef CONFIG_PM .suspend = ccp_platform_suspend, .resume = ccp_platform_resume, #endif }; int ccp_platform_init(void) { return platform_driver_register(&ccp_platform_driver); } void ccp_platform_exit(void) { platform_driver_unregister(&ccp_platform_driver); }