Commit | Line | Data |
---|---|---|
920dae64 AT |
1 | /* |
2 | * ========== Copyright Header Begin ========================================== | |
3 | * | |
4 | * OpenSPARC T2 Processor File: ll_mod.h | |
5 | * Copyright (c) 2006 Sun Microsystems, Inc. All Rights Reserved. | |
6 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES. | |
7 | * | |
8 | * The above named program is free software; you can redistribute it and/or | |
9 | * modify it under the terms of the GNU General Public | |
10 | * License version 2 as published by the Free Software Foundation. | |
11 | * | |
12 | * The above named program is distributed in the hope that it will be | |
13 | * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of | |
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
15 | * General Public License for more details. | |
16 | * | |
17 | * You should have received a copy of the GNU General Public | |
18 | * License along with this work; if not, write to the Free Software | |
19 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. | |
20 | * | |
21 | * ========== Copyright Header End ============================================ | |
22 | */ | |
23 | /* | |
24 | * Copyright 2004 by Sun Microsystems, Inc. | |
25 | * All rights reserved. | |
26 | * | |
27 | * @(#)ll_mod.h 1.3 04/08/04 | |
28 | */ | |
29 | #ifndef _LL_MOD_H | |
30 | #define _LL_MOD_H | |
31 | ||
32 | #include "pci.h" | |
33 | #include "pci_dev.h" | |
34 | #include "ll_impl.h" | |
35 | #include "dr.h" | |
36 | #include "module.h" | |
37 | ||
38 | #define TARGET_PAGE_SIZE 0x2000 /* This should _not_ be here.*/ | |
39 | #define TARGET_PAGE_OFFSET (TARGET_PAGE_SIZE - 1) /* Ditto. */ | |
40 | ||
41 | struct ll_rdce { | |
42 | struct ll_rdce *prev, *next; | |
43 | uint32_t ino; | |
44 | char name[LL_MAXNAMELEN]; | |
45 | }; | |
46 | ||
47 | class LL : public Module, public genericPciDev{ | |
48 | ||
49 | private: | |
50 | //mmi_instance_t instance; | |
51 | bool initialized; | |
52 | ||
53 | public: | |
54 | ll_structT *sp; | |
55 | struct ll_rdce *rdce_head; | |
56 | struct ll_rdce *rdce_tail; | |
57 | ||
58 | private: | |
59 | ll_structT *allocation_obj(); | |
60 | int LL::reg_access(char *buf, LWord paddr, bool_t wr); | |
61 | uint32_t rd_status(); | |
62 | uint32_t rd_errorcode(); | |
63 | uint32_t rd_arg_addr(); | |
64 | uint32_t rd_res_addr(); | |
65 | void wr_control(uint32_t val); | |
66 | void wr_arg_addr(uint32_t val); | |
67 | void wr_res_addr(uint32_t val); | |
68 | void cmd_read(); | |
69 | void cmd_write(); | |
70 | void cmd_getattr(); | |
71 | void cmd_setattr(); | |
72 | void cmd_access(); | |
73 | void cmd_lookup(); | |
74 | void cmd_create(); | |
75 | void cmd_remove(); | |
76 | void cmd_rename(); | |
77 | void cmd_mkdir(); | |
78 | void cmd_rmdir(); | |
79 | void cmd_readdir(); | |
80 | void cmd_symlink(); | |
81 | void cmd_readlink(); | |
82 | void path_canon(char *canonpath, const char *path, const char *name); | |
83 | int rdc_init(struct ll_fhandle *fhp); | |
84 | void dma_in(uint64_t vaddr, void *data, long count); | |
85 | void dma_out(uint64_t vaddr, void *data, long count); | |
86 | uint64_t get_translation(uint64_t vaddr); | |
87 | void crc(uint32_t *crcp, uchar_t *bp, size_t n); | |
88 | bool dump(FILE *); | |
89 | bool restore(FILE *); | |
90 | ||
91 | public: | |
92 | LL(const char *modname, const char *instance_name); | |
93 | ~LL(); | |
94 | ||
95 | public: // Module interface | |
96 | const char *get_help(); | |
97 | bool parse_arg(const char *); | |
98 | bool check_args(); | |
99 | void init_done(); | |
100 | void module_added(mmi_instance_t, const char*); | |
101 | void module_deleted(mmi_instance_t, const char*); | |
102 | void modinfo(); | |
103 | void *get_interface(const char*); | |
104 | void get_dev_props(); | |
105 | ||
106 | private: | |
107 | uint64_t pciMem32_base; | |
108 | uint64_t pciMem32_size; | |
109 | //pure virtual functions of genricPciDev class | |
110 | mmi_instance_t pciDev_getInstance(); | |
111 | const char * pciDev_getName(); | |
112 | void pciDev_confAccessCb(bool_t wr, uint64_t offset, uint8_t size); | |
113 | ||
114 | //override the pciTarget_mem32access function | |
115 | pciXactnStatus pciTarget_mem32access(uint64_t offset, bool wr,uint64_t * buf, uint8_t size); | |
116 | ||
117 | void initPci(); | |
118 | }; | |
119 | ||
120 | #endif /* LL_MOD_H */ |