mirror of
https://git.planet-casio.com/Lephenixnoir/gint.git
synced 2025-04-20 09:56:56 +02:00
Compare commits
No commits in common. "c2cc3e48f2188ca968bc038ede21cbbe4b6040f9" and "3ade0894d8ca70aa5612d8eecae86b86e9f30952" have entirely different histories.
c2cc3e48f2
...
3ade0894d8
3 changed files with 2 additions and 127 deletions
|
@ -157,11 +157,6 @@ void cpg_get_overclock_setting(struct cpg_overclock_setting *s);
|
||||||
/* Applies the specified overclock setting. */
|
/* Applies the specified overclock setting. */
|
||||||
void cpg_set_overclock_setting(struct cpg_overclock_setting const *s);
|
void cpg_set_overclock_setting(struct cpg_overclock_setting const *s);
|
||||||
|
|
||||||
/* Sets whether or node CPG parameters are retained when world switching, i.e.
|
|
||||||
mostly whether overclock setting will remain while in the OS world and when
|
|
||||||
leaving the add-in. */
|
|
||||||
void cpg_set_overclock_permanent(bool permanent);
|
|
||||||
|
|
||||||
//---
|
//---
|
||||||
// Sleep functions
|
// Sleep functions
|
||||||
//---
|
//---
|
||||||
|
|
|
@ -12,7 +12,6 @@
|
||||||
#include <gint/clock.h>
|
#include <gint/clock.h>
|
||||||
#include <gint/gint.h>
|
#include <gint/gint.h>
|
||||||
#include <gint/hardware.h>
|
#include <gint/hardware.h>
|
||||||
#include <gint/drivers.h>
|
|
||||||
#include <gint/mpu/cpg.h>
|
#include <gint/mpu/cpg.h>
|
||||||
#include <gint/mpu/bsc.h>
|
#include <gint/mpu/bsc.h>
|
||||||
#include <gint/mpu/wdt.h>
|
#include <gint/mpu/wdt.h>
|
||||||
|
@ -143,17 +142,6 @@ void cpg_set_overclock_setting(struct cpg_overclock_setting const *s)
|
||||||
cpu_atomic_end();
|
cpu_atomic_end();
|
||||||
}
|
}
|
||||||
|
|
||||||
void cpg_set_overclock_permanent(bool permanent)
|
|
||||||
{
|
|
||||||
extern gint_driver_t drv_cpg;
|
|
||||||
int i = &drv_cpg - gint_drivers;
|
|
||||||
|
|
||||||
if(permanent)
|
|
||||||
gint_driver_flags[i] |= GINT_DRV_SHARED;
|
|
||||||
else
|
|
||||||
gint_driver_flags[i] &= ~GINT_DRV_SHARED;
|
|
||||||
}
|
|
||||||
|
|
||||||
#if GINT_HW_FX
|
#if GINT_HW_FX
|
||||||
|
|
||||||
static struct cpg_overclock_setting const settings_fx9860g_sh3[5] = {
|
static struct cpg_overclock_setting const settings_fx9860g_sh3[5] = {
|
||||||
|
|
112
src/usb/setup.c
112
src/usb/setup.c
|
@ -33,9 +33,7 @@ static usb_dc_device_t dc_device = {
|
||||||
.bMaxPacketSize0 = 64,
|
.bMaxPacketSize0 = 64,
|
||||||
.idVendor = htole16(0x07cf), /* Casio Computer Co., Ltd. */
|
.idVendor = htole16(0x07cf), /* Casio Computer Co., Ltd. */
|
||||||
.idProduct = htole16(ID_PRODUCT),
|
.idProduct = htole16(ID_PRODUCT),
|
||||||
/* CASIO sets bcdDevice to 0x0100. Use a different value so that Windows
|
.bcdDevice = htole16(0x0100),
|
||||||
won't rely on cached registry entries and check for WCID support. */
|
|
||||||
.bcdDevice = htole16(0x0177),
|
|
||||||
.iManufacturer = 0,
|
.iManufacturer = 0,
|
||||||
.iProduct = 0,
|
.iProduct = 0,
|
||||||
.iSerialNumber = 0,
|
.iSerialNumber = 0,
|
||||||
|
@ -57,65 +55,6 @@ static usb_dc_string_t dc_string0 = {
|
||||||
.data = { htole16(0x0409) }, /* English (US) */
|
.data = { htole16(0x0409) }, /* English (US) */
|
||||||
};
|
};
|
||||||
|
|
||||||
struct MOS1_String_0xEE_Descriptor {
|
|
||||||
usb_dc_string_t dc;
|
|
||||||
u16 signature[7];
|
|
||||||
u8 bMS_VendorCode;
|
|
||||||
u8 bPad;
|
|
||||||
};
|
|
||||||
static struct MOS1_String_0xEE_Descriptor dc_string_ee = {
|
|
||||||
.dc = { .bLength = 18, .bDescriptorType = USB_DC_STRING },
|
|
||||||
.signature = { 0x4D00, 0x5300, 0x4600, 0x5400, 0x3100, 0x3000, 0x3000 },
|
|
||||||
.bMS_VendorCode = 0x7b, /* Arbitrarily-chosen value */
|
|
||||||
.bPad = 0,
|
|
||||||
};
|
|
||||||
|
|
||||||
struct MOS1_Extended_Compat_ID_Function_Section {
|
|
||||||
u8 bFirstInterfaceNumber;
|
|
||||||
u8 bReserved1;
|
|
||||||
u8 compatibleID[8];
|
|
||||||
u8 subcompatibleID[8];
|
|
||||||
u8 bReserved2[6];
|
|
||||||
};
|
|
||||||
struct MOS1_Extended_Compat_ID_Descriptor {
|
|
||||||
// 16 byte header
|
|
||||||
u32 dwLength;
|
|
||||||
u16 bcdVersion;
|
|
||||||
u16 wIndex;
|
|
||||||
u8 bCount;
|
|
||||||
u8 bReserved[7];
|
|
||||||
|
|
||||||
// hardcoded to size 1 for convenience here
|
|
||||||
struct MOS1_Extended_Compat_ID_Function_Section f;
|
|
||||||
};
|
|
||||||
static struct MOS1_Extended_Compat_ID_Descriptor dc_compatid = {
|
|
||||||
.dwLength = htole32(0x10 + 24 * 1),
|
|
||||||
.bcdVersion = htole16(0x0100),
|
|
||||||
.wIndex = htole16(0x0004),
|
|
||||||
.bCount = 1,
|
|
||||||
.f = {
|
|
||||||
.bFirstInterfaceNumber = 0,
|
|
||||||
.bReserved1 = 0x01,
|
|
||||||
.compatibleID = { 0x57, 0x49, 0x4e, 0x55, 0x53, 0x42, 0x00, 0x00 },
|
|
||||||
.subcompatibleID = { 0 },
|
|
||||||
.bReserved2 = { 0 },
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
struct MOS1_Extended_Properties_Descriptor {
|
|
||||||
// 10 byte header
|
|
||||||
u32 dwLength;
|
|
||||||
u16 bcdVersion;
|
|
||||||
u16 wIndex;
|
|
||||||
u16 wCount;
|
|
||||||
};
|
|
||||||
static struct MOS1_Extended_Properties_Descriptor dc_extprops = {
|
|
||||||
.dwLength = htole32(10),
|
|
||||||
.bcdVersion = htole16(0x0100),
|
|
||||||
.wIndex = htole16(0x0005),
|
|
||||||
.wCount = htole16(0),
|
|
||||||
};
|
|
||||||
|
|
||||||
GCONSTRUCTOR static void set_strings(void)
|
GCONSTRUCTOR static void set_strings(void)
|
||||||
{
|
{
|
||||||
char const *serial_base =
|
char const *serial_base =
|
||||||
|
@ -200,40 +139,12 @@ static void req_get_descriptor(int wValue, int wLength)
|
||||||
|
|
||||||
else if(type == USB_DC_STRING)
|
else if(type == USB_DC_STRING)
|
||||||
{
|
{
|
||||||
usb_dc_string_t *dc;
|
usb_dc_string_t *dc = usb_dc_string_get(num);
|
||||||
if(num == 0xee) {
|
|
||||||
dc = &dc_string_ee.dc;
|
|
||||||
USB_LOG("Selecting MOS1 string descriptor\n");
|
|
||||||
}
|
|
||||||
else
|
|
||||||
dc = usb_dc_string_get(num);
|
|
||||||
if(dc) dcp_write(dc, dc->bLength);
|
if(dc) dcp_write(dc, dc->bLength);
|
||||||
else USB.DCPCTR.PID = 2;
|
else USB.DCPCTR.PID = 2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void req_get_MOS_feature_descriptor(int wValue, int wIndex, int wLength)
|
|
||||||
{
|
|
||||||
int intf = (wValue >> 8) & 0xff;
|
|
||||||
int page = (wValue & 0xff);
|
|
||||||
|
|
||||||
USB_LOG("GET_MS_DESCRIPTOR: i%d p%d #%d len:%d\n", intf, page, wIndex, wLength);
|
|
||||||
|
|
||||||
if(wIndex == 0x0004) {
|
|
||||||
/* Extended Compat ID descriptor */
|
|
||||||
dcp_write(&dc_compatid, wLength);
|
|
||||||
USB_LOG("Compat ID descriptor given\n");
|
|
||||||
}
|
|
||||||
else if(wIndex == 0x0005) {
|
|
||||||
/* Extended Properties descriptor */
|
|
||||||
dcp_write(&dc_extprops, wLength);
|
|
||||||
USB_LOG("Extended properties descriptor given\n");
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
USB_LOG("Unknown MS descriptor!\n");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static void req_get_configuration(void)
|
static void req_get_configuration(void)
|
||||||
{
|
{
|
||||||
USB_LOG("GET_CONFIGURATION -> %d\n", 1);
|
USB_LOG("GET_CONFIGURATION -> %d\n", 1);
|
||||||
|
@ -247,12 +158,6 @@ static void req_set_configuration(int wValue)
|
||||||
USB.DCPCTR.PID = (wValue == 1) ? 1 : 2;
|
USB.DCPCTR.PID = (wValue == 1) ? 1 : 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void req_get_device_status(void)
|
|
||||||
{
|
|
||||||
USB_LOG("GET_STATUS device -> 0x0001\n");
|
|
||||||
dcp_write("\x01\x00", 2);
|
|
||||||
}
|
|
||||||
|
|
||||||
void usb_req_setup(void)
|
void usb_req_setup(void)
|
||||||
{
|
{
|
||||||
/* Respond to setup requests */
|
/* Respond to setup requests */
|
||||||
|
@ -276,19 +181,6 @@ void usb_req_setup(void)
|
||||||
else if(bmRequestType == 0x00 && bRequest == SET_CONFIGURATION)
|
else if(bmRequestType == 0x00 && bRequest == SET_CONFIGURATION)
|
||||||
req_set_configuration(wValue);
|
req_set_configuration(wValue);
|
||||||
|
|
||||||
else if(bmRequestType == 0x80 && bRequest == GET_STATUS)
|
|
||||||
req_get_device_status();
|
|
||||||
// 0x81 / GET_STATUS : get intf status
|
|
||||||
// 0x82 / GET_STATUS : get endpoint status
|
|
||||||
|
|
||||||
// CESG502 initial 0x01 comm
|
|
||||||
// else if(bmRequestType == 0x41 && bRequest == 0x01)
|
|
||||||
// USB.DCPCTR.PID = 1;
|
|
||||||
|
|
||||||
else if((bmRequestType == 0xc0 || bmRequestType == 0xc1)
|
|
||||||
&& bRequest == 0x7b)
|
|
||||||
req_get_MOS_feature_descriptor(wValue, wIndex, wLength);
|
|
||||||
|
|
||||||
/* TODO: Other standard SETUP requests */
|
/* TODO: Other standard SETUP requests */
|
||||||
else USB_LOG("SETUP: bRequest=%02x bmRequestType=%02x wValue=%04x\n"
|
else USB_LOG("SETUP: bRequest=%02x bmRequestType=%02x wValue=%04x\n"
|
||||||
" wIndex=%04x wLength=%d -> ???\n",
|
" wIndex=%04x wLength=%d -> ???\n",
|
||||||
|
|
Loading…
Add table
Reference in a new issue