Giter Site home page Giter Site logo

bootlin's People

Contributors

krinkinmu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

admyly

bootlin's Issues

Awesome Work, and small updates

Hello, first let me say thank you! I really realy enjoyed reading your ftdi reverse breakdown. I am in awe and jealous of your skills. So i too your kernel driver, my first attempt it didnt work failed the check in probe. I immediately went to sniffing a working userland tool (should have tried more with stock code) and found a fair amount of differences, here ill list sum;

const u16 FTDI_BIT_MODE_RESET = 0x00ff;
const u16 FTDI_BIT_MODE_MPSSE = 0x02ff;

ret = usb_control_msg(
	ftdi->udev, usb_sndctrlpipe(ftdi->udev, 0),
	/* bRequest = */0x00,
	/* bRequestType = */0x40,
	/* wValue = */0x0000,
	/* wIndex =  */0x0000,
	/* data = */NULL,
	/* size = */0,
	ftdi->io_timeout);
if (ret < 0)
	return ret;

ret = usb_control_msg(
	ftdi->udev, usb_sndctrlpipe(ftdi->udev, 0),
	/* bRequest = */0x03,
	/* bRequestType = */0x40,
	/* wValue = */0x4138,
	/* wIndex =  */0x0001,
	/* data = */NULL,
	/* size = */0,
	ftdi->io_timeout);
if (ret < 0)
	return ret;

ret = usb_control_msg(
	ftdi->udev, usb_sndctrlpipe(ftdi->udev, 0),
	/* bRequest = */0x00,
	/* bRequestType = */0x40,
	/* wValue = */0x0000,
	/* wIndex =  */0x0001,
	/* data = */NULL,
	/* size = */0,
	ftdi->io_timeout);
if (ret < 0)
	return ret;

ret = usb_control_msg(
	ftdi->udev, usb_sndctrlpipe(ftdi->udev, 0),
	/* bRequest = */0x00,
	/* bRequestType = */0x40,
	/* wValue = */0x0001,
	/* wIndex =  */0x0001,
	/* data = */NULL,
	/* size = */0,
	ftdi->io_timeout);
if (ret < 0)
	return ret;

ret = usb_control_msg(
	ftdi->udev, usb_sndctrlpipe(ftdi->udev, 0),
	/* bRequest = */0x00,
	/* bRequestType = */0x40,
	/* wValue = */0x0002,
	/* wIndex =  */0x0001,
	/* data = */NULL,
	/* size = */0,
	ftdi->io_timeout);
if (ret < 0)
	return ret;

As you can see I had to change the RESET, MPSSE and wIindex also added a baudrate change (I dunno either), and still had to remove the check ftdi_mpsse_verify. I then added smbus support and blocked binding to bank B (Im using ft2232h) and everything is working great! Will add kernel mods for speed and bank A/B options and /sys entries for changing speed etc as well when I find time. I realize you probly already know but in case someone stumbles here;

PURGE RX AND TX BUFFERS

	/* bRequest = */0x00,
	/* bRequestType = */0x40,
	/* wValue = */0x0000,
	/* wIndex =  */0x0001,
	/* data = */NULL,
	/* size = */0,

PURGE RX BUFFERS

	/* bRequest = */0x00,
	/* bRequestType = */0x40,
	/* wValue = */0x0001,
	/* wIndex =  */0x0001,
	/* data = */NULL,
	/* size = */0,

PURGE TX BUFFERS

	/* bRequest = */0x00,
	/* bRequestType = */0x40,
	/* wValue = */0x0002,
	/* wIndex =  */0x0001,
	/* data = */NULL,
	/* size = */0,

Ialso get extra 2 bytes on invalid/bad commands i guess an error code. My versions is located here;
https://github.com/bm16ton/ft2232-mpsse-i2c-spi-kern-drivers
and integrated into my kernel here;
https://github.com/bm16ton/yoga-c630-linux-kernel
with hopefully more updates coming soon. Is there any reason this couldnt be submitted for mainline kernel? Again great work and thank you!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.